Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_Packets.h File Reference
Include dependency graph for cs_Packets.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  encryption_nonce_t
 Nonce used for encryption. More...
 
struct  encryption_header_t
 Encryption header that's not encrypted. More...
 
struct  encryption_header_encrypted_t
 Encryption header that's encrypted. More...
 
struct  session_data_t
 
struct  control_packet_header_t
 Header of a control packet. More...
 
struct  control_packet_t< N >
 Control packet. More...
 
struct  result_packet_header_t
 Header of a result packet. More...
 
struct  result_packet_t< N >
 Result packet. More...
 
struct  setup_data_t
 
struct  state_packet_header_t
 State get/set header packet. More...
 
union  mesh_control_command_packet_flags_t
 Flags to determine how to send the mesh message. More...
 
struct  mesh_control_command_packet_header_t
 Mesh control command header packet. More...
 
union  state_errors_t
 State errors: collection of errors that influence the switch behaviour. More...
 
union  behaviour_settings_t
 Behaviour settings. More...
 
union  switch_state_t
 Switch state: combination of relay and dimmer state. More...
 
struct  multi_switch_item_t
 A single multi switch item. More...
 
struct  multi_switch_t
 Multi switch packet. More...
 
struct  cs_legacy_multi_switch_item_t
 
struct  cs_legacy_multi_switch_t
 
struct  switch_message_payload_t
 
struct  opcode_message_payload_t
 
struct  enable_message_payload_t
 
struct  enable_scanner_message_payload_t
 
struct  factory_reset_message_payload_t
 
struct  sun_time_t
 
struct  ibeacon_config_id_packet_t
 Packet to change ibeacon config ID. More...
 
struct  set_ibeacon_config_id_packet_t
 
struct  led_message_payload_t
 
struct  hub_data_header_t
 
struct  behaviour_debug_t
 
struct  register_tracked_device_packet_t
 
struct  tracked_device_heartbeat_packet_t
 
struct  mesh_state_part_0_t
 
struct  mesh_state_part_1_t
 
struct  cs_mesh_iv_index_t
 Same as mesh_opt_iv_index_persist_data_legacy_t. More...
 
struct  cs_mesh_iv_index_v5_t
 Same as mesh_opt_iv_index_persist_data_t. More...
 
struct  cs_mesh_seq_number_v5_t
 Same as mesh_opt_seqnum_persist_data_t. More...
 
struct  cs_adc_restarts_t
 
struct  cs_adc_channel_swaps_t
 
struct  cs_power_samples_header_t
 
struct  cs_power_samples_request_t
 
struct  cs_switch_history_header_t
 
struct  cs_switch_history_item_t
 
struct  cs_gpregret_result_t
 
struct  cs_ram_stats_t
 
struct  cs_bootloader_info_t
 
struct  asset_report_uart_mac_t
 A packet that represents RSSI data about an asset received by a particular Crownstone. More...
 
struct  asset_report_uart_id_t
 

Macros

#define LEGACY_MULTI_SWITCH_HEADER_SIZE   (1 + 1)
 
#define LEGACY_MULTI_SWITCH_MAX_ITEM_COUNT   18
 
#define VALIDATION_KEY_LENGTH   4
 
#define SESSION_NONCE_LENGTH   5
 
#define PACKET_NONCE_LENGTH   3
 
#define MAX_NUMBER_OF_PRESENCE_PROFILES   8
 

Typedefs

typedef register_tracked_device_packet_t update_tracked_device_packet_t
 
typedef uint32_t cs_mesh_seq_number_t
 

Enumerations

enum  EncryptionAccessLevel {
  ADMIN = 0 , MEMBER = 1 , BASIC = 2 , SETUP = 100 ,
  SERVICE_DATA = 101 , LOCALIZATION = 102 , NOT_SET = 201 , ENCRYPTION_DISABLED = 254 ,
  NO_ONE = 255
}
 Packets (structs) that are used over the air, over uart, or stored in flash. More...
 
enum  BackgroundAdvFlagBitPos { BG_ADV_FLAG_RESERVED = 0 , BG_ADV_FLAG_IGNORE_FOR_PRESENCE = 1 , BG_ADV_FLAG_TAP_TO_TOGGLE_ENABLED = 2 }
 
enum class  PersistenceModeGet { CURRENT = 0 , STORED = 1 , FIRMWARE_DEFAULT = 2 , UNKNOWN = 255 }
 
enum class  PersistenceModeSet { TEMPORARY = 0 , STORED = 1 , UNKNOWN = 255 }
 
