
S
AT Command Reference
Release r02
www.stollmann.de
Page 28 of 33
Example:
The example below shows the Battery Service. Battery Service is a simple service
which exposes the battery charging level as single characteristic value.
Command
Response
Description
CC FF 1C 41 54 2B 4C 45 41 54 54 52 49 42 3D 70
73 65 72 76 2C 75 75 69 64 3D 31 38 30 46 0D
(human readable:
AT+LEATTRIB=pserv,uuid=180F)
CC FF 19 41 54 2B 4C 45 41 54 54 52 49 42 3D 63
68 61 72 2C 70 72 6F 70 3D 31 32 0D
(human readable:
AT+LEATTRIB=char,prop=12)
CC FF 06 0D 0A
4F 4B 0D 0A
(OK)
CC FF 06 0D 0A
4F 4B 0D 0A
(OK)
Declares the properties of
the battery level value
CC FF 2E 41 54 2B 4C 45 41 54 54 52 49 42 3D 63
68 61 72 76 61 6C 2C 75 75 69 64 3D 32 41 31 39
2C 70 65 72 6D 3D 30 30 30 31 2C 6C 65 6E 3D 31
0D
(human readable:
AT+LEATTRIB=charval,uuid=2A19,perm=0001,
len=1)
CC FF 08 0D 0A
30 78 30 32 0D
0A
CC FF 06 0D 0A
4F 4B 0D 0A
(0x02
OK)
Declares the battery level
value (one byte in the
range 0,..,100).
Battery level values are
exchanged over
multiplexer channel 2
CC FF 15 41 54 2B 4C 45 41 54 54 52 49 42 3D 63
6F 6D 70 6C 65 74 65 0D
(human readable:
AT+LEATTRIB=complete)
CC FF 06 0D 0A
4F 4B 0D 0A
(OK)
Completes the service
definition sequence
If a connection exists values written to data multiplexer channel 2 will be sent to the
remote device. If no connection exsists, the last value written to a multiplexer
channel will be stored in RAM. In case a connection from or to a remote device is
established, the remote device will receive the last value that the application wrote
to channel 2. If the application did not write a value to the data channel yet, the
value of the characteristic is set to 0. It is recommended that the application sets
default data values for all characteristics immediately after registration of all
characteristics.