|
1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ |
|
2 /* vim: set ts=2 et sw=2 tw=80: */ |
|
3 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #ifndef mozilla_dom_bluetooth_bluetoothutils_h__ |
|
8 #define mozilla_dom_bluetooth_bluetoothutils_h__ |
|
9 |
|
10 #include "BluetoothCommon.h" |
|
11 #include "js/TypeDecls.h" |
|
12 |
|
13 BEGIN_BLUETOOTH_NAMESPACE |
|
14 |
|
15 class BluetoothNamedValue; |
|
16 class BluetoothValue; |
|
17 class BluetoothReplyRunnable; |
|
18 |
|
19 bool |
|
20 SetJsObject(JSContext* aContext, |
|
21 const BluetoothValue& aValue, |
|
22 JS::Handle<JSObject*> aObj); |
|
23 |
|
24 nsString |
|
25 GetObjectPathFromAddress(const nsAString& aAdapterPath, |
|
26 const nsAString& aDeviceAddress); |
|
27 |
|
28 nsString |
|
29 GetAddressFromObjectPath(const nsAString& aObjectPath); |
|
30 |
|
31 bool |
|
32 BroadcastSystemMessage(const nsAString& aType, |
|
33 const InfallibleTArray<BluetoothNamedValue>& aData); |
|
34 |
|
35 void |
|
36 DispatchBluetoothReply(BluetoothReplyRunnable* aRunnable, |
|
37 const BluetoothValue& aValue, |
|
38 const nsAString& aErrorStr); |
|
39 |
|
40 void |
|
41 ParseAtCommand(const nsACString& aAtCommand, const int aStart, |
|
42 nsTArray<nsCString>& aRetValues); |
|
43 |
|
44 void |
|
45 DispatchStatusChangedEvent(const nsAString& aType, |
|
46 const nsAString& aDeviceAddress, |
|
47 bool aStatus); |
|
48 |
|
49 END_BLUETOOTH_NAMESPACE |
|
50 |
|
51 #endif |