This only documents the latest protocol, older versions can be found in the git history.
Type
Name
Length
Description
uint8_t
Message type
1
A type of mesh message (see table below)
uint8_t
Payload
7
Payload for the mesh message
This is in total 8 bytes (an unsegmented message). There's currently no versioning in use except for bumping the identifier of a message.
Type
Name
Length
Description
uint32_t
Counter
4
uint8_t[3]
Dummy
3
When a Crownstone receives this message over the mesh, it will synchronize the whole mesh
to the given value. Behaviour is identical to the set time command
Type
Name
Length
Description
uint32_t
Timestamp
4
posix time stamp
cs_mesh_model_msg_profile_location_t
Type
Name
Length
Description
uint8_t
Profile
1
uint8_t
Location
1
cs_mesh_model_msg_state_0_t
Type
Name
Length
Description
uint8_t
Switch state
1
uint8_t
Flags
1
int8_t
Power factor
1
int16_t
Power usage real
2
uint16_t
Partial timestamp
2
cs_mesh_model_msg_state_1_t
Type
Name
Length
Description
int8
Temperature
1
int32
Energy used
4
uint16
Partial timestamp
2
cs_mesh_model_msg_multi_switch_item_t
Type
Name
Length
Description
uint8_t
Stone ID
1
uint8_t
Switch value
1
uint16_t
Delay
2
cmd_source_with_counter_t
Source
3
cs_mesh_model_msg_device_register_t
Type
Name
Length
Description
device_id_t
Device ID
2
uint8_t
Location ID
1
uint8_t
Profile ID
1
int8_t
RSSI offset
1
uint8_t
Flags
1
uint8_t
Access level
1
cs_mesh_model_msg_device_token_t
Type
Name
Length
Description
device_id_t
Device ID
2
uint8_t[3]
Device token
3
uint16_t
TTL minutes
2
cs_mesh_model_msg_device_heartbeat_t
Type
Name
Length
Description
device_id_t
Device ID
2
uint8_t
Location ID
1
uint8_t
TTL minutes
1
cs_mesh_model_msg_device_list_size_t
Type
Name
Length
Description
uint8_t
List size
1
Size of tracked devices list.
cs_mesh_model_msg_sync_request_t
Type
Name
Length
Description
uint8_t
Stone ID
1
ID of stone that requests for a sync.
uint32_t
requestBitmask
4
Bitmask of all things that are requested to be synced.
Bit
Name
Description
0
Time
1
Registered devices
2
Behaviour settings
3-31
Reserved
Reserved for future use, must be 0 for now.
cs_mesh_model_msg_state_set
Type
Name
Length
Description
state header
State header
3
uint8_t[]
Payload
N
Payload data, depends on state type.
cs_mesh_model_msg_state_header_ext_t
Type
Name
Length in bits
Description
cs_mesh_model_msg_state_header_t
Header
16
State header.
uint8_t
Access level
3
Shortened version of access level: 0=ADMIN, 1=MEMBER, 2=BASIC, 6=SETUP, 7=NOT_SET.
uint8_t
Source ID
5
Shortened version of source ID: 0=NONE, 2=INTERNAL, 3=UART, 4=CONNECTION, 5=SWITCHCRAFT, 30=BROADCAST
cs_mesh_model_msg_state_header_t
Type
Name
Length in bits
Description
uint8_t
Type
8
State type .
uint8_t
State ID
6
ID of state to get. Most state types will only have ID 0.
uint8_t
Persistence mode
2
Type of persistence mode.
cs_mesh_model_msg_ctrl_cmd_t
Type
Name
Length
Description
header
Header
3
uint8_t[]
Payload
N
Payload data, depends on command type.
cs_mesh_model_msg_ctrl_cmd_header_ext_t
Type
Name
Length in bits
Description
header
Header
16
uint8_t
Access level
3
Shortened version of access level: 0=ADMIN, 1=MEMBER, 2=BASIC, 6=SETUP, 7=NOT_SET.
uint8_t
Source ID
5
Shortened version of source ID: 0=NONE, 2=INTERNAL, 3=UART, 4=CONNECTION, 5=SWITCHCRAFT, 30=BROADCAST
cs_mesh_model_msg_ctrl_cmd_header_t
Type
Name
Length
Description
uint16_t
Command type
2
Command type .
high_resolution_time_stamp_t
Type
Name
Length
Description
uint32_t
posix_s
4
seconds since epoch
uint16_t
posix_ms, version
2
bits 0-9: milliseconds passed since posix_s. bits 10-15: synchronisation version
cs_mesh_model_msg_time_sync_message_t
Type
Name
Length
Description
high_resolution_time_stamp_t
stamp
6
current stamp of root clock
uint8_t
root_id
1
id of root clock (may differ from sender id)
cs_mesh_model_msg_stone_mac_t
Type
Name
Length
Description
uint8_t
Type
1
Type: 0 = request, 1 = reply.
uint8_t[]
MAC address
6
Mac address of the replier, ignored for request.
cs_mesh_model_msg_asset_filter_version_t
Type
Name
Length
Description
uint8[]
MAC
6
The MAC address of the asset.
rssi
Rssi
1
Signal strength of the asset advertisement.
Type
Name
Length in bits
Description
uint8
Channel
2
The BLE channel: 0 = unknown, 1 = 37, 2 = 38, 3 = 39.
uint8
RSSI halved
6
RSSI / -2, or 0 if RSSI is positive.
Type
Name
Length
Description
Asset ID
Asset ID
3
The asset ID.
uint8
Filter bitmask
1
Bitmask of filters that the asset advertisement passed and lead to this asset ID. Nth bit set, means the asset passed filter ID = N, and lead to this asset ID.
int8
RSSI
1
Signal strength of the asset advertisement.
channel
Channel
1
uint8
Reserved
1
Reserved for future use, 0 for now.
Type
Name
Length in bits
Description
uint8
Channel
2
The BLE channel: 0 = unknown, 1 = 37, 2 = 38, 3 = 39.
uint8
Reserved
6
Reserved for future use, 0 for now.
cs_mesh_model_msg_neighbour_rssi_t
Type
Name
Length
Description
uint8_t
Type
1
Always 0 for now.
uint8_t
Neighbour ID
1
ID of the observed neighbour.
int8_t
RSSI channel 37
1
RSSI on channel 37.
int8_t
RSSI channel 38
1
RSSI on channel 38.
int8_t
RSSI channel 39
1
RSSI on channel 39.
uint8_t
Last seen
1
How many seconds ago the neighbour was last seen.
uint8_t
Message number
1
Message number that increases by 1 each time this message is sent. Used to identify package loss.
Type
Name
Length
Description
result header
Result header
2
Header.
uint8_t[]
Payload
N
Payload data, depends on result type.
cs_mesh_model_msg_result_header_t
Type
Name
Length
Description
uint8_t
Type
1
The type of mesh msg this is the result of.
uint8_t
Result code
1
Shortened version of result code.