nRF5 SDK for Mesh v5.0.0
Serial commands

Serial commands are messages sent from the host controller to the nRF5. Most serial commands result in a CMD RSP event, indicating whether the command was successful and returning any relevant data depending on the command type.

Serial command groups

The serial commands are broken into the following groups:

See the tables in the following subsections for lists of serial commands available for each command group in the nRF5 mesh serial interface, along with their opcodes. Each entry links to the respective details section, where the parameters and effects of each command are described.


Device commands

Command Opcode
Echo 0x02
Internal Events Report 0x03
Serial Version Get 0x09
FW Info Get 0x0a
Radio Reset 0x0e
Beacon Start 0x10
Beacon Stop 0x11
Beacon Params Get 0x13
Beacon Params Set 0x12
Housekeeping Data Get 0x14
Housekeeping Data Clear 0x15

Application commands

Command Opcode
Application 0x20

Segmentation and Reassembly commands

Command Opcode
Start 0x21
Continue 0x22

Configuration commands

Command Opcode
Adv Addr Set 0x40
Adv Addr Get 0x41
Channel Map Set 0x42
Channel Map Get 0x43
TX Power Set 0x44
TX Power Get 0x45
UUID Set 0x53
UUID Get 0x54

Provisioning commands

Command Opcode
Scan Start 0x61
Scan Stop 0x62
Provision 0x63
Listen 0x64
OOB Use 0x66
Auth Data 0x67
ECDH Secret 0x68
Keypair Set 0x69
Capabilities Set 0x6a

nRF Open Mesh commands

Command Opcode
Init 0x70
Value Set 0x71
Value Enable 0x72
Value Disable 0x73
Start 0x74
Stop 0x75
Flag Set 0x76
Flag Get 0x77
DFU Data 0x78
Value Get 0x7a
Build Version Get 0x7b
Access Addr Get 0x7c
Channel Get 0x7d
Interval Min ms Get 0x7f

Bluetooth Mesh commands

Command Opcode
Enable 0x90
Disable 0x91
Subnet Add 0x92
Subnet Update 0x93
Subnet Delete 0x94
Subnet Get All 0x95
Subnet Count Max Get 0x96
Appkey Add 0x97
Appkey Update 0x98
Appkey Delete 0x99
Appkey Get All 0x9a
Appkey Count Max Get 0x9b
Devkey Add 0x9c
Devkey Delete 0x9d
Devkey Count Max Get 0x9e
Addr Local Unicast Set 0x9f
Addr Local Unicast Get 0xa0
Addr Get 0xa7
Addr Get All 0xa8
Addr Nonvirtual Count Max Get0xa9
Addr Virtual Count Max Get0xaa
Addr Subscription Add 0xa1
Addr Subscription Add Virtual0xa2
Addr Subscription Remove 0xa3
Addr Publication Add 0xa4
Addr Publication Add Virtual0xa5
Addr Publication Remove 0xa6
Packet Send 0xab
State Clear 0xac
Config Server Bind 0xad
Net State Set 0xae
Net State Get 0xaf

Direct Firmware Upgrade commands

Command Opcode
Jump To Bootloader0xd0
Request 0xd1
Relay 0xd2
Abort 0xd3
Bank Info Get 0xd4
Bank Flash 0xd5
State Get 0xd6

Access Layer commands

Command Opcode
Model Pub Addr Set 0xe0
Model Pub Addr Get 0xe1
Model Pub Period Set 0xe2
Model Pub Period Get 0xe3
Model Subs Add 0xe4
Model Subs Remove 0xe5
Model Subs Get 0xe6
Model App Bind 0xe7
Model App Unbind 0xe8
Model App Get 0xe9
Model Pub App Set 0xea
Model Pub App Get 0xeb
Model Pub TTL Set 0xec
Model Pub TTL Get 0xed
Elem Loc Set 0xee
Elem Loc Get 0xef
Elem Sig Model Count Get 0xf0
Elem Vendor Model Count Get0xf1
Model ID Get 0xf2
Handle Get 0xf3
Elem Models Get 0xf4

Model Specific commands

Command Opcode
Models Get 0xfc
Init 0xfd
Command 0xfe

Serial command details

This subsection contains detailed description of each serial command, including opcodes, total length, description, and parameters (if any are taken).

The commands are listed in order corresponding to groups. The group name precedes the name of the command in each case.


Device Echo

Opcode: 0x02

Total length: 1..255 bytes

A simple loopback test command. Used to verify that the serial transport layer is working as intended.

Echo Parameters:

Type Name Size Offset Description
uint8_t[254] Data 0..254 0 Data to echo back.

Response

Potential status codes:

Echo Response Parameters

Type Name Size Offset Description
uint8_t[254] Data 0..254 0 Data received in the echo command.

Device Internal Events Report

Opcode: 0x03

Total length: 1 byte

Start reporting internal events, if supported.

Internal Events Report takes no parameters.

Response

Potential status codes:

The response has no parameters.


Device Serial Version Get

Opcode: 0x09

Total length: 1 byte

Request the implemented version of the serial interface.

Serial Version Get takes no parameters.

Response

Potential status codes:

Serial Version Get Response Parameters

Type Name Size Offset Description
uint16_t Serial Ver 2 0 Serial interface version.

Device FW Info Get

Opcode: 0x0a

Total length: 1 byte

Request the firmware version info structure for the firmware.

FW Info Get takes no parameters.

Response

Potential status codes:

FW Info Get Response Parameters

Type Name Size Offset Description
nrf_mesh_fwid_t FWID 10 0 Firmware ID data.

Device Radio Reset

Opcode: 0x0e

Total length: 1 byte

Restart the device.

Radio Reset takes no parameters.

Response

This command does not yield any response.


Device Beacon Start

Opcode: 0x10

Total length: 2..33 bytes

Start an application controlled beacon with the given payload. Will hotswap the payload if the beacon is already running.

Beacon Start Parameters:

Type Name Size Offset Description
uint8_t Beacon Slot 1 0 Slot number of the beacon to set the payload for.
uint8_t[31] Data 0..31 1 Beacon payload.

Response

Potential status codes:

The response has no parameters.


Device Beacon Stop

Opcode: 0x11

