2012-09-29 02:39:05 -07:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
|
|
|
/* 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_bluetoothscomanager_h__
|
|
|
|
#define mozilla_dom_bluetooth_bluetoothscomanager_h__
|
|
|
|
|
|
|
|
#include "BluetoothCommon.h"
|
|
|
|
#include "mozilla/ipc/UnixSocket.h"
|
2012-10-02 20:27:36 -07:00
|
|
|
#include "nsIObserver.h"
|
2012-09-29 02:39:05 -07:00
|
|
|
|
|
|
|
BEGIN_BLUETOOTH_NAMESPACE
|
|
|
|
|
|
|
|
class BluetoothReplyRunnable;
|
2012-10-05 17:11:24 -07:00
|
|
|
class BluetoothScoManagerObserver;
|
2012-09-29 02:39:05 -07:00
|
|
|
|
|
|
|
class BluetoothScoManager : public mozilla::ipc::UnixSocketConsumer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
~BluetoothScoManager();
|
|
|
|
|
|
|
|
static BluetoothScoManager* Get();
|
2013-02-01 04:28:15 -08:00
|
|
|
void ReceiveSocketData(nsAutoPtr<mozilla::ipc::UnixSocketRawData>& aMessage)
|
2012-10-10 22:49:11 -07:00
|
|
|
MOZ_OVERRIDE;
|
2012-09-29 02:39:05 -07:00
|
|
|
|
|
|
|
bool Connect(const nsAString& aDeviceObjectPath);
|
|
|
|
void Disconnect();
|
2012-10-26 02:48:47 -07:00
|
|
|
bool Listen();
|
2012-09-29 02:39:05 -07:00
|
|
|
|
|
|
|
private:
|
2012-10-05 17:11:24 -07:00
|
|
|
friend class BluetoothScoManagerObserver;
|
2012-09-29 02:39:05 -07:00
|
|
|
BluetoothScoManager();
|
2012-10-02 20:27:36 -07:00
|
|
|
bool Init();
|
|
|
|
void Cleanup();
|
|
|
|
nsresult HandleShutdown();
|
2012-10-22 03:34:15 -07:00
|
|
|
void NotifyAudioManager(const nsAString& aAddress);
|
2012-10-10 22:49:11 -07:00
|
|
|
virtual void OnConnectSuccess() MOZ_OVERRIDE;
|
|
|
|
virtual void OnConnectError() MOZ_OVERRIDE;
|
2012-10-12 11:38:14 -07:00
|
|
|
virtual void OnDisconnect() MOZ_OVERRIDE;
|
2012-10-26 02:48:47 -07:00
|
|
|
|
|
|
|
int mSocketStatus;
|
2012-09-29 02:39:05 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
END_BLUETOOTH_NAMESPACE
|
|
|
|
|
|
|
|
#endif
|