![]() |
Midnight Sun Firmware
|
Structure representing the datagram header (In the payload) More...
#include <fota_datagram.h>
Public Attributes | |
| uint8_t | target_node_id |
| FotaDatagramType | type |
| uint16_t | num_packets |
| uint32_t | datagram_id |
| uint32_t | total_length |
| uint32_t | datagram_crc32 |
| uint32_t | packet_crc32 |
Structure representing the datagram header (In the payload)
Datagram Header Payload Format (20 bytes total):
+----------------—+-------------—+------------------------------------------------------------—+ | Field | Size (bytes) | Description | +----------------—+-------------—+------------------------------------------------------------—+ | target_node_id | 1 | Target node ID (0 = RF Board, 1,2... = CAN Bootloader board) | | type | 1 | Type of datagram (enum FotaDatagramType) | | num_packets | 2 | Number of data packets in this datagram (excluding header) | | datagram_id | 4 | Unique identifier for this datagram | | total_length | 4 | Total length of the datagram data | | datagram_crc32 | 4 | CRC32 of the entire datagram data | | packet_crc32 | 4 | CRC32 of this header packet payload | +----------------—+-------------—+------------------------------------------------------------—+
All fields are encoded in little-endian format.
| uint32_t datagram_crc32 |
CRC of the entire datagram for verification
| uint32_t datagram_id |
Unique ID for this datagram
| uint16_t num_packets |
Number of packets in this datagram excluding the header packet
| uint32_t packet_crc32 |
CRC of the header packet
| uint8_t target_node_id |
Target node ID
| uint32_t total_length |
Total length of datagram content
| FotaDatagramType type |
Type of datagram