Total length: 2 bytes

Stop transmitting the current beacon.

Beacon Stop Parameters:

Type Name Size Offset Description
uint8_t Beacon Slot 1 0 Slot number of the beacon to stop.

Response

Potential status codes:

The response has no parameters.


Device Beacon Params Get

Opcode: 0x13

Total length: 2 bytes

Set parameters for application controlled beacon.

Beacon Params Get Parameters:

Type Name Size Offset Description
uint8_t Beacon Slot 1 0 Slot number of the beacon to get the parameters of.

Response

Potential status codes:

Beacon Params Get Response Parameters

Type Name Size Offset Description
uint8_t Beacon Slot 1 0 Slot number of the beacon to start.
uint8_t TX Power 1 1 TX Power value, must be a value from serial_cmd_tx_power_value_t.
uint8_t Channel Map 1 2 Channel map bitfield for beacon, starting at channel 37.
uint32_t Interval ms 4 3 TX interval in milliseconds.

Device Beacon Params Set

Opcode: 0x12

Total length: 8 bytes

Set parameters for application controlled beacon.

Beacon Params Set Parameters:

Type Name Size Offset Description
uint8_t Beacon Slot 1 0 Slot number of the beacon to start.
uint8_t TX Power 1 1 TX Power value, must be a value from serial_cmd_tx_power_value_t.
uint8_t Channel Map 1 2 Channel map bitfield for beacon, starting at channel 37.
uint32_t Interval ms 4 3 TX interval in milliseconds.

Response

Potential status codes:

The response has no parameters.


Device Housekeeping Data Get

Opcode: 0x14

Total length: 1 byte

Get the current housekeeping data values.

Housekeeping Data Get takes no parameters.

Response

Potential status codes:

Housekeeping Data Get Response Parameters

Type Name Size Offset Description
uint32_t Alloc Fail Count 4 0 Number of failed serial packet allocations.

Device Housekeeping Data Clear

Opcode: 0x15

Total length: 1 byte

Clear the current housekeeping data values.

Housekeeping Data Clear takes no parameters.

Response

Potential status codes:

The response has no parameters.


Application Application

Opcode: 0x20

Total length: 1..255 bytes

Application-specific command. Has no functionality in the framework, but is forwarded to the application.

Application Parameters:

Type Name Size Offset Description
uint8_t[254] Data 0..254 0 Application data.

Response

Potential status codes:

The response has no parameters.


Segmentation and Reassembly Start

Opcode: 0x21

Total length: 1 byte

Opening message of a Segmentation and Reassembly message.

Start takes no parameters.

Response

Potential status codes:

The response has no parameters.


Segmentation and Reassembly Continue

Opcode: 0x22

Total length: 1 byte

Continuation of a Segmentation and Reassembly message.

Continue takes no parameters.

Response

Potential status codes:

The response has no parameters.


Configuration Adv Addr Set

Opcode: 0x40

Total length: 8 bytes

Set the device's BLE advertisement address used for all BLE advertisment messages sent by the device.

Adv Addr Set Parameters:

Type Name Size Offset Description
uint8_t Addr Type 1 0 BLE advertising address type.
uint8_t[6] Adv Addr 6 1 BLE advertising address.

Response

Potential status codes:

The response has no parameters.


Configuration Adv Addr Get

Opcode: 0x41

Total length: 1 byte

Get the device's BLE advertisement address.

Adv Addr Get takes no parameters.

Response

Potential status codes:

Adv Addr Get Response Parameters

Type Name Size Offset Description
uint8_t Addr Type 1 0 Advertisement address type.
uint8_t[6] Addr 6 1 Advertisement address.

Configuration Channel Map Set

Opcode: 0x42

Total length: 2 bytes

Set the channel map for advertisement packets. The device will send the advertisement packets on all enabled channels in increasing order. The channel map parameter is a bitmap, where the first bit represents channel 37, the second bit channel 38, and the third bit channel 39. The rest of the byte is ignored. Set to 0x07 to enable all channels, 0x01 to only enable channel 37, and so on.

Channel Map Set Parameters:

Type Name Size Offset Description
uint8_t Channel Map 1 0 Channel map bitfield for mesh to use, starting at channel 37.

Response

Potential status codes:

The response has no parameters.


Configuration Channel Map Get

Opcode: 0x43

Total length: 1 byte

Get the channel map used for advertisement packets.

Channel Map Get takes no parameters.

Response

Potential status codes:

The response has no parameters.


Configuration TX Power Set

Opcode: 0x44

Total length: 2 bytes

Set the transmission power of the radio. Must be a valid enumeration in serial_cmd_config_tx_power_value.

TX Power Set Parameters:

Type Name Size Offset Description
uint8_t TX Power 1 0 Transmit power of radio, see serial_cmd_tx_power_value_t for accepted values.

Response

Potential status codes:

The response has no parameters.


Configuration TX Power Get

Opcode: 0x45

Total length: 1 byte

Get the transmission power of the radio.

TX Power Get takes no parameters.

Response

Potential status codes:

TX Power Get Response Parameters

Type Name Size Offset Description
uint8_t TX Power 1 0 TX Power value, must be a value from serial_cmd_tx_power_value_t.

Configuration UUID Set

Opcode: 0x53

Total length: 17 bytes

Set the device UUID used for identifying the device during provisioning. If the UUID isn't set, the device will use a preprogrammed UUID.

UUID Set Parameters:

Type Name Size Offset Description
uint8_t[16] UUID 16 0 Device UUID.

Response

Potential status codes:

The response has no parameters.


Configuration UUID Get

Opcode: 0x54

Total length: 1 byte

Get the device UUID used for identifying the device during provisioning.

UUID Get takes no parameters.

Response

Potential status codes:

UUID Get Response Parameters

Type Name Size Offset Description
uint8_t[16] Device UUID 16 0 Device UUID.

Provisioning Scan Start

Opcode: 0x61

Total length: 1 byte

Start reporting of incoming unprovisioned beacons.

Scan Start takes no parameters.

Response

Potential status codes:

The response has no parameters.


Provisioning Scan Stop

Opcode: 0x62

Total length: 1 byte

Stop reporting of incoming unprovisioned beacons.

