Expand description
The C ABI for CAN bus framing.
These functions wrap [pamoja_can] for callers that reach the SDK through the
flat C boundary: classic CAN 2.0 and CAN-FD frames, the length encoding CAN-FD
uses above eight bytes, and the J1939 identifier that trucks, tractors, and
gensets ride on top of it.
A frame carries a payload of up to 64 bytes, so it crosses as an opaque handle
like every other payload-bearing type here. A J1939 identifier is only scalars,
so it crosses by value as PamojaJ1939Id, which keeps decoding an identifier
free of any allocation.
Structs§
- Pamoja
CanFrame - An opaque handle to a CAN frame.
- Pamoja
J1939 Id - The fields J1939 packs into an extended CAN identifier.
- Pamoja
J1939 Signals - The eight data bytes of a J1939 frame, addressed by the signals inside them.
Constants§
- PAMOJA_
J1939_ BROADCAST_ ADDRESS - The destination address every node on the bus reads.
- PAMOJA_
J1939_ NOT_ AVAILABLE - The byte a J1939 sender writes for a signal it is not reporting.
- PAMOJA_
J1939_ PRIORITY_ CONTROL - The priority a control message takes, ahead of ordinary traffic.
- PAMOJA_
J1939_ PRIORITY_ DEFAULT - The priority ordinary traffic takes.
- PAMOJA_
J1939_ PRIORITY_ LOWEST - The priority that yields to everything else on the bus.
Functions§
- pamoja_
can_ dlc_ to_ len - Returns the payload length a data length code encodes.
- pamoja_
can_ ⚠frame_ data - Returns a pointer to a frame’s payload bytes.
- pamoja_
can_ ⚠frame_ data_ len - Returns how many bytes
pamoja_can_frame_datapoints to. - pamoja_
can_ ⚠frame_ dlc - Returns a frame’s data length code, the length as it appears on the wire.
- pamoja_
can_ ⚠frame_ fd - Builds a CAN-FD frame.
- pamoja_
can_ ⚠frame_ free - Releases a frame handle.
- pamoja_
can_ ⚠frame_ id - Returns a frame’s identifier, already masked to 11 or 29 bits.
- pamoja_
can_ ⚠frame_ is_ extended - Reports whether a frame carries a 29-bit extended identifier.
- pamoja_
can_ ⚠frame_ is_ fd - Reports whether a frame is CAN-FD rather than classic CAN 2.0.
- pamoja_
can_ ⚠frame_ is_ remote - Reports whether a frame is a remote transmission request.
- pamoja_
can_ ⚠frame_ len - Returns how many payload bytes a frame carries.
- pamoja_
can_ ⚠frame_ new - Builds a classic CAN 2.0 frame.
- pamoja_
can_ ⚠frame_ remote - Builds a remote transmission request, which asks another node to send.
- pamoja_
can_ j1939_ broadcast - Composes the identifier of a J1939 broadcast, which every node on the bus reads.
- pamoja_
can_ j1939_ compose - Composes the extended CAN identifier a set of J1939 fields describes.
- pamoja_
can_ ⚠j1939_ decode - Decodes the J1939 fields out of an extended CAN identifier.
- pamoja_
can_ len_ to_ dlc - Returns the data length code that encodes a payload length.
- pamoja_
can_ signals_ new - Builds a J1939 payload with every signal marked not available.
- pamoja_
can_ signals_ set_ u8 - Writes a one-byte signal at the offset its parameter group defines.
- pamoja_
can_ signals_ set_ u16 - Writes a two-byte little-endian signal at the offset its group defines.
- pamoja_
can_ ⚠signals_ u8 - Reads a one-byte signal at the offset its parameter group defines.
- pamoja_
can_ ⚠signals_ u16 - Reads a two-byte little-endian signal at the offset its group defines.