#include <can.h>

Data Fields | |
| union { | |
| uint32_t frame | |
| 32-bit CAN frame aligned with frame_fields (bit members) More... | |
| struct { | |
| uint32_t __pad0__: 16 | |
| Unused space. More... | |
| uint32_t data_len: 4 | |
| Data length. More... | |
| uint32_t __pad1__: 10 | |
| Unused space. More... | |
| uint32_t is_rtr: 1 | |
| Message is an RTR type. More... | |
| uint32_t is_29bit: 1 | |
| If message ID is 29-bit type. More... | |
| } frame_fields | |
| }; | |
| uint32_t | msg_id |
| CAN Message ID (11-bit or 29-bit) More... | |
| can_data_t | data |
| CAN data. More... | |
| struct { | |
| uint32_t msg_id: 11 | |
| 11-bit message-id More... | |
| uint32_t __pad0__: 5 | |
| Unused. More... | |
| uint32_t data_len: 4 | |
| Message length. More... | |
| uint32_t __pad1__: 4 | |
| Unused. More... | |
| uint32_t semphr: 2 | |
| Semaphore bits. More... | |
| uint32_t __pad2__: 4 | |
| Unused. More... | |
| uint32_t rtr: 1 | |
| RTR message. More... | |
| uint32_t __pad3__: 1 | |
| Unused (FF bit, not applicable to FullCAN) More... | |
| }; | |
| struct { | |
| uint16_t id: 11 | |
| Standard 11-bit CAN ID. More... | |
| uint16_t fc_intr: 1 | |
| Message interrupt bit: ONLY USED FOR FULLCAN. More... | |
| uint16_t disable: 1 | |
| Set to 1 to disable the slot. More... | |
| uint16_t can_num: 3 | |
| CAN controller number (0=CAN1, 1=CAN2) More... | |
| }; | |
| uint16_t | raw |
| uint32_t | id: 29 |
| Extended 29-bit CAN ID. More... | |
| uint32_t | can_num: 3 |
| CAN controller number (0=CAN1, 1=CAN2) More... | |
| uint32_t | sec: 6 |
| uint32_t | min: 6 |
| uint32_t | hour: 5 |
| uint32_t | dow: 3 |
| uint32_t | day: 5 |
| uint32_t | __pad4__: 3 |
| uint32_t | month: 4 |
| uint32_t | __pad5__: 4 |
| uint32_t | year:12 |
| uint32_t | __pad6__: 4 |
| uint32_t | doy:12 |
| uint32_t | __pad7__: 20 |
| uint8_t | src |
| Sender address. More... | |
| uint8_t | pkt_id |
| Sender's packet id (sequence) More... | |
| uint8_t | retries |
| Packet retry count. More... | |
| mesh_packet_t | pkt |
| The packet itself. More... | |
| uint16_t | timer_ms |
| Running time. MUST BE UINT16 due to hard-coded usage of UINT16_MAX. More... | |
| uint16_t | timeout_ms: 15 |
| Target time when timer expires. We don't need a lot of bits for this. More... | |
| uint16_t | disc_pkt: 1 |
| Flag if this is a route discovery packet. More... | |
| uint16_t | pkts_sent |
| Packets we sent out with our address. More... | |
| uint16_t | pkts_intercepted |
| Packets we receipted within our mesh network. More... | |
| uint16_t | pkts_repeated |
| Packets we repeated for others. More... | |
| uint16_t | pkts_retried |
| Packets we retried with our address. More... | |
| uint16_t | pkts_retried_others |
| Packets retried for others. More... | |
| uint8_t | rte_entries |
| Current number of routing entries. More... | |
| uint8_t | rte_overwritten |
| Number of times a routing entry over-wrote an existing entry. More... | |
| uint8_t | version: 3 |
| Mesh Version (1-7) – MUST BE 1st member of this struct. More... | |
| uint8_t | retries_rem: 3 |
| Packet retries remaining (pad to 8 bits) More... | |
| uint8_t | pkt_type: 2 |
| The type of mesh packet. More... | |
| uint8_t | hop_count: 4 |
| Hop count of packet (1st packet counts as 0 hops) More... | |
| uint8_t | hop_count_max: 4 |
| Max hop count limit. More... | |
| uint8_t | pkt_seq_num |
| Sequence number of the packet. More... | |
| uint8_t | data_len |
| Length of the packet data. More... | |
| uint8_t | dst |
| Destination address. More... | |
| mesh_pkt_addr_t | nwk |
| Packet network address. More... | |
| mesh_pkt_addr_t | mac |
| Packet physical address. More... | |
| mesh_pkt_info_t | info |
| Packet header. More... | |
| uint8_t | data [MESH_DATA_PAYLOAD_SIZE] |
| Actual data within the payload. More... | |
Detailed Description
Type definition of a CAN message with bit-fields (assuming little-endian machine) DO NOT CHANGE THIS STRUCTURE - it maps to the hardware
Typedef of a FullCAN message stored in memory DO NOT CHANGE THIS STRUCTURE - it maps to the hardware
Standard ID HW filtering structure. The single entries (not group) must be an even number count, so a second entry can be used and should be marked disabled (disable bit set to 1) to make the count an even number. DO NOT CHANGE THIS STRUCTURE - it maps to the hardware
Extended ID entry is just the ID and the CAN BUS number DO NOT CHANGE THIS STRUCTURE - it maps to the hardware
This struct aligns with the LPC Hardware's consolidated RTC registers. The un-named chars are just for padding according to LPC CTIME registers.
Fields that make a packet unique are kept in history to avoid duplicate packet handling.
Mesh Pending packet type Only 16-bit timer is needed which can supply up to 65,535ms value, which is far above a useful mesh packet retry value
Statistics structure that is sent if MESH_USE_STATISTICS is set to non-zero value. This data is sent by the node sending ack response packet. Current size is 12 bytes, and this should be kept to a minimum such that an ACK response packet can accommodate this data into the payload.
Mesh packet header type 4-bit hop-count gets us 15 hops max, good enough for simple mesh.
Mesh packet address type
The structure of a single packet.
Field Documentation
| union { ... } |
| struct { ... } |
| struct { ... } |
| uint32_t __attribute__::__pad0__ |
Unused space.
Unused.
| uint32_t __attribute__::__pad1__ |
Unused space.
Unused.
| uint32_t __attribute__::__pad2__ |
Unused.
| uint32_t __attribute__::__pad3__ |
Unused (FF bit, not applicable to FullCAN)
| uint32_t __attribute__::__pad4__ |
| uint32_t __attribute__::__pad5__ |
| uint32_t __attribute__::__pad6__ |
| uint32_t __attribute__::__pad7__ |
| uint16_t __attribute__::can_num |
CAN controller number (0=CAN1, 1=CAN2)
| uint32_t __attribute__::can_num |
CAN controller number (0=CAN1, 1=CAN2)
| can_data_t __attribute__::data |
CAN data.
| uint8_t __attribute__::data[MESH_DATA_PAYLOAD_SIZE] |
Actual data within the payload.
| uint32_t __attribute__::data_len |
Data length.
Message length.
| uint8_t __attribute__::data_len |
Length of the packet data.
| uint32_t __attribute__::day |
| uint16_t __attribute__::disable |
Set to 1 to disable the slot.
| uint16_t __attribute__::disc_pkt |
Flag if this is a route discovery packet.
| uint32_t __attribute__::dow |
| uint32_t __attribute__::doy |
| uint8_t __attribute__::dst |
Destination address.
| uint16_t __attribute__::fc_intr |
Message interrupt bit: ONLY USED FOR FULLCAN.
| uint32_t __attribute__::frame |
32-bit CAN frame aligned with frame_fields (bit members)
| struct { ... } __attribute__::frame_fields |
| uint8_t __attribute__::hop_count |
Hop count of packet (1st packet counts as 0 hops)
| uint8_t __attribute__::hop_count_max |
Max hop count limit.
| uint32_t __attribute__::hour |
| uint16_t __attribute__::id |
Standard 11-bit CAN ID.
| uint32_t __attribute__::id |
Extended 29-bit CAN ID.
| mesh_pkt_info_t __attribute__::info |
Packet header.
| uint32_t __attribute__::is_29bit |
If message ID is 29-bit type.
| uint32_t __attribute__::is_rtr |
Message is an RTR type.
| mesh_pkt_addr_t __attribute__::mac |
Packet physical address.
| uint32_t __attribute__::min |
| uint32_t __attribute__::month |
| uint32_t __attribute__::msg_id |
CAN Message ID (11-bit or 29-bit)
11-bit message-id
| mesh_pkt_addr_t __attribute__::nwk |
Packet network address.
| mesh_packet_t __attribute__::pkt |
The packet itself.
| uint8_t __attribute__::pkt_id |
Sender's packet id (sequence)
| uint8_t __attribute__::pkt_seq_num |
Sequence number of the packet.
| uint8_t __attribute__::pkt_type |
The type of mesh packet.
- See also
- mesh_protocol_t
| uint16_t __attribute__::pkts_intercepted |
Packets we receipted within our mesh network.
| uint16_t __attribute__::pkts_repeated |
Packets we repeated for others.
| uint16_t __attribute__::pkts_retried |
Packets we retried with our address.
| uint16_t __attribute__::pkts_retried_others |
Packets retried for others.
| uint16_t __attribute__::pkts_sent |
Packets we sent out with our address.
| uint16_t __attribute__::raw |
| uint8_t __attribute__::retries |
Packet retry count.
| uint8_t __attribute__::retries_rem |
Packet retries remaining (pad to 8 bits)
| uint8_t __attribute__::rte_entries |
Current number of routing entries.
| uint8_t __attribute__::rte_overwritten |
Number of times a routing entry over-wrote an existing entry.
| uint32_t __attribute__::rtr |
RTR message.
| uint32_t __attribute__::sec |
| uint32_t __attribute__::semphr |
Semaphore bits.
| uint8_t __attribute__::src |
Sender address.
Source address.
| uint16_t __attribute__::timeout_ms |
Target time when timer expires. We don't need a lot of bits for this.
| uint16_t __attribute__::timer_ms |
Running time. MUST BE UINT16 due to hard-coded usage of UINT16_MAX.
| uint8_t __attribute__::version |
Mesh Version (1-7) – MUST BE 1st member of this struct.
| uint32_t __attribute__::year |
The documentation for this struct was generated from the following files:
- /var/www/html/SJSU-DEV-Linux/firmware/default/lib/L2_Drivers/can.h
- /var/www/html/SJSU-DEV-Linux/firmware/default/lib/L2_Drivers/rtc.h
- /var/www/html/SJSU-DEV-Linux/firmware/default/lib/L4_IO/wireless/src/mesh.c
- /var/www/html/SJSU-DEV-Linux/firmware/default/lib/L4_IO/wireless/src/mesh_typedefs.h

1.8.11