ark::canbus

Enums

Typedefs

Defined in “ark/canbus/canopen/sdo.hh”:

Variables

Defined in “ark/canbus/canopen.hh”:

  • constexpr uint32_t COB_FLAG_STANDARD= (0 « 29)

  • constexpr uint32_t COB_FLAG_EXTENDED= (1 « 29)

  • constexpr uint32_t COB_FLAG_RTR= (0 « 30)

  • constexpr uint32_t COB_FLAG_NO_RTR= (1 « 30)

  • constexpr uint32_t COB_FLAG_ENABLED= (0 « 31)

  • constexpr uint32_t COB_FLAG_DISABLED= (1 « 31)

Defined in “ark/canbus/canopen/node.hh”:

  • constexpr auto kHeartbeatPeriod= std::chrono::seconds(1)

Defined in “ark/canbus/cia315_frames.hh”:

  • constexpr uint8_t CIA315_PREAMBLE_MAGIC= 0x55
    The ‘preamble’ magic bytes that begin each packet.

Defined in “ark/canbus/testing/has_vcan.hh”:

  • constexpr const auto *const TEST_CANBUS_NAME= “ark_test_vcan0”
    Name for the magic CANbus name we use for testing.

Classes

Functions

Declared in “ark/canbus/can_csv_io.hh”:

  • std::string can_csv_header()
    Outputs the header for the CAN CSV format.

  • std::string to_csv_row(const CanPacket & packet)
    Converts the given CAN packet into a CSV row, suitable for parsing in other languages. This is a bit different then the generic CSV tool, in that it formats things in a way that is more usable.

Declared in “ark/canbus/canopen.hh”:

  • core::ByteBuffer encode_nmt_heartbeat(NmtStateCode state)
    Encodes the given state code into a CANopen packet, returning the contents in the given byte buffer.

  • NmtStateCode decode_nmt_heartbeat(const core::ByteBuffer & buffer)
    Decodes the given CANopen packet, as if it was an NMT heartbeat message.

  • uint8_t encode_nmt_heartbeat(void * destination, NmtStateCode state)
    Encodes the given NMT command into a CANopen packet. The data is written to the destination, and the size is returned.

  • uint8_t encode_nmt_command(void * destination, NmtCommandCode command, uint8_t node_id)
    Encodes the given NMT command into a CANopen packet. The data is written to the destination, and the size is returned.

  • NmtStateCode decode_nmt_heartbeat(const void * source, size_t source_length)
    Decodes the given CANopen packet, as if it was an NMT heartbeat message.

  • core::ByteBuffer encode_emcy(const EmergencyDataObject & object)
    Encodes the given EMCY data into specified packet.

  • uint8_t encode_emcy(void * destination, const EmergencyDataObject & object)
    Encodes the given EMCY data into specified packet. The data is written to the given destination, and the length of bytes written is written out to output_length. Destination must always be at least 8 bytes large.

  • EmergencyDataObject decode_emcy(const core::ByteBuffer & buffer)
    Decodes the given buffer into an EMCY.

  • EmergencyDataObject decode_emcy(const void * source, size_t source_length)
    Decodes the given buffer into an SDO.

  • uint32_t encode_cob_id(FunctionCode function_code, uint32_t node_id)

  • uint32_t encode_cob_id(const CanOpenPacket & packet)

  • std::string to_str(const CanOpenPacket & packet)
    Emits a CanOpenPacket as a string suitable for printing on a single line.

  • CanOpenPacket decode_canopen_packet(uint32_t can_id, const void * source, size_t source_length, std::chrono::steady_clock::time_point receive_time)
    Decode the canopen packet.

  • CanOpenPacket decode_canopen_packet(const CanPacket & packet)

  • CanPacket encode_canopen_packet(const CanOpenPacket & canopen_packet)

Declared in “ark/canbus/canopen/bytes.hh”:

  • T as_type(const ark::core::ByteBuffer & buffer)

  • T as_type(const PdoResult & buffer)

  • T as_type(const SdoResult & buffer)

  • ark::core::ByteBuffer as_buffer(const T & value)

  • void unpack_buffer(const ark::core::ByteBuffer & buffer, Args &… args)

  • void unpack_buffer(const PdoResult & result, Args &… args)

  • void unpack_buffer(const SdoResult & result, Args &… args)

  • ark::core::ByteBuffer pack_buffer(const Args &… args)

Declared in “ark/canbus/canopen/encoder.hh”:

  • void decode(FunctionCode & code, uint32_t raw)

  • void encode(uint32_t & raw, const FunctionCode & code)

  • uint32_t encode(const FunctionCode & code)

  • void decode(NmtCommandCode & code, uint8_t raw)

  • void encode(uint8_t & raw, const NmtCommandCode & code)

  • uint8_t encode(const NmtCommandCode & code)

  • void decode(NmtStateCode & state, uint8_t raw)

  • void encode(uint8_t & raw, const NmtStateCode & state)

  • uint8_t encode(const NmtStateCode & state)

  • void decode(CommandSpecifier & cmd, uint8_t raw)

  • void encode(uint8_t & raw, const CommandSpecifier & cmd)

  • uint8_t encode(const CommandSpecifier & cmd)

  • void decode(ConsumerHeartbeat & heartbeat, uint32_t raw)

  • void encode(uint32_t & raw, const ConsumerHeartbeat & heartbeat)

  • uint32_t encode(const ConsumerHeartbeat & heartbeat)

Declared in “ark/canbus/canopen/error_descriptions.hh”:

  • const char * canopen_error_to_string(uint32_t code)
    Returns a human readable string for the given error description.

Declared in “ark/canbus/cia315_frames.hh”:

Declared in “ark/canbus/sae_j1939.hh”:

  • void decode(SaeJ1939CanId & id, uint32_t canid)

  • void encode(uint32_t & canid, const SaeJ1939CanId & id)

Declared in “ark/canbus/testing/has_vcan.hh”:

  • bool has_vcan()
    Returns true if we have a vcan device, or false otherwise. If false, prints a warning message.