Scan Stop takes no parameters.

Response

Potential status codes:

The response has no parameters.


Provisioning Provision

Opcode: 0x63

Total length: 45 bytes

Start provisioning of a device. When a provisioning link has been successfully established, a Provisioning Link Established event is received. If an error occurs, a Provisioning Link Closed event is received. After a link has been established, a Provisioning Capabilities Received event will be emitted upon receiving the peer node's OOB capabilities. To continue the provisioning process, a Provisioning OOB Use command must be sent to select which kind of OOB authentication to use.

Provision Parameters:

Type Name Size Offset Description
uint8_t Context ID 1 0 Context ID to use for this provisioning session.
uint8_t[16] Target UUID 16 1 UUID of the device to provision.
uint8_t[16] Network Key 16 17 Network key to give to the device.
uint16_t Network Key Index 2 33 Network key index.
uint32_t Iv Index 4 35 Initial IV index of the network.
uint16_t Address 2 39 Unicast address to assign to the device.
uint8_t Iv Update Flag 1 41 IV update in progress flag.
uint8_t Key Refresh Flag 1 42 Key refresh in progress flag.
uint8_t Attention Duration S 1 43 Time in seconds during which the device will identify itself using any means it can.

Response

Potential status codes:

Provision Response Parameters

Type Name Size Offset Description
uint8_t Context 1 0 Provisioning context ID

Provisioning Listen

Opcode: 0x64

Total length: 1 byte

As an uprovisioned device, listen for incoming provisioning requests.

Listen takes no parameters.

Response

Potential status codes:

The response has no parameters.


Provisioning OOB Use

Opcode: 0x66

Total length: 5 bytes

Used to respond to the Provisioning Capabilities Received event. It is used to select which kind of OOB authentication method to use. The values can be found in nrf_mesh_prov.h.

If authentication is enabled, the application will receive a Provisioning Auth Request event requesting authentication data. A Provisioning ECDH Request will be received when the provisioner needs to calculate the ECDH shared secret for the nodes. The Provisioning Complete event is received when the provisioning procedure has completed successfully. At this point, a provisioner must wait for the Provisioning Link Closed event before re-using the provisioning context.

OOB Use Parameters:

Type Name Size Offset Description
uint8_t Context ID 1 0 ID of context to set the oob method for.
uint8_t OOB Method 1 1 OOB method to use, see nrf_mesh_prov_oob_method_t for accepted values.
uint8_t OOB Action 1 2 OOB action to use, see nrf_mesh_prov_input_action_t or nrf_mesh_prov_output_action_t for values.
uint8_t Size 1 3 Size of the OOB data.

Response

Potential status codes:

OOB Use Response Parameters

Type Name Size Offset Description
uint8_t Context 1 0 Provisioning context ID

Provisioning Auth Data

Opcode: 0x67

Total length: 2..18 bytes

Used to respond to a Provisioning Auth Request event. It passes OOB authentication data back to the mesh stack.

Auth Data Parameters:

Type Name Size Offset Description
uint8_t Context ID 1 0 ID of the context to set the authentication data for.
uint8_t[16] Data 0..16 1 Authentication data.

Response

Potential status codes:

Auth Data Response Parameters

Type Name Size Offset Description
uint8_t Context 1 0 Provisioning context ID

Provisioning ECDH Secret

Opcode: 0x68

Total length: 34 bytes

Used to respond to a Provisioning ECDH Request event. It passes the calculated ECDH shared secret back to the mesh stack.

ECDH Secret Parameters:

Type Name Size Offset Description
uint8_t Context ID 1 0 ID of the context to set the shared secret for.
uint8_t[32] Shared Secret 32 1 ECDH shared secret.

Response

Potential status codes:

ECDH Secret Response Parameters

Type Name Size Offset Description
uint8_t Context 1 0 Provisioning context ID

Provisioning Keypair Set

Opcode: 0x69

Total length: 97 bytes

Send a public/private keypair to the device. These keys are used for some of the encryption involved in provisioning.

Keypair Set Parameters:

Type Name Size Offset Description
uint8_t[32] Private Key 32 0 Private key.
uint8_t[64] Public Key 64 32 Public key.

Response

Potential status codes:

The response has no parameters.


Provisioning Capabilities Set

Opcode: 0x6a

Total length: 10 bytes

Used to set the out-of-band authentication capabilities of a device. The values for the parameters can be found in the various defines in the nrf_mesh_prov.h header file.

Capabilities Set Parameters:

Type Name Size Offset Description
uint8_t Num Elements 1 0 The number of elements in the device
uint8_t Public Key Type 1 1 The type of public key used in the device.
uint8_t Static OOB Types 1 2 The types of static OOB authentication methods.
uint8_t Output OOB Size 1 3 Maximum size of the OOB authentication output.
uint16_t Output OOB Actions 2 4 Available output actions for OOB authentication.
uint8_t Input OOB Size 1 6 Maximum size of the OOB authentication input.
uint16_t Input OOB Actions 2 7 Available input actions for OOB authentication.

Response

Potential status codes:

The response has no parameters.


nRF Open Mesh Init

Opcode: 0x70

Total length: 1 byte

Not implemented.

Init takes no parameters.

Response

Potential status codes:

The response has no parameters.


nRF Open Mesh Value Set

Opcode: 0x71

Total length: 1 byte

Not implemented.

Value Set takes no parameters.

Response

Potential status codes:

The response has no parameters.


nRF Open Mesh Value Enable

Opcode: 0x72

Total length: 1 byte

Not implemented.

Value Enable takes no parameters.

Response

Potential status codes:

The response has no parameters.


nRF Open Mesh Value Disable

Opcode: 0x73

Total length: 1 byte

Not implemented.

Value Disable takes no parameters.

Response

Potential status codes:

The response has no parameters.


nRF Open Mesh Start

Opcode: 0x74

Total length: 1 byte

Not implemented.

Start takes no parameters.

Response

Potential status codes:

The response has no parameters.


nRF Open Mesh Stop

Opcode: 0x75

Total length: 1 byte

Not implemented.

Stop takes no parameters.

Response

Potential status codes:

The response has no parameters.


nRF Open Mesh Flag Set

Opcode: 0x76

Total length: 1 byte

