User guide
Silicon Labs Page of 14 21
3.3.3 <value> : Characteristic Value Definition element
The XML element is used to define a characteristic value description.
<value>
The attributes are described in more detail in the table below.
Attribute Description
length
This atttribute defines the fixed length of an attribute or the maximum length of an attribute
if the attribute (see below) is used.
variable_length
Range:
0 - 255 (Bytes)
variable_length
This attribute defines that the length of an attribute is variable.
Range:
0 - 255 (Bytes)
type
This attribute defines how to interpret the element value.
Options:
hex: Value is hex
utf-8: Value is string
user: When this property is used in a characteristic and a remote device tries to read the
value (with ATT read operation), an event is generated to the
User Read Request
application (via BGscript or BGAPI). The application must then provide the attributes value
or an error code to the remote device with the command . This
User Read Response
feature enables the application to dynamically generate the attributes value whenever it's
being requested by a remote device.
The user property can also be used with attributes that can be written. When a remote
device writes an attribute with the user property an event is generated
Attribute Value
where the reason code is The
attributes_attribute_change_reason_write_request_user.
application must then accept or reject the write to the remote device with
User Write
command.
Response
Default:
utf-8: Value is string
Example: A simple characteristic value length definition (20 bytes) and UTF-8 type (since it's the default).
<value length="20" />
Example: A variable length characteristic definition, where length can be from 0 up to 20 bytes.
<value variable_length="true" length="20" />
Example: Characteristic type definition.
<value type="hex" />
Example: A characteristic type and length definition.
<value length="20" />type="hex"
Example: A characteristic length and user type property definitions.
<value length="20" />type="user"