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/. */
7 #ifndef mozilla_dom_bluetooth_bluetoothutils_h__
8 #define mozilla_dom_bluetooth_bluetoothutils_h__
10 #include "BluetoothCommon.h"
11 #include "js/TypeDecls.h"
13 BEGIN_BLUETOOTH_NAMESPACE
15 class BluetoothNamedValue
;
17 class BluetoothReplyRunnable
;
20 SetJsObject(JSContext
* aContext
,
21 const BluetoothValue
& aValue
,
22 JS::Handle
<JSObject
*> aObj
);
25 GetObjectPathFromAddress(const nsAString
& aAdapterPath
,
26 const nsAString
& aDeviceAddress
);
29 GetAddressFromObjectPath(const nsAString
& aObjectPath
);
32 BroadcastSystemMessage(const nsAString
& aType
,
33 const InfallibleTArray
<BluetoothNamedValue
>& aData
);
36 DispatchBluetoothReply(BluetoothReplyRunnable
* aRunnable
,
37 const BluetoothValue
& aValue
,
38 const nsAString
& aErrorStr
);
41 ParseAtCommand(const nsACString
& aAtCommand
, const int aStart
,
42 nsTArray
<nsCString
>& aRetValues
);
45 DispatchStatusChangedEvent(const nsAString
& aType
,
46 const nsAString
& aDeviceAddress
,
49 END_BLUETOOTH_NAMESPACE