Not implemented.

Flag Set takes no parameters.

Response

Potential status codes:

The response has no parameters.


nRF Open Mesh Flag Get

Opcode: 0x77

Total length: 1 byte

Not implemented.

Flag Get takes no parameters.

Response

Potential status codes:

The response has no parameters.


nRF Open Mesh DFU Data

Opcode: 0x78

Total length: 32 bytes

Send DFU data to the device.

DFU Data Parameters:

Type Name Size Offset Description
uint8_t[31] DFU Packet 31 0 DFU packet data.

Response

Potential status codes:

The response has no parameters.


nRF Open Mesh Value Get

Opcode: 0x7a

Total length: 1 byte

Not implemented.

Value Get takes no parameters.

Response

Potential status codes:

The response has no parameters.


nRF Open Mesh Build Version Get

Opcode: 0x7b

Total length: 1 byte

Not implemented.

Build Version Get takes no parameters.

Response

Potential status codes:

The response has no parameters.


nRF Open Mesh Access Addr Get

Opcode: 0x7c

Total length: 1 byte

Not implemented.

Access Addr Get takes no parameters.

Response

Potential status codes:

The response has no parameters.


nRF Open Mesh Channel Get

Opcode: 0x7d

Total length: 1 byte

Not implemented.

Channel Get takes no parameters.

Response

Potential status codes:

The response has no parameters.


nRF Open Mesh Interval Min ms Get

Opcode: 0x7f

Total length: 1 byte

Not implemented.

Interval Min ms Get takes no parameters.

Response

Potential status codes:

The response has no parameters.


Bluetooth Mesh Enable

Opcode: 0x90

Total length: 1 byte

Enable mesh operation. Starts radio scanning and transmissions.

Enable takes no parameters.

Response

Potential status codes:

The response has no parameters.


Bluetooth Mesh Disable

Opcode: 0x91

Total length: 1 byte

Disable mesh operation. Stops radio scanning and transmissions.

Disable takes no parameters.

Response

Potential status codes:

The response has no parameters.


Bluetooth Mesh Subnet Add

Opcode: 0x92

Total length: 19 bytes

Add a mesh subnetwork to the device.

Subnet Add Parameters:

Type Name Size Offset Description
uint16_t Net Key Index 2 0 Mesh-global key index.
uint8_t[16] Key 16 2 Key to add.

Response

Potential status codes:

Subnet Add Response Parameters

Type Name Size Offset Description
uint16_t Subnet Handle 2 0 Subnetwork handle operated on.

Bluetooth Mesh Subnet Update

Opcode: 0x93

Total length: 19 bytes

Update a mesh subnetwork's root key.

Subnet Update Parameters:

Type Name Size Offset Description
uint16_t Subnet Handle 2 0 Handle of the subnet to change.
uint8_t[16] Key 16 2 Key to change to.

Response

Potential status codes:

Subnet Update Response Parameters

Type Name Size Offset Description
uint16_t Subnet Handle 2 0 Subnetwork handle operated on.

Bluetooth Mesh Subnet Delete

Opcode: 0x94

Total length: 3 bytes

Delete a subnetwork from the device.

Subnet Delete Parameters:

Type Name Size Offset Description
uint16_t Subnet Handle 2 0 Handle of the subnet to delete.

Response

Potential status codes:

Subnet Delete Response Parameters

Type Name Size Offset Description
uint16_t Subnet Handle 2 0 Subnetwork handle operated on.

Bluetooth Mesh Subnet Get All

Opcode: 0x95

Total length: 1 byte

Get all known subnetwork key indexes.

Subnet Get All takes no parameters.

Response

Potential status codes:

Subnet Get All Response Parameters

Type Name Size Offset Description
uint16_t[126] Subnet Key Index 252 0 List of all subnetwork key indexes known by the device.

Bluetooth Mesh Subnet Count Max Get

Opcode: 0x96

Total length: 1 byte

Get the maximum number of subnetworks the device can fit.

Subnet Count Max Get takes no parameters.

Response

Potential status codes:

Subnet Count Max Get Response Parameters

Type Name Size Offset Description
uint16_t List Size 2 0 Size of the list requested by the command.

Bluetooth Mesh Appkey Add

Opcode: 0x97

Total length: 21 bytes

Add a mesh application key to the device.

Appkey Add Parameters:

Type Name Size Offset Description
uint16_t App Key Index 2 0 Mesh-global key index.
uint16_t Subnet Handle 2 2 Handle of the subnetwork to add the appkey to.
uint8_t[16] Key 16 4 Key to add.

Response

Potential status codes:

Appkey Add Response Parameters

Type Name Size Offset Description
uint16_t Appkey Handle 2 0 Application key handle operated on.

Bluetooth Mesh Appkey Update

Opcode: 0x98

Total length: 19 bytes

Update a mesh application key.

Appkey Update Parameters:

Type Name Size Offset Description
uint16_t Appkey Handle 2 0 Handle of the appkey to change.
uint8_t[16] Key 16 2 Key to change to.

Response

Potential status codes:

Appkey Update Response Parameters

Type Name Size Offset Description
uint16_t Appkey Handle 2 0 Application key handle operated on.

Bluetooth Mesh Appkey Delete

Opcode: 0x99

Total length: 3 bytes

Delete a application key from the device.

Appkey Delete Parameters:

Type Name Size Offset Description
uint16_t Appkey Handle 2 0 Handle of the appkey to delete.

Response

Potential status codes:

Appkey Delete Response Parameters

Type Name Size Offset Description
uint16_t Appkey Handle 2 0 Application key handle operated on.

Bluetooth Mesh Appkey Get All

Opcode: 0x9a

Total length: 3 bytes

Get all the application key indices of the stored application keys associated with a specific subnetwork.

Appkey Get All Parameters:

Type Name Size Offset Description
uint16_t Subnet Handle 2 0 Handle of the subnet to get all appkeys of.

Response

Potential status codes:

Appkey Get All Response Parameters

Type Name Size Offset Description
uint16_t Subnet Handle 2 0 Handle of the Subnetwork associated with the application keys.
uint16_t[125] Appkey Key Index 250 2 List of all application key indexes known by the device.

