39 const uint8_t*
data =
nullptr;
283#define CS_ADC_REF_PIN_NOT_AVAILABLE 255
284#define CS_ADC_PIN_VDD 100
CommandHandlerTypes
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: Jun 3,...
Definition: cs_CommandTypes.h:10
#define CS_CONNECTION_PROTOCOL_VERSION
Definition: cs_Config.h:23
#define CS_ADC_NUM_CHANNELS
Definition: cs_Config.h:147
@ ERR_EVENT_UNHANDLED
Definition: cs_ErrorCodes.h:52
cs_mesh_model_msg_type_t
Definition: cs_MeshModelPackets.h:61
bool cs_multi_switch_item_is_valid(internal_multi_switch_item_t *item, size16_t size)
Definition: cs_PacketsInternal.h:136
internal_register_tracked_device_packet_t internal_update_tracked_device_packet_t
Definition: cs_PacketsInternal.h:276
CS_ADDRESS_TYPE
Copy of BLE_GAP_ADDR_TYPES.
Definition: cs_PacketsInternal.h:89
@ CS_ADDRESS_TYPE_ANONYMOUS
Definition: cs_PacketsInternal.h:94
@ CS_ADDRESS_TYPE_RANDOM_STATIC
Definition: cs_PacketsInternal.h:91
@ CS_ADDRESS_TYPE_RANDOM_PRIVATE_RESOLVABLE
Definition: cs_PacketsInternal.h:92
@ CS_ADDRESS_TYPE_PUBLIC
Definition: cs_PacketsInternal.h:90
@ CS_ADDRESS_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE
Definition: cs_PacketsInternal.h:93
cs_mesh_msg_reliability
How reliable a mesh message should be.
Definition: cs_PacketsInternal.h:164
@ CS_MESH_RELIABILITY_MEDIUM
Definition: cs_PacketsInternal.h:168
@ CS_MESH_RELIABILITY_LOWEST
Definition: cs_PacketsInternal.h:166
@ CS_MESH_RELIABILITY_HIGH
Definition: cs_PacketsInternal.h:169
@ CS_MESH_RELIABILITY_INVALID
Definition: cs_PacketsInternal.h:165
@ CS_MESH_RELIABILITY_LOW
Definition: cs_PacketsInternal.h:167
PresenceMutation
Definition: cs_PacketsInternal.h:255
@ OccupiedRoomsMaskChanged
cs_mesh_msg_urgency
How urgent a message is.
Definition: cs_PacketsInternal.h:177
@ CS_MESH_URGENCY_LOW
Definition: cs_PacketsInternal.h:178
@ CS_MESH_URGENCY_HIGH
Definition: cs_PacketsInternal.h:179
EncryptionAccessLevel
Packets (structs) that are used over the air, over uart, or stored in flash.
Definition: cs_Packets.h:36
@ NOT_SET
Definition: cs_Packets.h:43
uint16_t size16_t
Definition: cs_Typedefs.h:25
uint16_t cs_buffer_size_t
Definition: cs_Typedefs.h:20
uint8_t adc_buffer_seq_nr_t
Definition: cs_Typedefs.h:35
uint8_t adc_pin_id_t
Definition: cs_Typedefs.h:32
uint8_t stone_id_t
Definition: cs_Typedefs.h:23
#define TRACKED_DEVICE_TOKEN_SIZE
Definition: cs_Typedefs.h:38
static const uint8_t MAC_ADDRESS_LEN
Length of a MAC address.
Definition: cs_Typedefs.h:43
int16_t adc_sample_value_t
Definition: cs_Typedefs.h:34
uint16_t cs_ret_code_t
Definition: cs_Typedefs.h:21
uint8_t adc_channel_id_t
Definition: cs_Typedefs.h:31
uint8_t * buffer_ptr_t
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: 10 May....
Definition: cs_Typedefs.h:19
Struct communicated from the ADC class when it's done sampling a buffer.
Definition: cs_PacketsInternal.h:346
adc_buffer_seq_nr_t seqNr
Sequence number.
Definition: cs_PacketsInternal.h:359
bool valid
Whether this buffer has valid data.
Definition: cs_PacketsInternal.h:352
adc_channel_config_result_t config[CS_ADC_NUM_CHANNELS]
The ADC config that was used to sample this buffer.
Definition: cs_PacketsInternal.h:364
adc_sample_value_t * samples
Pointer to the samples.
Definition: cs_PacketsInternal.h:369
Result struct after configuring an ADC channel.
Definition: cs_PacketsInternal.h:333
int16_t maxValueMilliVolt
Maximum of the measured voltage (Vpin - Vpinref) range, in mV.
Definition: cs_PacketsInternal.h:338
adc_pin_id_t referencePin
The AIN pin of which its voltage will be subtracted from the voltage measured on adc_channel_config_r...
Definition: cs_PacketsInternal.h:335
adc_sample_value_t maxSampleValue
Maximum of the sample value range.
Definition: cs_PacketsInternal.h:340
adc_sample_value_t minSampleValue
Minimum of the sample value range.
Definition: cs_PacketsInternal.h:339
adc_pin_id_t pin
The AIN pin of this channel.
Definition: cs_PacketsInternal.h:334
int16_t minValueMilliVolt
Minimum of the measured voltage (Vpin - Vpinref) range, in mV.
Definition: cs_PacketsInternal.h:337
uint16_t samplingIntervalUs
The sampling interval in μs.
Definition: cs_PacketsInternal.h:336
Struct to configure an ADC channel.
Definition: cs_PacketsInternal.h:293
adc_pin_id_t pin
Definition: cs_PacketsInternal.h:294
adc_pin_id_t referencePin
Definition: cs_PacketsInternal.h:296
uint32_t rangeMilliVolt
Definition: cs_PacketsInternal.h:295
Struct to configure the ADC.
Definition: cs_PacketsInternal.h:306
adc_channel_id_t channelCount
Definition: cs_PacketsInternal.h:307
uint32_t samplingIntervalUs
Definition: cs_PacketsInternal.h:309
Parsed background advertisement.
Definition: cs_PacketsInternal.h:241
uint8_t flags
Definition: cs_PacketsInternal.h:246
uint8_t profileId
Definition: cs_PacketsInternal.h:245
uint8_t * macAddress
Definition: cs_PacketsInternal.h:242
uint8_t locationId
Definition: cs_PacketsInternal.h:244
int8_t adjustedRssi
Definition: cs_PacketsInternal.h:243
Definition: cs_PacketsInternal.h:249
uint8_t * macAddress
Definition: cs_PacketsInternal.h:250
int8_t rssi
Definition: cs_PacketsInternal.h:251
Unparsed background advertisement.
Definition: cs_PacketsInternal.h:229
uint8_t dataSize
Definition: cs_PacketsInternal.h:233
int8_t rssi
Definition: cs_PacketsInternal.h:235
uint8_t protocol
Definition: cs_PacketsInternal.h:230
uint8_t sphereId
Definition: cs_PacketsInternal.h:231
uint8_t * data
Definition: cs_PacketsInternal.h:232
uint8_t * macAddress
Definition: cs_PacketsInternal.h:234
Definition: cs_PacketsInternal.h:214
cs_data_t advertisementBuffer
Buffer that's no longer in use because advertising stopped.
Definition: cs_PacketsInternal.h:219
uint8_t advertisementHandle
Advertisement handle that stopped advertising.
Definition: cs_PacketsInternal.h:217
cs_data_t scanResponseBuffer
Buffer that's no longer in use because advertising stopped.
Definition: cs_PacketsInternal.h:221
uint16_t connectionHandle
Definition: cs_PacketsInternal.h:215
device_address_t address
Address of the connected device.
Definition: cs_PacketsInternal.h:223
Definition: cs_PacketsInternal.h:140
EncryptionAccessLevel accessLevel
Definition: cs_PacketsInternal.h:145
size16_t size
Definition: cs_PacketsInternal.h:144
buffer_ptr_t data
Definition: cs_PacketsInternal.h:143
CommandHandlerTypes type
Definition: cs_PacketsInternal.h:142
Definition: cs_PacketsInternal.h:71
cs_async_result_t(CommandHandlerTypes type, cs_ret_code_t resultCode)
Definition: cs_PacketsInternal.h:76
CommandHandlerTypes commandType
Definition: cs_PacketsInternal.h:72
cs_ret_code_t resultCode
Definition: cs_PacketsInternal.h:73
cs_data_t resultData
Definition: cs_PacketsInternal.h:74
cs_async_result_t(CommandHandlerTypes type, cs_ret_code_t resultCode, cs_data_t data)
Definition: cs_PacketsInternal.h:78
Variable length data encapsulation in terms of length and pointer to data.
Definition: cs_PacketsInternal.h:38
cs_buffer_size_t len
< Pointer to data.
Definition: cs_PacketsInternal.h:40
cs_const_data_t()
< Length of data.
Definition: cs_PacketsInternal.h:42
cs_const_data_t(const uint8_t *buf, cs_buffer_size_t size)
Definition: cs_PacketsInternal.h:43
const uint8_t * data
Definition: cs_PacketsInternal.h:39
Packets (structs) that are used internally in the firmware, and can be changed freely.
Definition: cs_PacketsInternal.h:27
cs_data_t()
< Length of data.
Definition: cs_PacketsInternal.h:31
cs_data_t(buffer_ptr_t buf, cs_buffer_size_t size)
Definition: cs_PacketsInternal.h:32
cs_buffer_size_t len
< Pointer to data.
Definition: cs_PacketsInternal.h:29
buffer_ptr_t data
Definition: cs_PacketsInternal.h:28
Definition: cs_PacketsInternal.h:414
uint8_t polarity
Definition: cs_PacketsInternal.h:418
uint8_t direction
Definition: cs_PacketsInternal.h:416
uintptr_t callback
Definition: cs_PacketsInternal.h:419
uint8_t pull
Definition: cs_PacketsInternal.h:417
uint8_t pinIndex
Definition: cs_PacketsInternal.h:415
Definition: cs_PacketsInternal.h:428
uint8_t length
Definition: cs_PacketsInternal.h:430
uint8_t pinIndex
Definition: cs_PacketsInternal.h:429
uint8_t * buf
Definition: cs_PacketsInternal.h:431
Definition: cs_PacketsInternal.h:434
uint8_t * buf
Definition: cs_PacketsInternal.h:437
uint8_t length
Definition: cs_PacketsInternal.h:436
uint8_t pinIndex
Definition: cs_PacketsInternal.h:435
Definition: cs_PacketsInternal.h:422
uint8_t * buf
Definition: cs_PacketsInternal.h:425
uint8_t pinIndex
Definition: cs_PacketsInternal.h:423
uint8_t length
Definition: cs_PacketsInternal.h:424
Struct to communicate a mesh message.
Definition: cs_PacketsInternal.h:194
size16_t size
Definition: cs_PacketsInternal.h:201
cs_mesh_msg_urgency urgency
Definition: cs_PacketsInternal.h:198
mesh_control_command_packet_flags_t flags
Definition: cs_PacketsInternal.h:196
cs_mesh_model_msg_type_t type
Definition: cs_PacketsInternal.h:195
uint8_t reliability
Definition: cs_PacketsInternal.h:197
uint8_t idCount
Definition: cs_PacketsInternal.h:199
uint8_t * payload
Definition: cs_PacketsInternal.h:202
stone_id_t * targetIds
Definition: cs_PacketsInternal.h:200
Definition: cs_PacketsInternal.h:46
cs_result_t(cs_data_t buf)
Definition: cs_PacketsInternal.h:67
cs_result_t(cs_ret_code_t returnCode)
Definition: cs_PacketsInternal.h:68
cs_result_t()
Definition: cs_PacketsInternal.h:66
cs_ret_code_t returnCode
Return code.
Definition: cs_PacketsInternal.h:52
cs_buffer_size_t dataSize
Length of the data in the buffer.
Definition: cs_PacketsInternal.h:64
cs_data_t buf
Buffer to put the result data in (can be nullptr).
Definition: cs_PacketsInternal.h:57
Definition: cs_PacketsInternal.h:394
uint8_t scl
Definition: cs_PacketsInternal.h:395
uint8_t sda
Definition: cs_PacketsInternal.h:396
uint8_t freq
Definition: cs_PacketsInternal.h:397
Definition: cs_PacketsInternal.h:407
bool stop
Definition: cs_PacketsInternal.h:411
uint8_t * buf
Definition: cs_PacketsInternal.h:410
uint8_t length
Definition: cs_PacketsInternal.h:409
uint8_t address
Definition: cs_PacketsInternal.h:408
Definition: cs_PacketsInternal.h:400
uint8_t length
Definition: cs_PacketsInternal.h:402
uint8_t * buf
Definition: cs_PacketsInternal.h:403
bool stop
Definition: cs_PacketsInternal.h:404
uint8_t address
Definition: cs_PacketsInternal.h:401
Definition: cs_PacketsInternal.h:97
A single multi switch command.
Definition: cs_PacketsInternal.h:124
uint8_t switchCmd
Definition: cs_PacketsInternal.h:125
A single multi switch packet, with target id.
Definition: cs_PacketsInternal.h:131
internal_multi_switch_item_cmd_t cmd
Definition: cs_PacketsInternal.h:133
stone_id_t id
Definition: cs_PacketsInternal.h:132
Definition: cs_PacketsInternal.h:271
register_tracked_device_packet_t data
Definition: cs_PacketsInternal.h:272
Definition: cs_PacketsInternal.h:278
tracked_device_heartbeat_packet_t data
Definition: cs_PacketsInternal.h:279
Mesh control command header packet.
Definition: cs_Packets.h:180
Mesh control command packet.
Definition: cs_PacketsInternal.h:151
control_command_packet_t controlCommand
Definition: cs_PacketsInternal.h:154
stone_id_t * targetIds
Definition: cs_PacketsInternal.h:153
mesh_control_command_packet_header_t header
Definition: cs_PacketsInternal.h:152
Definition: cs_PacketsInternal.h:389
uint8_t macAddress[MAC_ADDRESS_LEN]
Definition: cs_PacketsInternal.h:391
uint8_t stoneId
Definition: cs_PacketsInternal.h:390
Definition: cs_PacketsInternal.h:372
uint8_t version
Definition: cs_PacketsInternal.h:374
cs_data_t data
Definition: cs_PacketsInternal.h:376
uint16_t appUuid
Definition: cs_PacketsInternal.h:375
uint8_t type
Definition: cs_PacketsInternal.h:373
Definition: cs_PacketsInternal.h:384
cs_data_t payload
Definition: cs_PacketsInternal.h:386
microapp_ctrl_header_t header
Definition: cs_PacketsInternal.h:385
Definition: cs_PacketsInternal.h:379
microapp_upload_t header
Definition: cs_PacketsInternal.h:380
cs_data_t data
Definition: cs_PacketsInternal.h:381
Definition: cs_MicroappPackets.h:74
Definition: cs_PacketsInternal.h:264
uint8_t profileId
Definition: cs_PacketsInternal.h:265
bool fromMesh
Definition: cs_PacketsInternal.h:267
uint8_t locationId
Definition: cs_PacketsInternal.h:266
bool simulated
Definition: cs_PacketsInternal.h:268
Definition: cs_Packets.h:351
Scanned device.
Definition: cs_PacketsInternal.h:107
uint8_t setId
Definition: cs_PacketsInternal.h:113
uint8_t addressType
Definition: cs_PacketsInternal.h:111
int8_t rssi
Definition: cs_PacketsInternal.h:108
uint8_t dataSize
Definition: cs_PacketsInternal.h:115
bool resolvedPrivateAddress
Definition: cs_PacketsInternal.h:110
uint8_t channel
Definition: cs_PacketsInternal.h:112
uint8_t advType
Definition: cs_PacketsInternal.h:114
uint8_t * data
Definition: cs_PacketsInternal.h:116
This data is encrypted.
Definition: cs_ServiceDataPackets.h:169
Struct to communicate received state of other stones.
Definition: cs_PacketsInternal.h:210
service_data_encrypted_t data
Definition: cs_PacketsInternal.h:211
Definition: cs_Packets.h:371
Flags to determine how to send the mesh message.
Definition: cs_Packets.h:167