Skip to content

TIME producer does not correct provided timestamp #563

@mrrosen

Description

@mrrosen

The documentation on transmit suggests the provided timestamp should be a UNIX timestamp, so have Epoch Jan 1 1970 UTC. However, the function does not correctly offset the provided timestamp as it does with the one produced internally if no timestamp is provided (https://canopen.readthedocs.io/en/latest/_modules/canopen/timestamp.html#TimeProducer.transmit).

Either the documentation should be fixed to say the provided timestamp should use the CANopen epoch or the line correcting the timestamp should be fixed to respect Python operator precedence:

delta = (timestamp or time.time()) - OFFSET

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions