GATT SERVICE DISCOVERY PROCEDURE FOR TWO OR MORE DEVICES
20230239672 · 2023-07-27
Assignee
Inventors
Cpc classification
H04W4/80
ELECTRICITY
H04R2420/07
ELECTRICITY
International classification
H04R1/10
ELECTRICITY
Abstract
The present invention provides a control method of an electronic device, wherein the control method includes the steps of: wirelessly connecting to a first device; performing a service discovery to the first device to retrieve a plurality of attribute handles from the first device; storing the plurality of attribute handles of the first device into a database cache; wirelessly connecting to a second device; determining whether the second device and the first device have the same attribute handles; and in response to the second device having the same attribute handles as the first device, directly using the plurality of attribute handles of the first device stored in the database cache, for using services of the second device.
Claims
1. A control method of an electronic device, comprising: wirelessly connecting to a first device; performing a service discovery to the first device to retrieve a plurality of attribute handles from the first device; storing the plurality of attribute handles of the first device into a database cache; wirelessly connecting to a second device; determining whether the second device and the first device have the same attribute handles; and in response to the second device having the same attribute handles as the first device, directly using the plurality of attribute handles of the first device stored in the database cache, for using services of the second device.
2. The control method of claim 1, wherein the step of in response to the second device having the same attribute handles as the first device, directly using the plurality of attribute handles of the first device stored in the database cache, for using services of the second device comprises: in response to the second device having the same attribute handles as the first device, directly using the plurality of attribute handles of the first device stored in the database cache, without performing the service discovery to the second device, for using services of the second device.
3. The control method of claim 1, wherein the step of performing the service discovery to the first device to retrieve the plurality of attribute handles from the first device comprise: performing the service discovery to the first device to retrieve all the attribute handles of the first device.
4. The control method of claim 1, further comprising: in response to the second device not having the same attribute handles as the first device, performing the service discovery to the second device to retrieve a plurality of attribute handles of the second device; and storing the plurality of attribute handles of the second device into the database cache.
5. The control method of claim 1, wherein the first device and the second device are Bluetooth devices.
6. The control method of claim 5, wherein the first device and the second device are a pair of earphones.
7. The control method of claim 5, wherein the plurality of attribute handles comprise services, characteristics and descriptors of a Generic Attribute (GATT) profile.
8. A circuitry of an electronic device, configured to perform the steps of: wirelessly connecting to a first device; performing a service discovery to the first device to retrieve a plurality of attribute handles from the first device; storing the plurality of attribute handles of the first device into a database cache; wirelessly connecting to a second device; determining whether the second device and the first device have the same attribute handles; and in response to the second device having the same attribute handles as the first device, directly using the plurality of attribute handles of the first device stored in the database cache, for using services of the second device.
9. The circuitry of claim 8, wherein the step of in response to the second device having the same attribute handles as the first device, directly using the plurality of attribute handles of the first device stored in the database cache, for using services of the second device comprises: in response to the second device having the same attribute handles as the first device, directly using the plurality of attribute handles of the first device stored in the database cache, without performing the service discovery to the second device, for using services of the second device.
10. The circuitry of claim 8, wherein the step of performing the service discovery to the first device to retrieve the plurality of attribute handles from the first device comprise: performing the service discovery to the first device to retrieve all the attribute handles of the first device.
11. The circuitry of claim 8, further comprising: in response to the second device not having the same attribute handles as the first device, performing the service discovery to the second device to retrieve a plurality of attribute handles of the second device; and storing the plurality of attribute handles of the second device into the database cache.
12. The circuitry of claim 8, wherein the first device and the second device are Bluetooth devices.
13. The circuitry of claim 12, wherein the first device and the second device are a pair of earphones.
14. The circuitry of claim 12, wherein the plurality of attribute handles comprise services, characteristics and descriptors of a Generic Attribute (GATT) profile.
15. An electronic device, comprising: a wireless network module; and a storage device; wherein the wireless network module wirelessly connects to a first device, performs a service discovery to the first device to retrieve a plurality of attribute handles from the first device, and stores the plurality of attribute handles of the first device into the storage device; and the wireless network module wirelessly connects to a second device, and determines whether the second device and the first device have the same attribute handles; and in response to the second device having the same attribute handles as the first device, the wireless network module directly uses the plurality of attribute handles of the first device stored in the storage device, for using services of the second device.
16. The electronic device of claim 15, wherein in response to the second device having the same attribute handles as the first device, the wireless network module directly uses the plurality of attribute handles of the first device stored in the storage device, without performing the service discovery to the second device, for using services of the second device.
17. The electronic device of claim 15, wherein the wireless network module performs the service discovery to the first device to retrieve all the attribute handles of the first device.
18. The electronic device of claim 15, wherein in response to the second device not having the same attribute handles as the first device, the wireless network module performs the service discovery to the second device to retrieve a plurality of attribute handles of the second device, and stores the plurality of attribute handles of the second device into the storage device.
19. The electronic device of claim 15, wherein the first device and the second device are Bluetooth devices.
20. The electronic device of claim 19, wherein the first device and the second device are a pair of earphones.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0009]
[0010]
[0011]
[0012]
DETAILED DESCRIPTION
[0013] Certain terms are used throughout the following description and claims to refer to particular system components. As one skilled in the art will appreciate, manufacturers may refer to a component by different names. This document does not intend to distinguish between components that differ in name but not function. In the following discussion and in the claims, the terms “including” and “comprising” are used in an open-ended fashion, and thus should be interpreted to mean “including, but not limited to ...”. The terms “couple” and “couples” are intended to mean either an indirect or a direct electrical connection. Thus, if a first device couples to a second device, that connection may be through a direct electrical connection, or through an indirect electrical connection via other devices and connections.
[0014]
[0015] In this embodiment, the wireless network module 120 is a Bluetooth module that complies with BLE specification, and the electronic device 100 is able to use the wireless network module 120 to communicate to a first device 102_1 and a second device 102_2 shown in
[0016] The attributes are only in the GATT server, and the GATT client needs the attributes of the GATT server to have the service, so the GATT client needs to perform the service discovery to obtain all the attribute handles of the GATT server and stores the attribute handles into a database cache of the storage device 130. Then, after the service discovery is completed, the GATT client can start using the service of the GATT server, for example, sending an audio signal to the GATT server for playback, or sending a control signal to the GATT server to control its volume. In this embodiment, because the electronic device 100 needs services of the pair of earphones (i.e. the first device 102_1 and the second device 102_2), if it is determined that the first device 102_1 and the second device 102_2 have the same GATT services (i.e. all the attribute handles are the same in device 102_1 and device 102_2), the electronic device 100 can perform the service discovery to the first device 102_1 only to retrieve the attribute handles and stores the retrieved attribute handles into the database cache, then the electronic device 100 directly uses the attribute handles stored in the database cache, without performing the service discovery to the second device 102_2, for using the services of both the first device 102_1 and the second device 102_2. By using the above mechanism, latency of the electronic device 100 can be improved.
[0017]
[0018] It is noted that a number of GATT servers in the present invention is not limited to two. In other embodiments, the electronic device 100 may connect to three or more GATT servers such as many speakers or several pairs of earphones. In one embodiment, after the Step 412 or the Step 416 is completely executed, if a third device is connected to the electronic device 100, the wireless network module 120 can determine whether the third device has the same GATT services structure as the first device 102_1 and/or the second device 102_2; and if the third device has the same GATT services structure as the first device 102_1 and/or the second device 102_2, the wireless network module 120 can directly use the attribute handles of the first device 102_1 or the attribute handles of the second device 102_2 stored in the database cache, without performing the service discovery to the third device, for using the service of the third device.
[0019] Briefly summarized, in the present invention, when the GATT client needs to use the service of two or more GATT servers having the same GATT services structure, the GATT client may perform the service discovery to only one GATT server to obtain attribute handles, and directly use the attribute handles to use services of two or more GATT servers. By using the control method of the present invention, the GATT client can preserve time and power for not doing other service discovery procedures.
[0020] Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.