Skip to content

Commit bf817df

Browse files
fixup! defining Message structure for encoding and decoding messages with an id specifier
1 parent bb59ceb commit bf817df

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/interfaces/message.h

+17
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@
1212

1313
typedef uint32_t MessageId;
1414

15+
/**
16+
* The following struct can be used as a template to create ArduinoCloud compatible
17+
* Messages that can be handled by encoders/decoders and other Cloud related message exchange
18+
* These kind of messages are required to be identifiable by a starting uint32_t uinique identification number.
19+
*
20+
* In order to use this structure you need to embed this into another structure and
21+
* add additional parameters
22+
*/
1523
struct Message {
1624
MessageId id;
1725
};
26+
27+
/**
28+
* The following enum is defined to assign Arduino MessageIds starting values
29+
* and boundaries and avoid value clashing
30+
*/
31+
enum : MessageId {
32+
ArduinoIOTCloudStartMessageId = 0x100,
33+
ArduinoProvisioningStartMessageId = 0x200,
34+
};

0 commit comments

Comments
 (0)