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 // Resets advertising on the current device. This will unregister all |
| 468 // existing advertisements and will stop advertising them. |
| 469 // |callback|: Called once the advertisements are reset. |
| 470 static void resetAdvertising(ResultCallback callback); |
| 471 |
467 // Set's the interval betweeen two consecutive advertisements. Note: | 472 // Set's the interval betweeen two consecutive advertisements. Note: |
468 // This is a best effort. The actual interval may vary non-trivially | 473 // This is a best effort. The actual interval may vary non-trivially |
469 // from the requested intervals. On some hardware, there is a minimum | 474 // from the requested intervals. On some hardware, there is a minimum |
470 // interval of 100ms. The minimum and maximum values cannot exceed the | 475 // interval of 100ms. The minimum and maximum values cannot exceed the |
471 // the range allowed by the Bluetooth 4.2 specification. | 476 // the range allowed by the Bluetooth 4.2 specification. |
472 // |minInterval|: Minimum interval between advertisments (in | 477 // |minInterval|: Minimum interval between advertisments (in |
473 // milliseconds). This cannot be lower than 20ms (as per the spec). | 478 // milliseconds). This cannot be lower than 20ms (as per the spec). |
474 // |maxInterval|: Maximum interval between advertisments (in | 479 // |maxInterval|: Maximum interval between advertisments (in |
475 // milliseconds). This cannot be more than 10240ms (as per the spec). | 480 // milliseconds). This cannot be more than 10240ms (as per the spec). |
476 // |callback|: Called once the interval has been set. | 481 // |callback|: Called once the interval has been set. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 // this request for a long time may lead to a disconnection. | 561 // this request for a long time may lead to a disconnection. |
557 // This event is only available if the app has both the | 562 // This event is only available if the app has both the |
558 // bluetooth:low_energy and the bluetooth:peripheral permissions set to | 563 // bluetooth:low_energy and the bluetooth:peripheral permissions set to |
559 // true. The peripheral permission may not be available to all apps. | 564 // true. The peripheral permission may not be available to all apps. |
560 // |request|: Request data for this request. | 565 // |request|: Request data for this request. |
561 // |descriptor|: The GATT descriptor whose value is being written. | 566 // |descriptor|: The GATT descriptor whose value is being written. |
562 static void onDescriptorWriteRequest( | 567 static void onDescriptorWriteRequest( |
563 Request request, DOMString descriptorId); | 568 Request request, DOMString descriptorId); |
564 }; | 569 }; |
565 }; | 570 }; |
OLD | NEW |