2012-08-01 08:53:04 +04:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
|
2012-08-17 06:53:45 +04:00
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
2012-08-01 08:53:04 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_bluetooth_bluetoothutils_h__
|
|
|
|
#define mozilla_dom_bluetooth_bluetoothutils_h__
|
|
|
|
|
|
|
|
#include "BluetoothCommon.h"
|
2013-08-28 06:59:14 +04:00
|
|
|
#include "js/TypeDecls.h"
|
2012-08-01 08:53:04 +04:00
|
|
|
|
|
|
|
BEGIN_BLUETOOTH_NAMESPACE
|
|
|
|
|
2012-10-01 11:44:48 +04:00
|
|
|
class BluetoothNamedValue;
|
2012-11-19 11:10:38 +04:00
|
|
|
class BluetoothValue;
|
|
|
|
class BluetoothReplyRunnable;
|
2012-08-17 06:53:45 +04:00
|
|
|
|
2012-10-01 11:44:48 +04:00
|
|
|
bool
|
|
|
|
SetJsObject(JSContext* aContext,
|
2013-01-29 10:52:39 +04:00
|
|
|
const BluetoothValue& aValue,
|
2013-07-25 16:57:00 +04:00
|
|
|
JS::Handle<JSObject*> aObj);
|
2012-10-01 11:44:48 +04:00
|
|
|
|
|
|
|
nsString
|
|
|
|
GetObjectPathFromAddress(const nsAString& aAdapterPath,
|
|
|
|
const nsAString& aDeviceAddress);
|
|
|
|
|
|
|
|
nsString
|
|
|
|
GetAddressFromObjectPath(const nsAString& aObjectPath);
|
|
|
|
|
2012-10-03 13:06:40 +04:00
|
|
|
bool
|
|
|
|
BroadcastSystemMessage(const nsAString& aType,
|
|
|
|
const InfallibleTArray<BluetoothNamedValue>& aData);
|
|
|
|
|
2012-11-19 11:10:38 +04:00
|
|
|
void
|
|
|
|
DispatchBluetoothReply(BluetoothReplyRunnable* aRunnable,
|
|
|
|
const BluetoothValue& aValue,
|
|
|
|
const nsAString& aErrorStr);
|
|
|
|
|
2012-12-17 19:24:35 +04:00
|
|
|
void
|
|
|
|
ParseAtCommand(const nsACString& aAtCommand, const int aStart,
|
|
|
|
nsTArray<nsCString>& aRetValues);
|
|
|
|
|
2013-08-02 14:32:57 +04:00
|
|
|
void
|
|
|
|
DispatchStatusChangedEvent(const nsAString& aType,
|
|
|
|
const nsAString& aDeviceAddress,
|
|
|
|
bool aStatus);
|
|
|
|
|
2012-08-01 08:53:04 +04:00
|
|
|
END_BLUETOOTH_NAMESPACE
|
|
|
|
|
|
|
|
#endif
|