Skip to content

Commit b932dce

Browse files
splitting Commands definition for utils offload
1 parent 14debfe commit b932dce

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/message/Commands.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@
1616

1717
#include <stdint.h>
1818
#include <stddef.h>
19+
#include <interfaces/message.h>
1920

2021
/******************************************************************************
2122
* DEFINE
2223
******************************************************************************/
2324

25+
26+
// FIXME make this constants into an enum
27+
// TODO remove provisioning constants
2428
#define THING_ID_SIZE 37
2529
#define SHA256_SIZE 32
2630
#define URL_SIZE 256
@@ -31,10 +35,10 @@
3135
TYPEDEF
3236
******************************************************************************/
3337

34-
enum CommandId: uint32_t {
38+
enum CommandId: MessageId {
3539

3640
/* Device commands */
37-
DeviceBeginCmdId,
41+
DeviceBeginCmdId = ArduinoIOTCloudStartMessageId,
3842
ThingBeginCmdId,
3943
ThingUpdateCmdId,
4044
ThingDetachCmdId,
@@ -60,14 +64,10 @@ enum CommandId: uint32_t {
6064
TimezoneCommandDownId,
6165

6266
/* Unknown command id */
63-
UnknownCmdId
64-
};
65-
66-
struct Command {
67-
CommandId id;
67+
UnknownCmdId,
6868
};
6969

70-
typedef Command Message;
70+
typedef Message Command;
7171

7272
struct DeviceBeginCmd {
7373
Command c;
@@ -149,7 +149,7 @@ struct TimezoneCommandDown {
149149
};
150150

151151
union CommandDown {
152-
struct Command c;
152+
Command c;
153153
struct OtaUpdateCmdDown otaUpdateCmdDown;
154154
struct ThingUpdateCmd thingUpdateCmd;
155155
struct ThingDetachCmd thingDetachCmd;

0 commit comments

Comments
 (0)