enum class  PresenceChange : uint8_t {
  FIRST_SPHERE_ENTER = 0 , LAST_SPHERE_EXIT = 1 , PROFILE_SPHERE_ENTER = 2 , PROFILE_SPHERE_EXIT = 3 ,
  PROFILE_LOCATION_ENTER = 4 , PROFILE_LOCATION_EXIT = 5
}
 
enum  cs_mesh_iv_update_v5_t { CS_MESH_NET_STATE_IV_UPDATE_NORMAL , CS_MESH_NET_STATE_IV_UPDATE_IN_PROGRESS }
 Same as net_state_iv_update_t. More...
 
enum  PowerSamplesType {
  POWER_SAMPLES_TYPE_SWITCHCRAFT = 0 , POWER_SAMPLES_TYPE_SWITCHCRAFT_NON_TRIGGERED = 1 , POWER_SAMPLES_TYPE_NOW_FILTERED = 2 , POWER_SAMPLES_TYPE_NOW_UNFILTERED = 3 ,
  POWER_SAMPLES_TYPE_SOFTFUSE = 4 , POWER_SAMPLES_TYPE_SWITCH = 5
}
 

Functions

struct __attribute ((packed)) presence_change_t
 
bool cs_multi_switch_item_is_valid (multi_switch_item_t *item, size16_t size)
 Returns true when a multi switch item is valid. More...
 
bool cs_multi_switch_packet_is_valid (multi_switch_t *packet, size16_t size)
 Returns true when a multi switch packet is valid. More...
 
bool cs_legacy_multi_switch_item_is_valid (cs_legacy_multi_switch_item_t *item, size16_t size)
 
bool cs_legacy_multi_switch_is_valid (const cs_legacy_multi_switch_t *packet, size16_t size)
 

Variables

constexpr uint8_t CS_SWITCH_CMD_VAL_OFF = 0
 Switch command values. More...
 
constexpr uint8_t CS_SWITCH_CMD_VAL_FULLY_ON = 100
 
constexpr uint8_t CS_SWITCH_CMD_VAL_NONE = 128
 
constexpr uint8_t CS_SWITCH_CMD_VAL_DEBUG_RESET_ALL = 129
 
constexpr uint8_t CS_SWITCH_CMD_VAL_DEBUG_RESET_AGG = 130
 
constexpr uint8_t CS_SWITCH_CMD_VAL_DEBUG_RESET_OVERRIDE = 131
 
constexpr uint8_t CS_SWITCH_CMD_VAL_DEBUG_RESET_AGG_OVERRIDE = 132
 
constexpr uint8_t CS_SWITCH_CMD_VAL_TOGGLE = 253
 Switch OFF when currently on, switch to SMART_ON when currently off. More...
 
constexpr uint8_t CS_SWITCH_CMD_VAL_BEHAVIOUR = 254
 Switch to the value according to behaviour rules. More...
 
constexpr uint8_t CS_SWITCH_CMD_VAL_SMART_ON = 255
 Switch on, the value will be determined by behaviour rules. More...
 
const uint8_t CS_CHARACTERISTIC_NOTIFICATION_PART_LAST = 255
 

Macro Definition Documentation

◆ LEGACY_MULTI_SWITCH_HEADER_SIZE

#define LEGACY_MULTI_SWITCH_HEADER_SIZE   (1 + 1)

◆ LEGACY_MULTI_SWITCH_MAX_ITEM_COUNT

#define LEGACY_MULTI_SWITCH_MAX_ITEM_COUNT   18

◆ MAX_NUMBER_OF_PRESENCE_PROFILES

#define MAX_NUMBER_OF_PRESENCE_PROFILES   8

◆ PACKET_NONCE_LENGTH

#define PACKET_NONCE_LENGTH   3

◆ SESSION_NONCE_LENGTH

#define SESSION_NONCE_LENGTH   5

◆ VALIDATION_KEY_LENGTH

#define VALIDATION_KEY_LENGTH   4

Typedef Documentation

◆ cs_mesh_seq_number_t

typedef uint32_t cs_mesh_seq_number_t

◆ update_tracked_device_packet_t

Enumeration Type Documentation

◆ BackgroundAdvFlagBitPos

Enumerator
BG_ADV_FLAG_RESERVED 
BG_ADV_FLAG_IGNORE_FOR_PRESENCE 
BG_ADV_FLAG_TAP_TO_TOGGLE_ENABLED 

◆ cs_mesh_iv_update_v5_t

Same as net_state_iv_update_t.

Enumerator
CS_MESH_NET_STATE_IV_UPDATE_NORMAL 
CS_MESH_NET_STATE_IV_UPDATE_IN_PROGRESS 

◆ EncryptionAccessLevel

Packets (structs) that are used over the air, over uart, or stored in flash.

