Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
common.h
Go to the documentation of this file.
1
10#ifndef INFUSE_SDK_INCLUDE_INFUSE_EPACKET_INTERFACE_COMMON_H_
11#define INFUSE_SDK_INCLUDE_INFUSE_EPACKET_INTERFACE_COMMON_H_
12
13#include <stdint.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
25/* Versioned data frame */
27 /* AEAD associated data */
28 union {
29 struct {
30 /* Frame version */
31 uint8_t version;
32 /* Payload type */
33 uint8_t type;
34 /* Payload flags */
35 uint16_t flags;
36 /* Network or device key identifier */
37 uint8_t key_identifier[3];
38 /* Infuse device ID (upper 4 bytes) */
40 } __packed;
41 uint8_t raw[11];
43 /* AEAD encryption nonce (IV) */
44 union {
45 struct {
46 /* Infuse device ID (lower 4 bytes) */
48 /* Local GPS time (seconds) */
49 uint32_t gps_time;
50 /* Packet sequence number */
51 uint16_t sequence;
52 /* Random entropy */
53 uint16_t entropy;
54 } __packed;
55 uint8_t raw[12];
57 /* Ciphertext + tag bytes */
58 uint8_t ciphertext_tag[];
59} __packed;
60
61/* Unversioned data frame */
63 /* AEAD associated data */
64 union {
65 struct {
66 /* Payload type */
67 uint8_t type;
68 /* Payload flags */
69 uint16_t flags;
70 /* Network or device key identifier */
71 uint8_t key_identifier[3];
72 /* Infuse device ID (upper 4 bytes) */
74 } __packed;
75 uint8_t raw[10];
77 /* AEAD encryption nonce (IV) */
78 union {
79 struct {
80 /* Infuse device ID (lower 4 bytes) */
82 /* Local GPS time (seconds) */
83 uint32_t gps_time;
84 /* Packet sequence number */
85 uint16_t sequence;
86 /* Random entropy */
87 uint16_t entropy;
88 } __packed;
89 uint8_t raw[12];
91 /* Ciphertext + tag bytes */
92 uint8_t ciphertext_tag[];
93} __packed;
94
99#ifdef __cplusplus
100}
101#endif
102
103#endif /* INFUSE_SDK_INCLUDE_INFUSE_EPACKET_INTERFACE_COMMON_H_ */
uint8_t key_identifier[3]
Definition common.h:71
uint32_t device_id_lower
Definition common.h:81
union epacket_v0_unversioned_frame_format::@22 associated_data
uint16_t entropy
Definition common.h:87
uint32_t gps_time
Definition common.h:83
union epacket_v0_unversioned_frame_format::@23 nonce
uint8_t ciphertext_tag[]
Definition common.h:92
uint8_t type
Definition common.h:67
uint16_t flags
Definition common.h:69
uint8_t raw[10]
Definition common.h:75
uint32_t device_id_upper
Definition common.h:73
uint16_t sequence
Definition common.h:85
Definition common.h:26
uint8_t raw[11]
Definition common.h:41
union epacket_v0_versioned_frame_format::@16 associated_data
uint16_t flags
Definition common.h:35
uint32_t gps_time
Definition common.h:49
uint8_t key_identifier[3]
Definition common.h:37
uint32_t device_id_upper
Definition common.h:39
uint8_t type
Definition common.h:33
union epacket_v0_versioned_frame_format::@17 nonce
uint8_t version
Definition common.h:31
uint16_t entropy
Definition common.h:53
uint8_t ciphertext_tag[]
Definition common.h:58
uint16_t sequence
Definition common.h:51
uint32_t device_id_lower
Definition common.h:47