2012-09-29 13:39:05 +04: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-03 07:27:36 +04:00
|
|
|
#include "nsIObserver.h"
|
2012-09-29 13:39:05 +04:00
|
|
|
|
|
|
|
BEGIN_BLUETOOTH_NAMESPACE
|
|
|
|
|
|
|
|
class BluetoothReplyRunnable;
|
2012-10-06 04:11:24 +04:00
|
|
|
class BluetoothScoManagerObserver;
|
2012-09-29 13:39:05 +04:00
|
|
|
|
|
|
|
class BluetoothScoManager : public mozilla::ipc::UnixSocketConsumer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
~BluetoothScoManager();
|
|
|
|
|
|
|
|
static BluetoothScoManager* Get();
|
2012-10-11 09:49:11 +04:00
|
|
|
void ReceiveSocketData(mozilla::ipc::UnixSocketRawData* aMessage)
|
|
|
|
MOZ_OVERRIDE;
|
2012-09-29 13:39:05 +04:00
|
|
|
|
|
|
|
bool Connect(const nsAString& aDeviceObjectPath);
|
|
|
|
void Disconnect();
|
2012-10-26 13:48:47 +04:00
|
|
|
bool Listen();
|
2012-09-29 13:39:05 +04:00
|
|
|
|
|
|
|
private:
|
2012-10-06 04:11:24 +04:00
|
|
|
friend class BluetoothScoManagerObserver;
|
2012-09-29 13:39:05 +04:00
|
|
|
BluetoothScoManager();
|
2012-10-03 07:27:36 +04:00
|
|
|
bool Init();
|
|
|
|
void Cleanup();
|
|
|
|
nsresult HandleShutdown();
|
2012-10-22 14:34:15 +04:00
|
|
|
void NotifyAudioManager(const nsAString& aAddress);
|
2012-10-11 09:49:11 +04:00
|
|
|
virtual void OnConnectSuccess() MOZ_OVERRIDE;
|
|
|
|
virtual void OnConnectError() MOZ_OVERRIDE;
|
2012-10-12 22:38:14 +04:00
|
|
|
virtual void OnDisconnect() MOZ_OVERRIDE;
|
2012-10-26 13:48:47 +04:00
|
|
|
|
|
|
|
int mSocketStatus;
|
2012-09-29 13:39:05 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
END_BLUETOOTH_NAMESPACE
|
|
|
|
|
|
|
|
#endif
|