Reducing bluetooth connection latency using selective GATT cache requests
In one embodiment, a first device obtains generic attribute (GATT) information from a second device. The first device also obtains long term key information by forming a Bluetooth connection with a second device. The first device performs an exchange with the second device to validate the long term key information. The first device obtains, based on the exchange, updated GATT information from the second device, when the long term key information is no longer valid.
1 . A method comprising:
obtaining, by a first device, generic attribute (GATT) information from a second device;
obtaining, by the first device, long term key information by forming a Bluetooth connection with the second device;
performing, by the first device, an exchange with the second device to determine whether the long term key information is valid or is no longer valid, wherein the exchange includes transmitting, by the first device, a key validity request and receiving, from the second device, a response indicating whether the long term key information is valid;
determining, by the first device, that the GATT information of the second device has changed based on at least one of the first device being unable to decode the response, the response indicating an invalid long term key result, or the first device failing to validate the long term key information; and
obtaining, by the first device and based on the determining that the GATT information has changed, updated GATT information from the second device, when the long term key information is no longer valid,
wherein the updated GATT information from the second device is attributable to a reboot of the second device.
2 . The method as in claim 1 , wherein the GATT information includes an attribute handle for an attribute stored by the second device that is requestable by the first device via the Bluetooth connection.
3 . The method as in claim 1 , wherein the first device or the second device stores the long term key information in a volatile memory.
4 . The method as in claim 1 , further comprising:
making, by the first device and based on the exchange, a determination that the GATT information does not need to be updated, when the long term key information is still valid.
5 . The method as in claim 1 , wherein the second device invalidates the long term key information based on the updated GATT information.
6 . The method as in claim 1 , wherein the first device is a network gateway.
7 . The method as in claim 1 , wherein the second device is a wireless sensor.
8 . The method as in claim 1 , wherein the second device is onboarded to a supervisory service via the first device and using a security key configured on the second device during its manufacturing.
9 . The method as in claim 1 , wherein obtaining the long term key information comprises:
performing a Bluetooth bonding exchange with the second device.
10 . An apparatus, comprising:
one or more network interfaces to communicate with a network;
a processor coupled to the one or more network interfaces and configured to execute one or more processes; and a memory configured to store a process that is executable by the processor, the process, when executed, configured to:
obtain generic attribute (GATT) information from a device;
obtain long term key information by forming a Bluetooth connection with the device;
perform an exchange with the device to determine whether the long term key information is valid or is no longer valid, wherein the exchange includes transmitting a key validity request to the device and receiving, from the device, a response indicating whether the long term key information is valid;
determine that the GATT information of the device has changed based on at least one of being unable to decode the response, the response indicating an invalid long term key result, or failing to validate the long term key information; and
obtain, based on the determining that the GATT information has changed, updated GATT information from the device, when the long term key information is no longer valid,
wherein the updated GATT information from the device is attributable to a reboot of the device.
11 . The apparatus as in claim 10 , wherein the GATT information includes an attribute handle for an attribute stored by the device that is requestable by the apparatus via the Bluetooth connection.
12 . The apparatus as in claim 10 , wherein the apparatus or the device stores the long term key information in a volatile memory.
13 . The apparatus as in claim 10 , wherein the process when executed is further configured to:
make, based on the exchange, a determination that the GATT information does not need to be updated, when the long term key information is still valid.
14 . The apparatus as in claim 10 , wherein the device invalidates the long term key information based on the updated GATT information.
15 . The apparatus as in claim 10 , wherein the apparatus is a network gateway.
16 . The apparatus as in claim 10 , wherein the device is a wireless sensor.
17 . The apparatus as in claim 10 , wherein the device is onboarded to a supervisory service via the apparatus and using a security key configured on the device during its manufacturing.
18 . A tangible, non-transitory, computer-readable medium storing program instructions that cause a first device to execute a process comprising:
obtaining, by the first device, generic attribute (GATT) information from a second device;
obtaining, by the first device, long term key information by forming a Bluetooth connection with the second device;
performing, by the first device, an exchange with the second device to determine whether the long term key information is valid or is no longer valid, wherein the exchange includes transmitting, by the first device, a key validity request and receiving, from the second device, a response indicating whether the long term key information is valid;
determining, by the first device, that the GATT information of the second device has changed based on at least one of the first device being unable to decode the response, the response indicating an invalid long term key result, or the first device failing to validate the long term key information; and
obtaining, by the first device and based on the determining that the GATT information has changed, updated GATT information from the second device, when the long term key information is no longer valid,
wherein the updated GATT information from the second device is attributable to a reboot of the second device.