2012-09-13 20:37:14 +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_ipc_bluetoothservicechildprocess_h__
|
|
|
|
#define mozilla_dom_bluetooth_ipc_bluetoothservicechildprocess_h__
|
|
|
|
|
|
|
|
#include "BluetoothService.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
2012-09-26 00:13:15 +04:00
|
|
|
namespace ipc {
|
|
|
|
class UnixSocketConsumer;
|
|
|
|
}
|
2012-09-13 20:37:14 +04:00
|
|
|
namespace dom {
|
|
|
|
namespace bluetooth {
|
|
|
|
|
|
|
|
class BluetoothChild;
|
|
|
|
|
|
|
|
} // namespace bluetooth
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_BLUETOOTH_NAMESPACE
|
|
|
|
|
|
|
|
class BluetoothServiceChildProcess : public BluetoothService
|
|
|
|
{
|
|
|
|
friend class mozilla::dom::bluetooth::BluetoothChild;
|
|
|
|
|
|
|
|
public:
|
|
|
|
static BluetoothServiceChildProcess*
|
|
|
|
Create();
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
RegisterBluetoothSignalHandler(const nsAString& aNodeName,
|
|
|
|
BluetoothSignalObserver* aMsgHandler)
|
|
|
|
MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
UnregisterBluetoothSignalHandler(const nsAString& aNodeName,
|
|
|
|
BluetoothSignalObserver* aMsgHandler)
|
|
|
|
MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual nsresult
|
|
|
|
GetDefaultAdapterPathInternal(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual nsresult
|
|
|
|
GetPairedDevicePropertiesInternal(const nsTArray<nsString>& aDeviceAddresses,
|
|
|
|
BluetoothReplyRunnable* aRunnable)
|
|
|
|
MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual nsresult
|
2013-09-06 15:19:46 +04:00
|
|
|
GetConnectedDevicePropertiesInternal(uint16_t aServiceUuid,
|
2013-04-26 14:48:21 +04:00
|
|
|
BluetoothReplyRunnable* aRunnable)
|
|
|
|
MOZ_OVERRIDE;
|
|
|
|
virtual nsresult
|
2013-03-15 11:15:47 +04:00
|
|
|
StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
2012-09-13 20:37:14 +04:00
|
|
|
|
|
|
|
virtual nsresult
|
2013-03-15 11:15:47 +04:00
|
|
|
StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
2012-09-13 20:37:14 +04:00
|
|
|
|
|
|
|
virtual nsresult
|
|
|
|
SetProperty(BluetoothObjectType aType,
|
|
|
|
const BluetoothNamedValue& aValue,
|
|
|
|
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual nsresult
|
2013-03-15 11:15:47 +04:00
|
|
|
CreatePairedDeviceInternal(const nsAString& aAddress,
|
2012-09-13 20:37:14 +04:00
|
|
|
int aTimeout,
|
|
|
|
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual nsresult
|
2013-03-15 11:15:47 +04:00
|
|
|
RemoveDeviceInternal(const nsAString& aObjectPath,
|
2012-09-13 20:37:14 +04:00
|
|
|
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual nsresult
|
2013-05-22 15:08:17 +04:00
|
|
|
GetServiceChannel(const nsAString& aDeviceAddress,
|
2013-05-10 10:39:12 +04:00
|
|
|
const nsAString& aServiceUuid,
|
|
|
|
BluetoothProfileManagerBase* aManager) MOZ_OVERRIDE;
|
2012-09-13 20:37:14 +04:00
|
|
|
|
2013-05-22 15:08:17 +04:00
|
|
|
virtual bool
|
|
|
|
UpdateSdpRecords(const nsAString& aDeviceAddress,
|
|
|
|
BluetoothProfileManagerBase* aManager) MOZ_OVERRIDE;
|
|
|
|
|
2012-09-13 20:37:14 +04:00
|
|
|
virtual bool
|
|
|
|
SetPinCodeInternal(const nsAString& aDeviceAddress,
|
2012-09-20 03:37:49 +04:00
|
|
|
const nsAString& aPinCode,
|
|
|
|
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
2012-09-13 20:37:14 +04:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
SetPasskeyInternal(const nsAString& aDeviceAddress,
|
2012-09-20 03:37:49 +04:00
|
|
|
uint32_t aPasskey,
|
|
|
|
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
2012-09-13 20:37:14 +04:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
SetPairingConfirmationInternal(const nsAString& aDeviceAddress,
|
2012-09-20 03:37:49 +04:00
|
|
|
bool aConfirm,
|
|
|
|
BluetoothReplyRunnable* aRunnable)
|
2012-09-26 00:13:15 +04:00
|
|
|
MOZ_OVERRIDE;
|
2012-09-13 20:37:14 +04:00
|
|
|
|
2012-11-16 14:46:08 +04:00
|
|
|
virtual void
|
2012-10-05 14:48:05 +04:00
|
|
|
Connect(const nsAString& aDeviceAddress,
|
2013-09-06 15:19:46 +04:00
|
|
|
uint32_t aCod,
|
|
|
|
uint16_t aServiceUuid,
|
2012-10-05 14:48:05 +04:00
|
|
|
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
2012-09-29 14:26:46 +04:00
|
|
|
|
|
|
|
virtual void
|
2013-09-06 15:19:46 +04:00
|
|
|
Disconnect(const nsAString& aDeviceAddress,
|
|
|
|
uint16_t aServiceUuid,
|
2012-10-05 14:48:05 +04:00
|
|
|
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
2012-09-29 14:26:46 +04:00
|
|
|
|
2012-11-07 22:12:41 +04:00
|
|
|
virtual bool
|
2013-09-06 15:19:46 +04:00
|
|
|
IsConnected(uint16_t aServiceUuid) MOZ_OVERRIDE;
|
2012-11-07 22:12:41 +04:00
|
|
|
|
2012-11-03 05:36:43 +04:00
|
|
|
virtual void
|
2012-09-28 14:59:12 +04:00
|
|
|
SendFile(const nsAString& aDeviceAddress,
|
|
|
|
BlobParent* aBlobParent,
|
|
|
|
BlobChild* aBlobChild,
|
|
|
|
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
|
|
|
|
2014-02-11 06:07:23 +04:00
|
|
|
virtual void
|
|
|
|
SendFile(const nsAString& aDeviceAddress,
|
|
|
|
nsIDOMBlob* aBlob,
|
|
|
|
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
|
|
|
|
2012-11-03 05:36:43 +04:00
|
|
|
virtual void
|
2012-10-03 11:09:27 +04:00
|
|
|
StopSendingFile(const nsAString& aDeviceAddress,
|
|
|
|
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
|
|
|
|
2012-10-19 10:16:13 +04:00
|
|
|
virtual void
|
|
|
|
ConfirmReceivingFile(const nsAString& aDeviceAddress,
|
|
|
|
bool aConfirm,
|
|
|
|
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
2013-05-10 14:58:59 +04:00
|
|
|
|
|
|
|
virtual void
|
|
|
|
ConnectSco(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
DisconnectSco(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
IsScoConnected(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
2013-06-08 19:25:18 +04:00
|
|
|
|
2013-10-29 12:12:46 +04:00
|
|
|
#ifdef MOZ_B2G_RIL
|
2013-10-16 06:38:13 +04:00
|
|
|
virtual void
|
|
|
|
AnswerWaitingCall(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
IgnoreWaitingCall(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
ToggleCalls(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
2013-10-29 12:12:46 +04:00
|
|
|
#endif
|
2013-10-16 06:38:13 +04:00
|
|
|
|
2013-07-29 13:32:34 +04:00
|
|
|
virtual void
|
|
|
|
SendMetaData(const nsAString& aTitle,
|
|
|
|
const nsAString& aArtist,
|
|
|
|
const nsAString& aAlbum,
|
2013-07-29 13:32:35 +04:00
|
|
|
int64_t aMediaNumber,
|
|
|
|
int64_t aTotalMediaCount,
|
|
|
|
int64_t aDuration,
|
2013-07-29 13:32:34 +04:00
|
|
|
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void
|
2013-07-29 13:32:35 +04:00
|
|
|
SendPlayStatus(int64_t aDuration,
|
|
|
|
int64_t aPosition,
|
2013-07-29 13:32:34 +04:00
|
|
|
const nsAString& aPlayStatus,
|
|
|
|
BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
|
|
|
|
|
2013-07-29 13:32:34 +04:00
|
|
|
virtual void
|
|
|
|
UpdatePlayStatus(uint32_t aDuration,
|
|
|
|
uint32_t aPosition,
|
|
|
|
ControlPlayStatus aPlayStatus) MOZ_OVERRIDE;
|
|
|
|
|
2013-06-08 19:25:18 +04:00
|
|
|
virtual nsresult
|
|
|
|
SendSinkMessage(const nsAString& aDeviceAddresses,
|
|
|
|
const nsAString& aMessage) MOZ_OVERRIDE;
|
2013-05-10 14:58:59 +04:00
|
|
|
|
2013-08-12 13:32:25 +04:00
|
|
|
virtual nsresult
|
|
|
|
SendInputMessage(const nsAString& aDeviceAddresses,
|
2013-09-06 15:20:27 +04:00
|
|
|
const nsAString& aMessage) MOZ_OVERRIDE;
|
2013-08-12 13:32:25 +04:00
|
|
|
|
2012-09-13 20:37:14 +04:00
|
|
|
protected:
|
|
|
|
BluetoothServiceChildProcess();
|
|
|
|
virtual ~BluetoothServiceChildProcess();
|
|
|
|
|
|
|
|
void
|
|
|
|
NoteDeadActor();
|
|
|
|
|
|
|
|
void
|
|
|
|
NoteShutdownInitiated();
|
|
|
|
|
|
|
|
virtual nsresult
|
|
|
|
HandleStartup() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual nsresult
|
|
|
|
HandleShutdown() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// This method should never be called.
|
|
|
|
virtual nsresult
|
|
|
|
StartInternal() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
// This method should never be called.
|
|
|
|
virtual nsresult
|
|
|
|
StopInternal() MOZ_OVERRIDE;
|
2012-09-20 03:37:49 +04:00
|
|
|
|
2013-04-19 12:40:56 +04:00
|
|
|
bool
|
|
|
|
IsSignalRegistered(const nsAString& aNodeName) {
|
|
|
|
return !!mBluetoothSignalObserverTable.Get(aNodeName);
|
|
|
|
}
|
2012-09-13 20:37:14 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
END_BLUETOOTH_NAMESPACE
|
|
|
|
|
|
|
|
#endif // mozilla_dom_bluetooth_ipc_bluetoothservicechildprocess_h__
|