Bluetooth Mesh Appkey Count Max Get

Opcode: 0x9b

Total length: 1 byte

Get the maximum number of application keys the device can fit.

Appkey Count Max Get takes no parameters.

Response

Potential status codes:

Appkey Count Max Get Response Parameters

Type Name Size Offset Description
uint16_t List Size 2 0 Size of the list requested by the command.

Bluetooth Mesh Devkey Add

Opcode: 0x9c

Total length: 21 bytes

Add a mesh device key to the device.

Devkey Add Parameters:

Type Name Size Offset Description
uint16_t Owner Addr 2 0 Unicast address of the device that owns the given devkey.
uint16_t Subnet Handle 2 2 Handle of the subnetwork to bind the devkey to.
uint8_t[16] Key 16 4 Key to add.

Response

Potential status codes:

Devkey Add Response Parameters

Type Name Size Offset Description
uint16_t Devkey Handle 2 0 Device key handle operated on.

Bluetooth Mesh Devkey Delete

Opcode: 0x9d

Total length: 3 bytes

Delete a device key from the device.

Devkey Delete Parameters:

Type Name Size Offset Description
uint16_t Devkey Handle 2 0 Handle of the devkey to delete.

Response

Potential status codes:

Devkey Delete Response Parameters

Type Name Size Offset Description
uint16_t Devkey Handle 2 0 Device key handle operated on.

Bluetooth Mesh Devkey Count Max Get

Opcode: 0x9e

Total length: 1 byte

Get the maximum number of device keys the device can fit.

Devkey Count Max Get takes no parameters.

Response

Potential status codes:

Devkey Count Max Get Response Parameters

Type Name Size Offset Description
uint16_t List Size 2 0 Size of the list requested by the command.

Bluetooth Mesh Addr Local Unicast Set

Opcode: 0x9f

Total length: 5 bytes

Set the start and count of the device's local unicast address.

Addr Local Unicast Set Parameters:

Type Name Size Offset Description
uint16_t Start Address 2 0 First address in the range of unicast addresses.
uint16_t Count 2 2 Number of addresses in the range of unicast addresses.

Response

Potential status codes:

The response has no parameters.


Bluetooth Mesh Addr Local Unicast Get

Opcode: 0xa0

Total length: 1 byte

Get the start and count of the device's local unicast addresses.

Addr Local Unicast Get takes no parameters.

Response

Potential status codes:

Addr Local Unicast Get Response Parameters

Type Name Size Offset Description
uint16_t Address Start 2 0 First address in the range of unicast addresses.
uint16_t Count 2 2 Number of addresses in the range of unicast addresses.

Bluetooth Mesh Addr Get

Opcode: 0xa7

Total length: 3 bytes

Get the raw representation of the address with the given handle. If the given address is a virtual address, the virtual UUID will be included in the response.

Addr Get Parameters:

Type Name Size Offset Description
uint16_t Address Handle 2 0 Handle of address to get raw representation of.

Response

Potential status codes:

Addr Get Response Parameters

Type Name Size Offset Description
uint16_t Address Handle 2 0 Address handle requested.
uint8_t Addr Type 1 2 Address type of the given address. See nrf_mesh_address_type_t for accepted values.
uint8_t Subscribed 1 3 Flag indicating whether the given address is subscribed to or not.
uint16_t Raw Short Addr 2 4 Raw representation of the address.
uint8_t[16] Virtual UUID 16 6 Optional virtual UUID of the given address.

Bluetooth Mesh Addr Get All

Opcode: 0xa8

Total length: 1 byte

Get a list of all address handles in the address pool, not including local unicast addresses.

Addr Get All takes no parameters.

Response

Potential status codes:

Addr Get All Response Parameters

Type Name Size Offset Description
uint16_t[126] Address Handles 252 0 List of all address handles known by the device, not including local unicast addresses.

Bluetooth Mesh Addr Nonvirtual Count Max Get

Opcode: 0xa9

Total length: 1 byte

Get the maximum number of non-virtual addresses the device can fit.

Addr Nonvirtual Count Max Get takes no parameters.

Response

Potential status codes:

Addr Nonvirtual Count Max Get Response Parameters

Type Name Size Offset Description
uint16_t List Size 2 0 Size of the list requested by the command.

Bluetooth Mesh Addr Virtual Count Max Get

Opcode: 0xaa

Total length: 1 byte

Get the maximum number of virtual addresses the device can fit.

Addr Virtual Count Max Get takes no parameters.

Response

Potential status codes:

Addr Virtual Count Max Get Response Parameters

Type Name Size Offset Description
uint16_t List Size 2 0 Size of the list requested by the command.

Bluetooth Mesh Addr Subscription Add

Opcode: 0xa1

Total length: 3 bytes

Add the specified address to the set of active address subscriptions.

Addr Subscription Add Parameters:

Type Name Size Offset Description
uint16_t Address 2 0 Address to add as a subscription address.

Response

Potential status codes:

Addr Subscription Add Response Parameters

Type Name Size Offset Description
uint16_t Address Handle 2 0 Address handle operated on.

Bluetooth Mesh Addr Subscription Add Virtual

Opcode: 0xa2

Total length: 17 bytes

Add the virtual address with the specified UUID to the set of active address subscriptions.

Addr Subscription Add Virtual Parameters:

Type Name Size Offset Description
uint8_t[16] UUID 16 0 Virtual address UUID.

Response

Potential status codes:

Addr Subscription Add Virtual Response Parameters

Type Name Size Offset Description
uint16_t Address Handle 2 0 Address handle operated on.

Bluetooth Mesh Addr Subscription Remove

Opcode: 0xa3

Total length: 3 bytes

Remove the address with the given handle from the set of active address subscriptions.

Addr Subscription Remove Parameters:

Type Name Size Offset Description
uint16_t Address Handle 2 0 Handle of address to remove from address subscription list.

Response

Potential status codes:

Addr Subscription Remove Response Parameters

Type Name Size Offset Description
uint16_t Address Handle 2 0 Address handle operated on.

Bluetooth Mesh Addr Publication Add

Opcode: 0xa4

Total length: 3 bytes

Add the specified address to the set of active publish addresses.

Addr Publication Add Parameters:

