OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // The <code>chrome.bluetoothLowEnergy</code> API is used to communicate with | 5 // The <code>chrome.bluetoothLowEnergy</code> API is used to communicate with |
6 // Bluetooth Smart (Low Energy) devices using the | 6 // Bluetooth Smart (Low Energy) devices using the |
7 // <a href="https://developer.bluetooth.org/TechnologyOverview/Pages/GATT.aspx"> | 7 // <a href="https://developer.bluetooth.org/TechnologyOverview/Pages/GATT.aspx"> |
8 // Generic Attribute Profile (GATT)</a>. | 8 // Generic Attribute Profile (GATT)</a>. |
9 namespace bluetoothLowEnergy { | 9 namespace bluetoothLowEnergy { |
10 // Values representing the possible properties of a characteristic. | 10 // Values representing the possible properties of a characteristic. |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
457 | 457 |
458 // Unregisters an advertisement and stops its advertising. If the | 458 // Unregisters an advertisement and stops its advertising. If the |
459 // advertisement fails to unregister the only way to stop advertising | 459 // advertisement fails to unregister the only way to stop advertising |
460 // might be to restart the device. | 460 // might be to restart the device. |
461 // |advertisementId|: Id of the advertisement to unregister. | 461 // |advertisementId|: Id of the advertisement to unregister. |
462 // |callback|: Called once the advertisement is unregistered and is no | 462 // |callback|: Called once the advertisement is unregistered and is no |
463 // longer being advertised. | 463 // longer being advertised. |
464 static void unregisterAdvertisement(long advertisementId, | 464 static void unregisterAdvertisement(long advertisementId, |
465 ResultCallback callback); | 465 ResultCallback callback); |
466 | 466 |
467 // Set's the interval betweeen two consecutive advertisements. Note: | |
468 // This is a best effort. The actual interval may vary non-trivially | |
469 // from the specified intervals. On some hardware, we will not even | |
Devlin
2016/09/21 17:07:03
s/we will not even attempt to have a minimum inter
Rahul Chaturvedi
2016/09/21 18:54:12
Done.
| |
470 // attempt to have a minimum interval under 100ms. | |
471 // |minInterval|: Minimum interval between advertisments (in | |
472 // milliseconds). This cannot be lower than 20ms. | |
473 // |maxInterval|: Maximum interval between advertisments (in | |
474 // milliseconds). This cannot be more than 10240ms. | |
Devlin
2016/09/21 17:07:03
Out of curiosity, why 10240?
Rahul Chaturvedi
2016/09/21 18:54:12
These are limits required by the spec. Added a lin
| |
475 // |callback|: Called once the interval has been set. | |
476 static void setAdvertisingInterval(long minInterval, long maxInterval, | |
477 ResultCallback callback); | |
478 | |
467 // Sends a response for a characteristic or descriptor read/write | 479 // Sends a response for a characteristic or descriptor read/write |
468 // request. | 480 // request. |
469 // This function is only available if the app has both the | 481 // This function is only available if the app has both the |
470 // bluetooth:low_energy and the bluetooth:peripheral permissions set to | 482 // bluetooth:low_energy and the bluetooth:peripheral permissions set to |
471 // true. The peripheral permission may not be available to all apps. | 483 // true. The peripheral permission may not be available to all apps. |
472 // |response|: The response to the request. | 484 // |response|: The response to the request. |
473 static void sendRequestResponse(Response response); | 485 static void sendRequestResponse(Response response); |
474 }; | 486 }; |
475 | 487 |
476 interface Events { | 488 interface Events { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
543 // this request for a long time may lead to a disconnection. | 555 // this request for a long time may lead to a disconnection. |
544 // This event is only available if the app has both the | 556 // This event is only available if the app has both the |
545 // bluetooth:low_energy and the bluetooth:peripheral permissions set to | 557 // bluetooth:low_energy and the bluetooth:peripheral permissions set to |
546 // true. The peripheral permission may not be available to all apps. | 558 // true. The peripheral permission may not be available to all apps. |
547 // |request|: Request data for this request. | 559 // |request|: Request data for this request. |
548 // |descriptor|: The GATT descriptor whose value is being written. | 560 // |descriptor|: The GATT descriptor whose value is being written. |
549 static void onDescriptorWriteRequest( | 561 static void onDescriptorWriteRequest( |
550 Request request, DOMString descriptorId); | 562 Request request, DOMString descriptorId); |
551 }; | 563 }; |
552 }; | 564 }; |
OLD | NEW |