Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_UartMsgTypes.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <cfg/cs_Config.h>
11#include <protocol/cs_Packets.h>
13
14union __attribute__((packed)) uart_msg_status_user_flags_t {
15 struct __attribute__((packed)) {
17 bool hasBeenSetUp : 1;
18 bool hasInternet : 1;
19 bool hasError : 1;
20 } flags;
21 uint8_t asInt;
22};
23
24union __attribute__((packed)) uart_msg_status_reply_flags_t {
25 struct __attribute__((packed)) {
27 bool hasBeenSetUp : 1;
28 bool hubMode : 1;
29 bool hasError : 1;
30 } flags;
31 uint8_t asInt;
32};
33
37};
38
39struct __attribute__((__packed__)) uart_msg_status_user_t {
40 uint8_t type; // See UartHubDataType.
42 uint8_t data[SERVICE_DATA_HUB_DATA_SIZE]; // Depends on type.
43};
44
45struct __attribute__((__packed__)) uart_msg_status_reply_t {
47};
48
49struct __attribute__((__packed__)) uart_msg_hello_t {
50 uint8_t sphereId;
52};
53
54struct __attribute__((__packed__)) uart_msg_heartbeat_t {
56};
57
58struct __attribute__((__packed__)) uart_msg_session_nonce_t {
60 uint8_t sessionNonce[SESSION_NONCE_LENGTH];
61};
62
63struct __attribute__((__packed__)) uart_msg_session_nonce_reply_t {
64 uint8_t sessionNonce[SESSION_NONCE_LENGTH];
65};
66
67struct __attribute__((__packed__)) uart_msg_hub_data_reply_header_t {
69 // Followed by data
70};
71
72struct __attribute__((__packed__)) uart_msg_mesh_result_packet_header_t {
75};
76
77struct __attribute__((__packed__)) uart_msg_log_common_header_t {
78 uint32_t fileNameHash;
79 uint16_t lineNumber; // Line number (starting at line 1) where the ; of this log is.
80 uint8_t logLevel; // SERIAL_VERBOSE, SERIAL_DEBUG, etc.
81 struct __attribute__((packed)) {
82 bool newLine : 1; // Whether this log should end with a new line.
83 bool reverse : 1; // Whether to print in reverse (arrays only).
84 } flags;
85};
86
87struct __attribute__((__packed__)) uart_msg_log_header_t {
89 uint8_t numArgs;
90 // Followed by <numArgs> args, with uart_msg_log_arg_header_t as header.
91};
92
93struct __attribute__((__packed__)) uart_msg_log_arg_header_t {
94 uint8_t argSize;
95 // Followed by <argSize> bytes.
96};
97
103};
104
105struct __attribute__((__packed__)) uart_msg_log_array_header_t {
107 uint8_t elementType; // ElementType
108 uint8_t elementSize;
109 // Followed by all elements, each of size <elementSize>.
110};
111
112struct __attribute__((__packed__)) uart_msg_power_t {
113 uint32_t timestamp;
123};
124
125struct __attribute__((__packed__)) uart_msg_current_t {
126 uint32_t timestamp;
128};
129
130struct __attribute__((__packed__)) uart_msg_voltage_t {
131 uint32_t timestamp;
133};
134
135struct __attribute__((__packed__)) uart_msg_adc_channel_config_t {
138};
#define CS_ADC_NUM_SAMPLES_PER_CHANNEL
Definition: cs_Config.h:148
#define SESSION_NONCE_LENGTH
Definition: cs_Packets.h:25
#define SERVICE_DATA_HUB_DATA_SIZE
Definition: cs_ServiceDataPackets.h:29
uint8_t stone_id_t
Definition: cs_Typedefs.h:23
uint16_t cs_ret_code_t
Definition: cs_Typedefs.h:21
uint8_t adc_channel_id_t
Definition: cs_Typedefs.h:31
ElementType
Definition: cs_UartMsgTypes.h:98
@ ELEMENT_TYPE_UNSIGNED_INTEGER
Definition: cs_UartMsgTypes.h:100
@ ELEMENT_TYPE_FLOAT
Definition: cs_UartMsgTypes.h:101
@ ELEMENT_TYPE_SIGNED_INTEGER
Definition: cs_UartMsgTypes.h:99
@ ELEMENT_TYPE_FROM_FORMAT
Definition: cs_UartMsgTypes.h:102
UartHubDataType
Definition: cs_UartMsgTypes.h:34
@ UART_HUB_DATA_TYPE_NONE
Definition: cs_UartMsgTypes.h:35
@ UART_HUB_DATA_TYPE_CROWNSTONE_HUB
Definition: cs_UartMsgTypes.h:36
Struct to configure an ADC channel.
Definition: cs_PacketsInternal.h:293
Header of a result packet.
Definition: cs_Packets.h:104
Definition: cs_UartMsgTypes.h:135
adc_channel_config_t config
Definition: cs_UartMsgTypes.h:137
adc_channel_id_t channel
Definition: cs_UartMsgTypes.h:136
Definition: cs_UartMsgTypes.h:125
uint32_t timestamp
Definition: cs_UartMsgTypes.h:126
Definition: cs_UartMsgTypes.h:54
uint16_t timeoutSeconds
Definition: cs_UartMsgTypes.h:55
Definition: cs_UartMsgTypes.h:49
uint8_t sphereId
Definition: cs_UartMsgTypes.h:50
uart_msg_status_reply_t status
Definition: cs_UartMsgTypes.h:51
Definition: cs_UartMsgTypes.h:67
cs_ret_code_t retCode
Definition: cs_UartMsgTypes.h:68
Definition: cs_UartMsgTypes.h:93
uint8_t argSize
Definition: cs_UartMsgTypes.h:94
Definition: cs_UartMsgTypes.h:105
uint8_t elementType
Definition: cs_UartMsgTypes.h:107
uint8_t elementSize
Definition: cs_UartMsgTypes.h:108
uart_msg_log_common_header_t header
Definition: cs_UartMsgTypes.h:106
Definition: cs_UartMsgTypes.h:77
bool newLine
Definition: cs_UartMsgTypes.h:82
bool reverse
Definition: cs_UartMsgTypes.h:83
uint16_t lineNumber
Definition: cs_UartMsgTypes.h:79
uint8_t logLevel
Definition: cs_UartMsgTypes.h:80
uint32_t fileNameHash
Definition: cs_UartMsgTypes.h:78
Definition: cs_UartMsgTypes.h:87
uart_msg_log_common_header_t header
Definition: cs_UartMsgTypes.h:88
uint8_t numArgs
Definition: cs_UartMsgTypes.h:89
Definition: cs_UartMsgTypes.h:72
stone_id_t stoneId
Definition: cs_UartMsgTypes.h:73
result_packet_header_t resultHeader
Definition: cs_UartMsgTypes.h:74
Definition: cs_UartMsgTypes.h:112
int32_t filteredCurrentRmsMA
Definition: cs_UartMsgTypes.h:116
int32_t avgZeroVoltage
Definition: cs_UartMsgTypes.h:118
int32_t filteredCurrentRmsMedianMA
Definition: cs_UartMsgTypes.h:117
int32_t avgZeroCurrent
Definition: cs_UartMsgTypes.h:119
int32_t powerMilliWattReal
Definition: cs_UartMsgTypes.h:121
int32_t avgPowerMilliWattReal
Definition: cs_UartMsgTypes.h:122
int32_t currentRmsMA
Definition: cs_UartMsgTypes.h:114
int32_t currentRmsMedianMA
Definition: cs_UartMsgTypes.h:115
int32_t powerMilliWattApparent
Definition: cs_UartMsgTypes.h:120
uint32_t timestamp
Definition: cs_UartMsgTypes.h:113
Definition: cs_UartMsgTypes.h:63
Definition: cs_UartMsgTypes.h:58
uint8_t timeoutMinutes
Definition: cs_UartMsgTypes.h:59
Definition: cs_UartMsgTypes.h:45
uart_msg_status_reply_flags_t flags
Definition: cs_UartMsgTypes.h:46
Definition: cs_UartMsgTypes.h:39
uint8_t type
Definition: cs_UartMsgTypes.h:40
uart_msg_status_user_flags_t flags
Definition: cs_UartMsgTypes.h:41
Definition: cs_UartMsgTypes.h:130
uint32_t timestamp
Definition: cs_UartMsgTypes.h:131
Definition: cs_UartMsgTypes.h:24
bool hasBeenSetUp
Definition: cs_UartMsgTypes.h:27
bool hubMode
Definition: cs_UartMsgTypes.h:28
bool hasError
Definition: cs_UartMsgTypes.h:29
uint8_t asInt
Definition: cs_UartMsgTypes.h:31
bool encryptionRequired
Definition: cs_UartMsgTypes.h:26
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: Jan 17,...
Definition: cs_UartMsgTypes.h:14
bool hasInternet
Definition: cs_UartMsgTypes.h:18
bool encryptionRequired
Definition: cs_UartMsgTypes.h:16
uint8_t asInt
Definition: cs_UartMsgTypes.h:21
bool hasBeenSetUp
Definition: cs_UartMsgTypes.h:17
bool hasError
Definition: cs_UartMsgTypes.h:19