gatt: Add support for Central Address Resolution characteristic
Subsystems (2)
Luiz Augusto von Dentz
maintainerPATCH v2 1/1 gatt: Add support for Central Address Resolution characteristic
From: Luiz Augusto von Dentz <[email protected]>
This adds Central Address Resolution characteristic so peripherals can use directed advertising using RPA as initiator address.
--- lib/uuid.h | 1 + src/gatt-database.c | 33 +++++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-)
lib/uuid.h +1 -0
@@ -116,6 +116,7 @@ extern "C" {#define GATT_CHARAC_SOFTWARE_REVISION_STRING 0x2A28#define GATT_CHARAC_MANUFACTURER_NAME_STRING 0x2A29#define GATT_CHARAC_PNP_ID 0x2A50 +#define GATT_CHARAC_CAR 0x2AA6/* GATT Characteristic Descriptors */ #define GATT_CHARAC_EXT_PROPER_UUID 0x2900
src/gatt-database.c +25 -8
@@ -699,6 +699,18 @@ static void gap_appearance_read_cb(struct gatt_db_attribute *attrib,gatt_db_attribute_read_result (attrib, id, error, value, len); } +static void gap_car_read_cb (struct gatt_db_attribute *attrib, +unsigned int id,uint16_t offset, +uint8_t opcode,struct bt_att *att, +void *user_data) +{ +uint8_t value =0x01 ; + +DBG ("GAP Central Address Resolution read request\n" ); + +gatt_db_attribute_read_result (attrib, id,0 , &value,sizeof (value)); +} +static sdp_record_t *record_new (uuid_t *uuid,uint16_t start,uint16_t end) {sdp_list_t *svclass_id, *apseq, *proto[2 ], *root, *aproto;
@@ -820,7 +832,7 @@ static void populate_gap_service(struct btd_gatt_database *database)/* Add the GAP service */ bt_uuid16_create (&uuid,UUID_GAP ); - service =gatt_db_add_service (database->db, &uuid, true,5 ); + service =gatt_db_add_service (database->db, &uuid, true,7 );/* * Device Name characteristic.
@@ -842,6 +854,17 @@ static void populate_gap_service(struct btd_gatt_database *database) NULL, database);gatt_db_attribute_set_fixed_length (attrib,2 ); +/* +* Central Address Resolution characteristic. +*/ +bt_uuid16_create (&uuid,GATT_CHARAC_CAR ); + attrib =gatt_db_service_add_characteristic (service, &uuid, +BT_ATT_PERM_READ , +BT_GATT_CHRC_PROP_READ , + gap_car_read_cb, +NULL , database); +gatt_db_attribute_set_fixed_length (attrib,1 ); +gatt_db_service_set_active (service, true);database_add_record (database, service);
@@ -3853,13 +3876,7 @@ void btd_gatt_database_restore_svc_chng_ccc(struct btd_gatt_database *database)*/ btd_adapter_for_each_device (database->adapter, restore_state, database); -/* This needs to be updated (probably to 0x0001) if we ever change -* core services -* -* TODO we could also store this info (along with CCC value) and be able -* to send 0x0001-0xffff only once per device. -*/ -put_le16 (0x000a , value); +put_le16 (0x0001 , value);put_le16 (0xffff , value +2 ); send_notification_to_devices(database, handle, value, sizeof(value),
Signature · 1 line
2.31.1
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=522925
---Test result---
Test Summary:
CheckPatch PASS 0.30 seconds GitLint PASS 0.10 seconds Prep - Setup ELL PASS 39.70 seconds Build - Prep PASS 0.10 seconds Build - Configure PASS 6.96 seconds Build - Make PASS 172.16 seconds Make Check PASS 9.09 seconds Make Distcheck PASS 201.97 seconds Build w/ext ELL - Configure PASS 6.97 seconds Build w/ext ELL - Make PASS 161.60 seconds
Details
##############################
Test: CheckPatch - PASS
Desc: Run checkpatch.pl script with rule in .checkpatch.conf
##############################
Test: GitLint - PASS
Desc: Run gitlint with rule in .gitlint
##############################
Test: Prep - Setup ELL - PASS
Desc: Clone, build, and install ELL
##############################
Test: Build - Prep - PASS
Desc: Prepare environment for build
##############################
Test: Build - Configure - PASS
Desc: Configure the BlueZ source tree
##############################
Test: Build - Make - PASS
Desc: Build the BlueZ source tree
##############################
Test: Make Check - PASS
Desc: Run 'make check'
##############################
Test: Make Distcheck - PASS
Desc: Run distcheck to check the distribution
##############################
Test: Build w/ext ELL - Configure - PASS
Desc: Configure BlueZ source with '--enable-external-ell' configuration
##############################
Test: Build w/ext ELL - Make - PASS
Desc: Build BlueZ source with '--enable-external-ell' configuration
---
Regards,
Linux Bluetooth
Luiz Augusto von Dentz
maintainerHi,
Quoted 66 lines · On Wed, Jul 28, 2021 at 2:35 PM <[email protected]> wrote:
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=522925---Test result---
Test Summary:
CheckPatch PASS 0.30 seconds GitLint PASS 0.10 seconds Prep - Setup ELL PASS 39.70 seconds Build - Prep PASS 0.10 seconds Build - Configure PASS 6.96 seconds Build - Make PASS 172.16 seconds Make Check PASS 9.09 seconds Make Distcheck PASS 201.97 seconds Build w/ext ELL - Configure PASS 6.97 seconds Build w/ext ELL - Make PASS 161.60 secondsDetails
##############################
Test: CheckPatch - PASS
Desc: Run checkpatch.pl script with rule in .checkpatch.conf##############################
Test: GitLint - PASS
Desc: Run gitlint with rule in .gitlint##############################
Test: Prep - Setup ELL - PASS
Desc: Clone, build, and install ELL##############################
Test: Build - Prep - PASS
Desc: Prepare environment for build##############################
Test: Build - Configure - PASS
Desc: Configure the BlueZ source tree##############################
Test: Build - Make - PASS
Desc: Build the BlueZ source tree##############################
Test: Make Check - PASS
Desc: Run 'make check'##############################
Test: Make Distcheck - PASS
Desc: Run distcheck to check the distribution##############################
Test: Build w/ext ELL - Configure - PASS
Desc: Configure BlueZ source with '--enable-external-ell' configuration##############################
Test: Build w/ext ELL - Make - PASS
Desc: Build BlueZ source with '--enable-external-ell' configuration
Quoted 3 lines
---
Regards,
Linux Bluetooth
Pushed.
Signature · 1 line
Luiz Augusto von Dentz