diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2011-02-16 21:07:28 -0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2011-02-17 15:35:52 -0300 |
commit | 98ea92d146260bb110abcb87339bc7afe7959a66 (patch) | |
tree | 880c4fe85ee704a7395ac339019803c6312881c6 /src | |
parent | 4c07eae01d5fc6f80f88d27bbcaa2effe73ef325 (diff) | |
download | bluez-98ea92d146260bb110abcb87339bc7afe7959a66.tar.gz |
Add static Device Appearance Characteristic
Declaration and definition of the Device Appearance Characteristic
defined in the GAP Characteristics for Low Energy section: Bluetooth
Core Specification, Volume 3, Part C, section 12.2.
Diffstat (limited to 'src')
-rw-r--r-- | src/attrib-server.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/attrib-server.c b/src/attrib-server.c index 85b39a8e..fe5d68c7 100644 --- a/src/attrib-server.c +++ b/src/attrib-server.c @@ -799,6 +799,7 @@ static void register_core_services(void) uint8_t atval[256]; uuid_t uuid; int len; + uint16_t appearance = 0x0000; /* GAP service: primary service definition */ sdp_uuid16_create(&uuid, GATT_PRIM_SVC_UUID); @@ -818,8 +819,17 @@ static void register_core_services(void) attrib_db_add(0x0006, &uuid, ATT_NONE, ATT_NOT_PERMITTED, (uint8_t *) main_opts.name, len); - /* TODO: Implement Appearance characteristic. It is mandatory for - * Peripheral/Central GAP roles. */ + /* GAP service: device appearance characteristic */ + sdp_uuid16_create(&uuid, GATT_CHARAC_UUID); + atval[0] = ATT_CHAR_PROPER_READ; + att_put_u16(0x0008, &atval[1]); + att_put_u16(GATT_CHARAC_APPEARANCE, &atval[3]); + attrib_db_add(0x0007, &uuid, ATT_NONE, ATT_NOT_PERMITTED, atval, 5); + + /* GAP service: device appearance attribute */ + sdp_uuid16_create(&uuid, GATT_CHARAC_APPEARANCE); + att_put_u16(appearance, &atval[0]); + attrib_db_add(0x0008, &uuid, ATT_NONE, ATT_NOT_PERMITTED, atval, 2); /* GATT service: primary service definition */ sdp_uuid16_create(&uuid, GATT_PRIM_SVC_UUID); |