Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_ServiceDataPackets.h File Reference
#include <protocol/cs_Typedefs.h>
#include <cstdint>
Include dependency graph for cs_ServiceDataPackets.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  service_data_hub_state_flags_t
 
struct  service_data_hub_state_t
 
union  service_data_state_flags_t
 
union  service_data_state_extra_flags_t
 
struct  service_data_encrypted_state_t
 State of this crownstone. More...
 
struct  service_data_encrypted_error_t
 In case the crownstone has errors, this will be advertised next to the state. More...
 
struct  service_data_encrypted_ext_state_t
 State of another crownstone. More...
 
struct  service_data_encrypted_ext_error_t
 Errors of another crownstone. More...
 
struct  service_data_encrypted_alternative_state_t
 State of this crownstone. More...
 
union  service_data_microapp_flags_t
 
struct  service_data_encrypted_microapp_t
 Microapp data that will be encrypted. More...
 
struct  service_data_encrypted_t
 This data is encrypted. More...
 
struct  service_data_setup_state_t
 
struct  service_data_setup_t
 Setup data. More...
 
union  service_data_t
 Service data. More...
 

Macros

#define SERVICE_DATA_VALIDATION   0xFA
 Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: May 22, 2019 License: LGPLv3+, Apache License 2.0, and/or MIT (triple-licensed) More...
 
#define SERVICE_DATA_HUB_DATA_SIZE   9
 

Enumerations

enum  ServiceDataDataType {
  SERVICE_DATA_DATA_TYPE_STATE = 0 , SERVICE_DATA_DATA_TYPE_ERROR = 1 , SERVICE_DATA_DATA_TYPE_EXT_STATE = 2 , SERVICE_DATA_DATA_TYPE_EXT_ERROR = 3 ,
  SERVICE_DATA_DATA_TYPE_ALTERNATIVE_STATE = 4 , SERVICE_DATA_DATA_TYPE_HUB_STATE = 5 , SERVICE_DATA_DATA_TYPE_MICROAPP = 6
}
 
enum  ServiceDataType { SERVICE_DATA_TYPE_SETUP = 6 , SERVICE_DATA_TYPE_ENCRYPTED = 7 }
 

Functions

constexpr stone_id_t getStoneId (service_data_encrypted_t *data)
 Function to get the stone ID from the encrypted service data. More...
 
constexpr void convertToExternalState (service_data_encrypted_t *data, int8_t rssi)
 Function to convert from service_data_encrypted_state_t to service_data_encrypted_ext_state_t. More...
 
constexpr void convertToExternalError (service_data_encrypted_t *data, int8_t rssi)
 Function to convert from service_data_encrypted_error_t to service_data_encrypted_ext_error_t. More...
 

Macro Definition Documentation

◆ SERVICE_DATA_HUB_DATA_SIZE

#define SERVICE_DATA_HUB_DATA_SIZE   9

◆ SERVICE_DATA_VALIDATION

#define SERVICE_DATA_VALIDATION   0xFA

Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: May 22, 2019 License: LGPLv3+, Apache License 2.0, and/or MIT (triple-licensed)

Enumeration Type Documentation

◆ ServiceDataDataType

Enumerator
SERVICE_DATA_DATA_TYPE_STATE 
SERVICE_DATA_DATA_TYPE_ERROR 
SERVICE_DATA_DATA_TYPE_EXT_STATE 
SERVICE_DATA_DATA_TYPE_EXT_ERROR 
SERVICE_DATA_DATA_TYPE_ALTERNATIVE_STATE 
SERVICE_DATA_DATA_TYPE_HUB_STATE 
SERVICE_DATA_DATA_TYPE_MICROAPP 

◆ ServiceDataType

Enumerator
SERVICE_DATA_TYPE_SETUP 
SERVICE_DATA_TYPE_ENCRYPTED 

Function Documentation

◆ convertToExternalError()

constexpr void convertToExternalError ( service_data_encrypted_t data,
int8_t  rssi 
)
constexpr

Function to convert from service_data_encrypted_error_t to service_data_encrypted_ext_error_t.

Since most fields are at similar places, we don't have to copy much.

Parameters
[in,out]dataService data that will be converted.
[in]rssiRSSI to the stone, or 0 if unknown / out of reach.

◆ convertToExternalState()

constexpr void convertToExternalState ( service_data_encrypted_t data,
int8_t  rssi 
)
constexpr

Function to convert from service_data_encrypted_state_t to service_data_encrypted_ext_state_t.

Since most fields are at similar places, we don't have to copy much.

Parameters
[in,out]dataService data that will be converted.
[in]rssiRSSI to the stone, or 0 if unknown / out of reach.

◆ getStoneId()

constexpr stone_id_t getStoneId ( service_data_encrypted_t data)
constexpr

Function to get the stone ID from the encrypted service data.