Type Name Size Offset Description
uint16_t Address 2 0 Address to add as a publication address.

Response

Potential status codes:

Addr Publication Add Response Parameters

Type Name Size Offset Description
uint16_t Address Handle 2 0 Address handle operated on.

Bluetooth Mesh Addr Publication Add Virtual

Opcode: 0xa5

Total length: 17 bytes

Add the virtual address with the specified UUID to the set of active publish addresses.

Addr Publication Add Virtual Parameters:

Type Name Size Offset Description
uint8_t[16] UUID 16 0 Virtual address UUID.

Response

Potential status codes:

Addr Publication Add Virtual Response Parameters

Type Name Size Offset Description
uint16_t Address Handle 2 0 Address handle operated on.

Bluetooth Mesh Addr Publication Remove

Opcode: 0xa6

Total length: 3 bytes

Remove the address with the specified handle from the set of active publish addresses.

Addr Publication Remove Parameters:

Type Name Size Offset Description
uint16_t Address Handle 2 0 Handle of the address to remove from the publication address list.

Response

Potential status codes:

Addr Publication Remove Response Parameters

Type Name Size Offset Description
uint16_t Address Handle 2 0 Address handle operated on.

Bluetooth Mesh Packet Send

Opcode: 0xab

Total length: 11..255 bytes

Send a mesh packet. The source address handle must represent a local unicast address.

Packet Send Parameters:

Type Name Size Offset Description
uint16_t Appkey Handle 2 0 Appkey or devkey handle to use for packet sending. Subnetwork will be picked automatically.
uint16_t SRC Addr 2 2 Raw unicast address to use as source address. Must be in the range of local unicast addresses.
uint16_t DST Addr Handle 2 4 Handle of destination address to use in packet.
uint8_t TTL 1 6 Time To Live value to use in packet.
uint8_t Force Segmented 1 7 Whether or not to force use of segmented message type for the transmission.
uint8_t Transmic Size 1 8 Transport MIC size used enum. SMALL=0, LARGE=1, DEFAULT=2. LARGE may only be used with segmented packets.
uint8_t Friendship Credential Flag 1 9 Control parameter for credentials used to publish messages from a model. 0 for master, 1 for friendship.
uint8_t[244] Data 0..244 10 Payload of the packet.

Response

Potential status codes:

Packet Send Response Parameters

Type Name Size Offset Description
nrf_mesh_tx_token_t Token 4 0 TX Token assigned to the packet. Can be used to resolve which packet a SERIAL_OPCODE_EVT_MESH_TX_COMPLETE event refers to.

Bluetooth Mesh State Clear

Opcode: 0xac

Total length: 1 byte

Reset the device and network state and erase the flash copies.

State Clear takes no parameters.

Response

Potential status codes:

The response has no parameters.


Bluetooth Mesh Config Server Bind

Opcode: 0xad

Total length: 3 bytes

Binds the config server model instance to given device key handle.

Config Server Bind Parameters:

Type Name Size Offset Description
uint16_t Address Handle 2 0 Handle of the address to get the raw representation of.

Response

Potential status codes:

The response has no parameters.


Bluetooth Mesh Net State Set

Opcode: 0xae

Total length: 12 bytes

Sets the network state.

Net State Set Parameters:

Type Name Size Offset Description
uint32_t Iv Index 4 0 The IV index to set.
uint8_t Iv Update In Progress 1 4 Value indicating the phase of the IV update process.
uint16_t Iv Update Timeout Counter 2 5 Timeout counter for IV update process.
uint32_t Next Seqnum Block 4 7 The first sequence number block which is not yet allocated.

Response

Potential status codes:

The response has no parameters.


Bluetooth Mesh Net State Get

Opcode: 0xaf

Total length: 1 byte

Gets the network state.

Net State Get takes no parameters.

Response

Potential status codes:

Net State Get Response Parameters

Type Name Size Offset Description
uint32_t Iv Index 4 0 The current IV index.
uint8_t Iv Update In Progress 1 4 Value indicating the phase of the IV update process.
uint16_t Iv Update Timeout Counter 2 5 Current value of timeout counter for IV update.
uint32_t Next Seqnum Block 4 7 The start of the next unused sequence number block.

Direct Firmware Upgrade Jump To Bootloader

Opcode: 0xd0

Total length: 1 byte

Immediately jump to bootloader mode. If successful, this call will not yield a command response. It will however yield a Device Started event if the current bootloader supports serial communication.

Jump To Bootloader takes no parameters.

Response

Potential status codes:

The response has no parameters.


Direct Firmware Upgrade Request

Opcode: 0xd1

Total length: 16 bytes

Request a DFU transfer.

Request Parameters:

Type Name Size Offset Description
uint8_t DFU Type 1 0 DFU Firmware type to request.
nrf_mesh_fwid_t FWID 10 1 Firmware ID to request.
uint32_t Bank Addr 4 11 Address in which to bank firmware.

Response

Potential status codes:

The response has no parameters.


Direct Firmware Upgrade Relay

Opcode: 0xd2

Total length: 12 bytes

Relay a DFU transfer.

Relay Parameters:

Type Name Size Offset Description
uint8_t DFU Type 1 0 DFU Firmware type to relay.
nrf_mesh_fwid_t FWID 10 1 Firmware ID of firmware that should be relayed.

Response

Potential status codes:

The response has no parameters.


Direct Firmware Upgrade Abort

Opcode: 0xd3

Total length: 1 byte

Abort the ongoing DFU transfer. Fails if there is no ongoing transfer.

Abort takes no parameters.

Response

Potential status codes:

The response has no parameters.


Direct Firmware Upgrade Bank Info Get

Opcode: 0xd4

Total length: 2 bytes

Get information about the firmware bank of the given type, if it exists.

Bank Info Get Parameters:

Type Name Size Offset Description
uint8_t DFU Type 1 0 DFU Firmware type to get bank info about.

Response

Potential status codes:

Bank Info Get Response Parameters

Type Name Size Offset Description
uint8_t DFU Type 1 0 DFU type of the bank.
nrf_mesh_fwid_t FWID 10 1 Firmware ID of the bank.
uint8_t Is Signed 1 11 Flag indicating whether the bank is signed with an encryption key.
uint32_t Start Addr 4 12 Start address of the bank.
uint32_t Length 4 16 Length of the firmware in the bank.

