-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathcloud_module.h
More file actions
56 lines (45 loc) · 1.11 KB
/
cloud_module.h
File metadata and controls
56 lines (45 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/
#ifndef _CLOUD_MODULE_H_
#define _CLOUD_MODULE_H_
#include <zephyr/kernel.h>
#include <zephyr/zbus/zbus.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Channels provided by this module */
ZBUS_CHAN_DECLARE(
CLOUD_CHAN
);
struct cloud_payload {
uint8_t buffer[CONFIG_APP_CLOUD_PAYLOAD_BUFFER_MAX_SIZE];
/* Length of the data stored inside the buffer */
size_t buffer_data_len;
};
struct cloud_shadow_response {
uint8_t buffer[CONFIG_APP_CLOUD_SHADOW_RESPONSE_BUFFER_MAX_SIZE];
/* Length of the data stored inside the buffer */
size_t buffer_data_len;
};
enum cloud_msg_type {
CLOUD_DISCONNECTED = 0x1,
CLOUD_CONNECTED_READY_TO_SEND,
CLOUD_CONNECTED_PAUSED,
CLOUD_CONNECTION_ATTEMPT_COUNT_REACHED,
CLOUD_PAYLOAD_JSON,
CLOUD_POLL_SHADOW,
CLOUD_SHADOW_RESPONSE,
};
struct cloud_msg {
enum cloud_msg_type type;
struct cloud_payload payload;
struct cloud_shadow_response response;
};
#define MSG_TO_CLOUD_MSG(_msg) (*(const struct cloud_msg *)_msg)
#ifdef __cplusplus
}
#endif
#endif /* _CLOUD_MODULE_H_ */