diff options
author | Mariusz Skamra <mariusz.skamra@tieto.com> | 2016-10-10 11:56:27 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2016-10-16 09:01:28 +0300 |
commit | c1ba7644f758f603748c13aeb7ddb32a608a51ee (patch) | |
tree | 092c46f0ff26e66db0e1c8847a2217dc50315028 /tests | |
parent | 059e2718598cdb7fd56fa28e06fbc34d824e0c9a (diff) |
Bluetooth: tester: Add Identity Resolved event implementation
This event will be used to inform tester about PTS identity address.
Change-Id: I3d25c69c3fc9a8d8a728497d1dc1d57084373e97
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bluetooth/tester/src/bttester.h | 8 | ||||
-rw-r--r-- | tests/bluetooth/tester/src/gap.c | 17 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/bluetooth/tester/src/bttester.h b/tests/bluetooth/tester/src/bttester.h index 4e925b99f..fb2a9ccee 100644 --- a/tests/bluetooth/tester/src/bttester.h +++ b/tests/bluetooth/tester/src/bttester.h @@ -287,6 +287,14 @@ struct gap_passkey_confirm_req_ev { uint32_t passkey; } __packed; +#define GAP_EV_IDENTITY_RESOLVED 0x87 +struct gap_identity_resolved_ev { + uint8_t address_type; + uint8_t address[6]; + uint8_t identity_address_type; + uint8_t identity_address[6]; +} __packed; + /* GATT Service */ /* commands */ #define GATT_READ_SUPPORTED_COMMANDS 0x01 diff --git a/tests/bluetooth/tester/src/gap.c b/tests/bluetooth/tester/src/gap.c index da000ac8e..c14b3c7f4 100644 --- a/tests/bluetooth/tester/src/gap.c +++ b/tests/bluetooth/tester/src/gap.c @@ -66,9 +66,26 @@ static void le_disconnected(struct bt_conn *conn, uint8_t reason) CONTROLLER_INDEX, (uint8_t *) &ev, sizeof(ev)); } +static void le_identity_resolved(struct bt_conn *conn, const bt_addr_le_t *rpa, + const bt_addr_le_t *identity) +{ + struct gap_identity_resolved_ev ev; + + ev.address_type = rpa->type; + memcpy(ev.address, rpa->a.val, sizeof(ev.address)); + + ev.identity_address_type = identity->type; + memcpy(ev.identity_address, identity->a.val, + sizeof(ev.identity_address)); + + tester_send(BTP_SERVICE_ID_GAP, GAP_EV_IDENTITY_RESOLVED, + CONTROLLER_INDEX, (uint8_t *) &ev, sizeof(ev)); +} + static struct bt_conn_cb conn_callbacks = { .connected = le_connected, .disconnected = le_disconnected, + .identity_resolved = le_identity_resolved, }; static void supported_commands(uint8_t *data, uint16_t len) |