Direct Firmware Upgrade Bank Flash

Opcode: 0xd5

Total length: 2 bytes

Flash the bank with the given firmware type. If successful, this serial call does not produce a command response. Note that all volatile memory will be lost, as the device will restart.

If the new firmware supports serial communication, the device issues a device started event when it is ready to receive new commands.

Bank Flash Parameters:

Type Name Size Offset Description
uint8_t DFU Type 1 0 DFU Firmware type to flash.

Response

Potential status codes:

The response has no parameters.


Direct Firmware Upgrade State Get

Opcode: 0xd6

Total length: 1 byte

Get the current state of the DFU module. Only works if the DFU module has been initialized.

State Get takes no parameters.

Response

Potential status codes:

State Get Response Parameters

Type Name Size Offset Description
uint8_t Role 1 0 This device's intended role in the transfer, see nrf_mesh_dfu_role_t for accepted values.
uint8_t Type 1 1 The DFU type of the transfer, see nrf_mesh_dfu_type_t for accepted values.
nrf_mesh_fwid_t FWID 10 2 The FWID of the new data in the transfer.
uint8_t State 1 12 The current global state of the transfer, see nrf_mesh_dfu_state_t for accepted values.
uint8_t Data Progress 1 13 The progress of the transfer in percent (0-100).

Access Layer Model Pub Addr Set

Opcode: 0xe0

Total length: 5 bytes

Set the publish address for a model instance.

Model Pub Addr Set Parameters:

Type Name Size Offset Description
access_model_handle_t Model Handle 2 0 Handle for the model being modified.
dsm_handle_t Dsm Handle 2 2 Handle for a value (e.g. address) stored by the device state manager.

Response

Potential status codes:

The response has no parameters.


Access Layer Model Pub Addr Get

Opcode: 0xe1

Total length: 3 bytes

Get the publish address for a model instance.

Model Pub Addr Get Parameters:

Type Name Size Offset Description
access_model_handle_t Handle 2 0 Handle of the model that the access module should operate on.

Response

Potential status codes:

Model Pub Addr Get Response Parameters

Type Name Size Offset Description
dsm_handle_t Addr Handle 2 0 Address handle for the publish address.

Access Layer Model Pub Period Set

Opcode: 0xe2

Total length: 5 bytes

Set the publish period for a model instance.

Model Pub Period Set Parameters:

Type Name Size Offset Description
access_model_handle_t Model Handle 2 0 Handle of the model that the access module should operate on.
uint8_t Resolution 1 2 see access_publish_resolution_t for accepted values.
uint8_t Step Number 1 3 Must not be larger than ACCESS_PUBLISH_PERIOD_STEP_MAX.

Response

Potential status codes:

The response has no parameters.


Access Layer Model Pub Period Get

Opcode: 0xe3

Total length: 3 bytes

Get the publish period for a model instance.

Model Pub Period Get Parameters:

Type Name Size Offset Description
access_model_handle_t Handle 2 0 Handle of the model that the access module should operate on.

Response

Potential status codes:

Model Pub Period Get Response Parameters

Type Name Size Offset Description
uint8_t Resolution 1 0 Resolution of each step.
uint8_t Step Number 1 1 Number of steps in each period.

Access Layer Model Subs Add

Opcode: 0xe4

Total length: 5 bytes

Add a subscription address to a model instance.

Model Subs Add Parameters:

Type Name Size Offset Description
access_model_handle_t Model Handle 2 0 Handle for the model being modified.
dsm_handle_t Dsm Handle 2 2 Handle for a value (e.g. address) stored by the device state manager.

Response

Potential status codes:

The response has no parameters.


Access Layer Model Subs Remove

Opcode: 0xe5

Total length: 5 bytes

Remove a subscription address from a model instance.

Model Subs Remove Parameters:

Type Name Size Offset Description
access_model_handle_t Model Handle 2 0 Handle for the model being modified.
dsm_handle_t Dsm Handle 2 2 Handle for a value (e.g. address) stored by the device state manager.

Response

Potential status codes:

The response has no parameters.


Access Layer Model Subs Get

Opcode: 0xe6

Total length: 3 bytes

Get the list of subscription addresses from a model instance.

Model Subs Get Parameters:

Type Name Size Offset Description
access_model_handle_t Handle 2 0 Handle of the model that the access module should operate on.

Response

Potential status codes:

Model Subs Get Response Parameters

Type Name Size Offset Description
uint16_t Count 2 0 Number of available handles in address_handles
dsm_handle_t[125] Address Handles 250 2 List of the address handles of all subscription addresses bound to the given model

Access Layer Model App Bind

Opcode: 0xe7

Total length: 5 bytes

Bind an application key to a model instance.

Model App Bind Parameters:

Type Name Size Offset Description
access_model_handle_t Model Handle 2 0 Handle for the model being modified.
dsm_handle_t Dsm Handle 2 2 Handle for a value (e.g. address) stored by the device state manager.

Response

Potential status codes:

The response has no parameters.


Access Layer Model App Unbind

Opcode: 0xe8

Total length: 5 bytes

Unbind an application key from a model instance.

Model App Unbind Parameters:

Type Name Size Offset Description
access_model_handle_t Model Handle 2 0 Handle for the model being modified.
dsm_handle_t Dsm Handle 2 2 Handle for a value (e.g. address) stored by the device state manager.

Response

Potential status codes:

The response has no parameters.


Access Layer Model App Get

Opcode: 0xe9

Total length: 3 bytes

Get all the application keys bound to a model instance.

Model App Get Parameters:

Type Name Size Offset Description
access_model_handle_t Handle 2 0 Handle of the model that the access module should operate on.

Response

Potential status codes:

Model App Get Response Parameters

Type Name Size Offset Description
uint16_t Count 2 0 Number of available handles in appkey_handles
dsm_handle_t[125] Appkey Handles 250 2 List of the address handles of all subscription addresses bound to the given model

Access Layer Model Pub App Set

Opcode: 0xea

Total length: 5 bytes

Set the application key to be used when publishing for a model instance.

Model Pub App Set Parameters:

Type Name Size Offset Description
access_model_handle_t Model Handle 2 0 Handle for the model being modified.
dsm_handle_t Dsm Handle 2 2 Handle for a value (e.g. address) stored by the device state manager.

Response

Potential status codes:

The response has no parameters.


Access Layer Model Pub App Get

Opcode: 0xeb

Total length: 3 bytes

Get the application key used when publishing for a model instance.

Model Pub App Get Parameters:

Type Name Size Offset Description
access_model_handle_t Handle 2 0 Handle of the model that the access module should operate on.

Response

Potential status codes:

Model Pub App Get Response Parameters

Type Name Size Offset Description
dsm_handle_t Appkey Handle 2 0 Handle of the application key used for publishing.

Access Layer Model Pub TTL Set

Opcode: 0xec

Total length: 4 bytes

Set the default TTL value used when publishing for a model instance.

Model Pub TTL Set Parameters:

Type Name Size Offset Description
access_model_handle_t Model Handle 2 0 Handle of the model that the access module should operate on.
uint8_t TTL 1 2 TTL for outgoing messages.

Response

Potential status codes:

The response has no parameters.


Access Layer Model Pub TTL Get

Opcode: 0xed

Total length: 3 bytes

Get the default TTL value used when publishing for a model instance.

Model Pub TTL Get Parameters:

Type Name Size Offset Description
access_model_handle_t Handle 2 0 Handle of the model that the access module should operate on.

Response

Potential status codes:

Model Pub TTL Get Response Parameters

Type Name Size Offset Description
uint8_t TTL 1 0 TTL for published messages.

Access Layer Elem Loc Set

Opcode: 0xee

Total length: 5 bytes

Set the location descriptor for an element.

Elem Loc Set Parameters:

Type Name Size Offset Description
uint16_t Element Index 2 0 Index of the addressed element.
uint16_t Location 2 2 Location value for the element.

Response

Potential status codes:

The response has no parameters.


Access Layer Elem Loc Get

Opcode: 0xef

Total length: 3 bytes

Get the location descriptor for an element.

Elem Loc Get Parameters:

Type Name Size Offset Description
uint16_t Element Index 2 0 Index of the addressed element.

Response

Potential status codes:

Elem Loc Get Response Parameters

Type Name Size Offset Description
uint16_t Location 2 0 Element location info.

Access Layer Elem Sig Model Count Get

Opcode: 0xf0

Total length: 3 bytes

Get the number of Bluetooth SIG models for an element.

Elem Sig Model Count Get Parameters:

Type Name Size Offset Description
uint16_t Element Index 2 0 Index of the addressed element.

Response

Potential status codes:

Elem Sig Model Count Get Response Parameters

Type Name Size Offset Description
uint8_t Model Count 1 0 Number of existing models.

Access Layer Elem Vendor Model Count Get

Opcode: 0xf1

Total length: 3 bytes

Get the number of vendor specific models for an element.

Elem Vendor Model Count Get Parameters:

Type Name Size Offset Description
uint16_t Element Index 2 0 Index of the addressed element.

Response

Potential status codes:

Elem Vendor Model Count Get Response Parameters

Type Name Size Offset Description
uint8_t Model Count 1 0 Number of existing models.

Access Layer Model ID Get

Opcode: 0xf2

Total length: 3 bytes

Get the model ID of a model instance.

Model ID Get Parameters:

Type Name Size Offset Description
access_model_handle_t Handle 2 0 Handle of the model that the access module should operate on.

Response

Potential status codes:

Model ID Get Response Parameters

Type Name Size Offset Description
access_model_id_t Model ID 4 0 Company and model IDs.

Access Layer Handle Get

Opcode: 0xf3

Total length: 7 bytes

Get the handle assigned to the model instance of a model based on the element index and model ID.

Handle Get Parameters:

Type Name Size Offset Description
uint16_t Element Index 2 0 Index of the addressed element which owns the model.
access_model_id_t Model ID 4 2 Company and model IDs.

Response

Potential status codes:

Handle Get Response Parameters

Type Name Size Offset Description
access_model_handle_t Model Handle 2 0 Handle of the requested model.

Access Layer Elem Models Get

Opcode: 0xf4

Total length: 3 bytes

Get the array of handles corresponding to an element.

Elem Models Get Parameters:

Type Name Size Offset Description
uint16_t Element Index 2 0 Index of the addressed element.

Response

Potential status codes:

Elem Models Get Response Parameters

Type Name Size Offset Description
uint16_t Count 2 0 Number of available handles in model_handles
access_model_handle_t[125] Model Handles 250 2 List of the address handles of all subscription addresses bound to the given model

Model Specific Models Get

Opcode: 0xfc

Total length: 1 byte

Get a list of all the models available on the device.

Models Get takes no parameters.

Response

Potential status codes:

Models Get Response Parameters

Type Name Size Offset Description
uint16_t Count 2 0 Number of available handles in model_ids
access_model_id_t[62] Model IDs 248 2 List of the model ids of all the available models.

Model Specific Init

Opcode: 0xfd

Total length: 7..255 bytes

Call the initializer of the addressed model to create a new instance.

Init Parameters:

Type Name Size Offset Description
serial_cmd_model_specific_init_header_t Model Init Info 6 0 Basic information that is always needed to initialize a model
uint8_t[248] Data 0..248 6 Additional data provided to the initializer

Response

Potential status codes:

Init Response Parameters

Type Name Size Offset Description
access_model_handle_t Model Handle 2 0 Handle of the initialized model.

Model Specific Command

Opcode: 0xfe

Total length: 3..255 bytes

Forward a model specific command to a model instance. See the serial handler for the specific model being commanded for more information.

Command Parameters:

Type Name Size Offset Description
serial_cmd_model_specific_command_header_t Model Cmd Info 2 0 Contains the handle of the model being addressed.
uint8_t[252] Data 0..252 2 Additional data provided to the event

Response

Potential status codes:

Command Response Parameters

Type Name Size Offset Description
uint8_t Data Len 1 0 Length of data array. Set to 0 to indicate no data to send
uint8_t[251] Data 0..251 1 Command response data specific to each model.

Documentation feedback | Developer Zone | Subscribe | Updated