5.4.4.3 Write Remote Characteristic Value for Multiple Links(CHWM,<hex16>,…)

Format: CHWM,<hex16>,<hex16>,<hex value>

Command CHWM writes the content of the GATT service characteristic to the dedicated remote device by connection handle for multiple links.

This command takes three parameters. The first parameter is the 16-bit hex value of the connection handle, and the second parameter is the 16-bit hex value of the handle corresponding to the characteristic of the GATT service. The user must find a match between the handle and its characteristic UUID by using command LCM. The third parameter is the content to be written to the characteristic.

This command is effective under the following conditions:
  • An active connection with a peer device exists.
  • The command CI starts the client operation.
  • The handle parameter is valid and the corresponding characteristic is writable according to its property.

The content value is written to the remote peer device. The writing method depends on the property of the characteristic.

When writing a configuration handle to the remote device, Bluetooth specification defines the format as 0x0000, 0x0001 or 0x0002.
  • Value 0x0001 (01 00 over the air in little-endian) – Starts the notification
  • Value 0x0002 (02 00 over the air in little-endian) – Starts the indication
  • Value 0x0000 – Stops both notification and indication
To start the notification or indication depends on the service specification and property of the characteristic. For more details, see Table 9-1.
Example: CHWM,0071,001A,64

// Set the value of the characteristic with the value handle 0x001A to 0x64 on the remote device

CHWM,0071,001B,0100

// Set connection handle value 0x0071

// Start notification on characteristic by writing 0x0001 to its configuration handle 0x001B on remote device

Response: AOK // Success
Err

// Syntax error, invalid parameter, not connected or characteristic not writable