Constructors can be added, as they do not impact the size of the struct.

If the definition becomes large, move it to its own file and include it in this file.

Enumerator
ADMIN 
MEMBER 
BASIC 
SETUP 
SERVICE_DATA 
LOCALIZATION 
NOT_SET 
ENCRYPTION_DISABLED 
NO_ONE 

◆ PersistenceModeGet

enum class PersistenceModeGet
strong
Enumerator
CURRENT 
STORED 
FIRMWARE_DEFAULT 
UNKNOWN 

◆ PersistenceModeSet

enum class PersistenceModeSet
strong
Enumerator
TEMPORARY 
STORED 
UNKNOWN 

◆ PowerSamplesType

Enumerator
POWER_SAMPLES_TYPE_SWITCHCRAFT 
POWER_SAMPLES_TYPE_SWITCHCRAFT_NON_TRIGGERED 
POWER_SAMPLES_TYPE_NOW_FILTERED 
POWER_SAMPLES_TYPE_NOW_UNFILTERED 
POWER_SAMPLES_TYPE_SOFTFUSE 
POWER_SAMPLES_TYPE_SWITCH 

◆ PresenceChange

enum class PresenceChange : uint8_t
strong
Enumerator
FIRST_SPHERE_ENTER 
LAST_SPHERE_EXIT 
PROFILE_SPHERE_ENTER 
PROFILE_SPHERE_EXIT 
PROFILE_LOCATION_ENTER 
PROFILE_LOCATION_EXIT 

Function Documentation

◆ __attribute()

struct __attribute ( (packed)  )

◆ cs_legacy_multi_switch_is_valid()

bool cs_legacy_multi_switch_is_valid ( const cs_legacy_multi_switch_t packet,
size16_t  size 
)
inline

◆ cs_legacy_multi_switch_item_is_valid()

bool cs_legacy_multi_switch_item_is_valid ( cs_legacy_multi_switch_item_t item,
size16_t  size 
)
inline

◆ cs_multi_switch_item_is_valid()

bool cs_multi_switch_item_is_valid ( multi_switch_item_t item,
size16_t  size 
)
inline

Returns true when a multi switch item is valid.

◆ cs_multi_switch_packet_is_valid()

bool cs_multi_switch_packet_is_valid ( multi_switch_t packet,
size16_t  size 
)
inline

Returns true when a multi switch packet is valid.

Variable Documentation

◆ CS_CHARACTERISTIC_NOTIFICATION_PART_LAST

const uint8_t CS_CHARACTERISTIC_NOTIFICATION_PART_LAST = 255

◆ CS_SWITCH_CMD_VAL_BEHAVIOUR

constexpr uint8_t CS_SWITCH_CMD_VAL_BEHAVIOUR = 254
constexpr

Switch to the value according to behaviour rules.

◆ CS_SWITCH_CMD_VAL_DEBUG_RESET_AGG

constexpr uint8_t CS_SWITCH_CMD_VAL_DEBUG_RESET_AGG = 130
constexpr

◆ CS_SWITCH_CMD_VAL_DEBUG_RESET_AGG_OVERRIDE

constexpr uint8_t CS_SWITCH_CMD_VAL_DEBUG_RESET_AGG_OVERRIDE = 132
constexpr

◆ CS_SWITCH_CMD_VAL_DEBUG_RESET_ALL

constexpr uint8_t CS_SWITCH_CMD_VAL_DEBUG_RESET_ALL = 129
constexpr

◆ CS_SWITCH_CMD_VAL_DEBUG_RESET_OVERRIDE

constexpr uint8_t CS_SWITCH_CMD_VAL_DEBUG_RESET_OVERRIDE = 131
constexpr

◆ CS_SWITCH_CMD_VAL_FULLY_ON

constexpr uint8_t CS_SWITCH_CMD_VAL_FULLY_ON = 100
constexpr

◆ CS_SWITCH_CMD_VAL_NONE

constexpr uint8_t CS_SWITCH_CMD_VAL_NONE = 128
constexpr

◆ CS_SWITCH_CMD_VAL_OFF

constexpr uint8_t CS_SWITCH_CMD_VAL_OFF = 0
constexpr

Switch command values.

◆ CS_SWITCH_CMD_VAL_SMART_ON

constexpr uint8_t CS_SWITCH_CMD_VAL_SMART_ON = 255
constexpr

Switch on, the value will be determined by behaviour rules.

◆ CS_SWITCH_CMD_VAL_TOGGLE

constexpr uint8_t CS_SWITCH_CMD_VAL_TOGGLE = 253
constexpr

Switch OFF when currently on, switch to SMART_ON when currently off.