Merge inbound to m-c on a CLOSED TREE.
[gecko.git] / dom / bluetooth / BluetoothUtils.h
blob2156207f1d4f85a9f943dcf48ca5abde19ed9ae7
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;
16 class BluetoothValue;
17 class BluetoothReplyRunnable;
19 bool
20 SetJsObject(JSContext* aContext,
21 const BluetoothValue& aValue,
22 JS::Handle<JSObject*> aObj);
24 nsString
25 GetObjectPathFromAddress(const nsAString& aAdapterPath,
26 const nsAString& aDeviceAddress);
28 nsString
29 GetAddressFromObjectPath(const nsAString& aObjectPath);
31 bool
32 BroadcastSystemMessage(const nsAString& aType,
33 const InfallibleTArray<BluetoothNamedValue>& aData);
35 void
36 DispatchBluetoothReply(BluetoothReplyRunnable* aRunnable,
37 const BluetoothValue& aValue,
38 const nsAString& aErrorStr);
40 void
41 ParseAtCommand(const nsACString& aAtCommand, const int aStart,
42 nsTArray<nsCString>& aRetValues);
44 void
45 DispatchStatusChangedEvent(const nsAString& aType,
46 const nsAString& aDeviceAddress,
47 bool aStatus);
49 END_BLUETOOTH_NAMESPACE
51 #endif