![Telit Wireless Solutions BlueMod plus S42/Central Скачать руководство пользователя страница 14](http://html1.mh-extra.com/html/telit-wireless-solutions/bluemod-plus-s42-central/bluemod-plus-s42-central_software-users-manual_1083613014.webp)
S42/Central Software User Guide
1VV0301318 Rev. 3
– 2018-08-31
Reproduction forbidden without written authorization from Telit Communications S.p.A.- All Rights Reserved.
Page 14 of 66
3.1.1.4.
Writing Data to a Characteristic
To write data to a characteristic it is required that the properties of this characteristic support
“write” or “write without response”.
There are two different options to write data to the characteristic:
•
AT+LEWRITE:
Initiate a write with response access
to the characteristic
•
AT+LEWRITECMD:
Initiate a write without response access
(write command) to the characteristic
In addition it is important to know the data size of the GATT characteristic.
This information is listed in the service specification of the addressed service.
In the example the data size is defined to two bytes.
To write two data bytes (0xaa and 0xbb) to the GATT server on the peripheral side the host
controller needs to use the connection handle and characteristic handle from the ATD and
AT+LESRVD commands. Additionally the data content has to be added to the command line.
AT+LEWRITE=0x10,0x0011,aabb
OK
The command “AT+LEWRITE” uses a “write request” command which is confirmed by the
peripheral side with a “write response” message.
The result “OK” means that the value was written to the peripherals GATT server successfully.
AT+LEWRITECMD=0x10,0x0011,aabb
OK
The command “AT+LEWRITECMD” uses a “write command” which is not confirmed by the
peripheral side. The result “OK” means that the data was sent over the air.