gecko/dom/bluetooth2/ipc/PBluetooth.ipdl
Jocelyn Liu 4af9c98d9d Bug 1009347 - Patch 1/4: Make copy of dom/bluetooth for API refinement, f=btian, r=echou
--HG--
rename : dom/bluetooth/BluetoothAdapter.cpp => dom/bluetooth2/BluetoothAdapter.cpp
rename : dom/bluetooth/BluetoothAdapter.h => dom/bluetooth2/BluetoothAdapter.h
rename : dom/bluetooth/BluetoothCommon.h => dom/bluetooth2/BluetoothCommon.h
rename : dom/bluetooth/BluetoothDevice.cpp => dom/bluetooth2/BluetoothDevice.cpp
rename : dom/bluetooth/BluetoothDevice.h => dom/bluetooth2/BluetoothDevice.h
rename : dom/bluetooth/BluetoothHfpManagerBase.h => dom/bluetooth2/BluetoothHfpManagerBase.h
rename : dom/bluetooth/BluetoothHidManager.cpp => dom/bluetooth2/BluetoothHidManager.cpp
rename : dom/bluetooth/BluetoothHidManager.h => dom/bluetooth2/BluetoothHidManager.h
rename : dom/bluetooth/BluetoothManager.cpp => dom/bluetooth2/BluetoothManager.cpp
rename : dom/bluetooth/BluetoothManager.h => dom/bluetooth2/BluetoothManager.h
rename : dom/bluetooth/BluetoothProfileController.cpp => dom/bluetooth2/BluetoothProfileController.cpp
rename : dom/bluetooth/BluetoothProfileController.h => dom/bluetooth2/BluetoothProfileController.h
rename : dom/bluetooth/BluetoothProfileManagerBase.h => dom/bluetooth2/BluetoothProfileManagerBase.h
rename : dom/bluetooth/BluetoothPropertyContainer.cpp => dom/bluetooth2/BluetoothPropertyContainer.cpp
rename : dom/bluetooth/BluetoothPropertyContainer.h => dom/bluetooth2/BluetoothPropertyContainer.h
rename : dom/bluetooth/BluetoothReplyRunnable.cpp => dom/bluetooth2/BluetoothReplyRunnable.cpp
rename : dom/bluetooth/BluetoothReplyRunnable.h => dom/bluetooth2/BluetoothReplyRunnable.h
rename : dom/bluetooth/BluetoothRilListener.cpp => dom/bluetooth2/BluetoothRilListener.cpp
rename : dom/bluetooth/BluetoothRilListener.h => dom/bluetooth2/BluetoothRilListener.h
rename : dom/bluetooth/BluetoothService.cpp => dom/bluetooth2/BluetoothService.cpp
rename : dom/bluetooth/BluetoothService.h => dom/bluetooth2/BluetoothService.h
rename : dom/bluetooth/BluetoothSocketObserver.h => dom/bluetooth2/BluetoothSocketObserver.h
rename : dom/bluetooth/BluetoothUuid.cpp => dom/bluetooth2/BluetoothUuid.cpp
rename : dom/bluetooth/BluetoothUuid.h => dom/bluetooth2/BluetoothUuid.h
rename : dom/bluetooth/Makefile.in => dom/bluetooth2/Makefile.in
rename : dom/bluetooth/ObexBase.cpp => dom/bluetooth2/ObexBase.cpp
rename : dom/bluetooth/ObexBase.h => dom/bluetooth2/ObexBase.h
rename : dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp => dom/bluetooth2/bluedroid/BluetoothA2dpManager.cpp
rename : dom/bluetooth/bluedroid/BluetoothA2dpManager.h => dom/bluetooth2/bluedroid/BluetoothA2dpManager.h
rename : dom/bluetooth/bluedroid/BluetoothOppManager.cpp => dom/bluetooth2/bluedroid/BluetoothOppManager.cpp
rename : dom/bluetooth/bluedroid/BluetoothOppManager.h => dom/bluetooth2/bluedroid/BluetoothOppManager.h
rename : dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp => dom/bluetooth2/bluedroid/BluetoothServiceBluedroid.cpp
rename : dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h => dom/bluetooth2/bluedroid/BluetoothServiceBluedroid.h
rename : dom/bluetooth/bluedroid/BluetoothSocket.cpp => dom/bluetooth2/bluedroid/BluetoothSocket.cpp
rename : dom/bluetooth/bluedroid/BluetoothSocket.h => dom/bluetooth2/bluedroid/BluetoothSocket.h
rename : dom/bluetooth/bluedroid/BluetoothUtils.cpp => dom/bluetooth2/bluedroid/BluetoothUtils.cpp
rename : dom/bluetooth/bluedroid/BluetoothUtils.h => dom/bluetooth2/bluedroid/BluetoothUtils.h
rename : dom/bluetooth/bluedroid/b2g_bdroid_buildcfg.h => dom/bluetooth2/bluedroid/b2g_bdroid_buildcfg.h
rename : dom/bluetooth/bluedroid/hfp-fallback/BluetoothHfpManager.cpp => dom/bluetooth2/bluedroid/hfp-fallback/BluetoothHfpManager.cpp
rename : dom/bluetooth/bluedroid/hfp-fallback/BluetoothHfpManager.h => dom/bluetooth2/bluedroid/hfp-fallback/BluetoothHfpManager.h
rename : dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp => dom/bluetooth2/bluedroid/hfp/BluetoothHfpManager.cpp
rename : dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.h => dom/bluetooth2/bluedroid/hfp/BluetoothHfpManager.h
rename : dom/bluetooth/bluez/BluetoothA2dpManager.cpp => dom/bluetooth2/bluez/BluetoothA2dpManager.cpp
rename : dom/bluetooth/bluez/BluetoothA2dpManager.h => dom/bluetooth2/bluez/BluetoothA2dpManager.h
rename : dom/bluetooth/bluez/BluetoothDBusService.cpp => dom/bluetooth2/bluez/BluetoothDBusService.cpp
rename : dom/bluetooth/bluez/BluetoothDBusService.h => dom/bluetooth2/bluez/BluetoothDBusService.h
rename : dom/bluetooth/bluez/BluetoothHfpManager.cpp => dom/bluetooth2/bluez/BluetoothHfpManager.cpp
rename : dom/bluetooth/bluez/BluetoothHfpManager.h => dom/bluetooth2/bluez/BluetoothHfpManager.h
rename : dom/bluetooth/bluez/BluetoothOppManager.cpp => dom/bluetooth2/bluez/BluetoothOppManager.cpp
rename : dom/bluetooth/bluez/BluetoothOppManager.h => dom/bluetooth2/bluez/BluetoothOppManager.h
rename : dom/bluetooth/bluez/BluetoothSocket.cpp => dom/bluetooth2/bluez/BluetoothSocket.cpp
rename : dom/bluetooth/bluez/BluetoothSocket.h => dom/bluetooth2/bluez/BluetoothSocket.h
rename : dom/bluetooth/bluez/BluetoothUnixSocketConnector.cpp => dom/bluetooth2/bluez/BluetoothUnixSocketConnector.cpp
rename : dom/bluetooth/bluez/BluetoothUnixSocketConnector.h => dom/bluetooth2/bluez/BluetoothUnixSocketConnector.h
rename : dom/bluetooth/bluez/BluetoothUtils.cpp => dom/bluetooth2/bluez/BluetoothUtils.cpp
rename : dom/bluetooth/bluez/BluetoothUtils.h => dom/bluetooth2/bluez/BluetoothUtils.h
rename : dom/bluetooth/ipc/BluetoothChild.cpp => dom/bluetooth2/ipc/BluetoothChild.cpp
rename : dom/bluetooth/ipc/BluetoothChild.h => dom/bluetooth2/ipc/BluetoothChild.h
rename : dom/bluetooth/ipc/BluetoothMessageUtils.h => dom/bluetooth2/ipc/BluetoothMessageUtils.h
rename : dom/bluetooth/ipc/BluetoothParent.cpp => dom/bluetooth2/ipc/BluetoothParent.cpp
rename : dom/bluetooth/ipc/BluetoothParent.h => dom/bluetooth2/ipc/BluetoothParent.h
rename : dom/bluetooth/ipc/BluetoothServiceChildProcess.cpp => dom/bluetooth2/ipc/BluetoothServiceChildProcess.cpp
rename : dom/bluetooth/ipc/BluetoothServiceChildProcess.h => dom/bluetooth2/ipc/BluetoothServiceChildProcess.h
rename : dom/bluetooth/ipc/BluetoothTypes.ipdlh => dom/bluetooth2/ipc/BluetoothTypes.ipdlh
rename : dom/bluetooth/ipc/PBluetooth.ipdl => dom/bluetooth2/ipc/PBluetooth.ipdl
rename : dom/bluetooth/ipc/PBluetoothRequest.ipdl => dom/bluetooth2/ipc/PBluetoothRequest.ipdl
rename : dom/bluetooth/moz.build => dom/bluetooth2/moz.build
rename : dom/bluetooth/tests/marionette/head.js => dom/bluetooth2/tests/marionette/head.js
rename : dom/bluetooth/tests/marionette/manifest.ini => dom/bluetooth2/tests/marionette/manifest.ini
rename : dom/bluetooth/tests/marionette/test_dom_BluetoothAdapter_discovery.js => dom/bluetooth2/tests/marionette/test_dom_BluetoothAdapter_discovery.js
rename : dom/bluetooth/tests/marionette/test_dom_BluetoothAdapter_getters.js => dom/bluetooth2/tests/marionette/test_dom_BluetoothAdapter_getters.js
rename : dom/bluetooth/tests/marionette/test_dom_BluetoothAdapter_setters.js => dom/bluetooth2/tests/marionette/test_dom_BluetoothAdapter_setters.js
rename : dom/bluetooth/tests/marionette/test_dom_BluetoothManager_adapteradded.js => dom/bluetooth2/tests/marionette/test_dom_BluetoothManager_adapteradded.js
rename : dom/bluetooth/tests/marionette/test_dom_BluetoothManager_enabled.js => dom/bluetooth2/tests/marionette/test_dom_BluetoothManager_enabled.js
2014-05-21 14:11:31 +08:00

296 lines
5.4 KiB
Plaintext

/* -*- 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/. */
include protocol PBlob;
include protocol PBluetoothRequest;
include protocol PContent;
include BluetoothTypes;
include "mozilla/dom/bluetooth/ipc/BluetoothMessageUtils.h";
using mozilla::dom::bluetooth::BluetoothObjectType from "mozilla/dom/bluetooth/BluetoothCommon.h";
namespace mozilla {
namespace dom {
namespace bluetooth {
/**
* Bluetooth request types.
*/
struct DefaultAdapterPathRequest
{ };
struct SetPropertyRequest
{
BluetoothObjectType type;
BluetoothNamedValue value;
};
struct GetPropertyRequest
{
BluetoothObjectType type;
nsString path;
};
struct StartDiscoveryRequest
{
};
struct StopDiscoveryRequest
{
};
struct PairRequest
{
nsString address;
uint32_t timeoutMS;
};
struct UnpairRequest
{
nsString address;
};
struct SetPinCodeRequest
{
nsString path;
nsString pincode;
};
struct SetPasskeyRequest
{
nsString path;
uint32_t passkey;
};
struct ConfirmPairingConfirmationRequest
{
nsString path;
};
struct DenyPairingConfirmationRequest
{
nsString path;
};
struct PairedDevicePropertiesRequest
{
nsString[] addresses;
};
struct ConnectedDevicePropertiesRequest
{
uint16_t serviceUuid;
};
struct ConnectRequest
{
nsString address;
uint32_t cod;
uint16_t serviceUuid;
};
struct DisconnectRequest
{
nsString address;
uint16_t serviceUuid;
};
struct SendFileRequest
{
nsString devicePath;
PBlob blob;
};
struct StopSendingFileRequest
{
nsString devicePath;
};
struct ConfirmReceivingFileRequest
{
nsString devicePath;
};
struct DenyReceivingFileRequest
{
nsString devicePath;
};
struct ConnectScoRequest
{
};
struct DisconnectScoRequest
{
};
struct IsScoConnectedRequest
{
};
struct AnswerWaitingCallRequest
{
};
struct IgnoreWaitingCallRequest
{
};
struct ToggleCallsRequest
{
};
struct SendMetaDataRequest
{
nsString title;
nsString artist;
nsString album;
int64_t mediaNumber;
int64_t totalMediaCount;
int64_t duration;
};
struct SendPlayStatusRequest
{
int64_t duration;
int64_t position;
nsString playStatus;
};
union Request
{
DefaultAdapterPathRequest;
SetPropertyRequest;
GetPropertyRequest;
StartDiscoveryRequest;
StopDiscoveryRequest;
PairRequest;
UnpairRequest;
SetPinCodeRequest;
SetPasskeyRequest;
ConfirmPairingConfirmationRequest;
DenyPairingConfirmationRequest;
ConnectedDevicePropertiesRequest;
PairedDevicePropertiesRequest;
ConnectRequest;
DisconnectRequest;
SendFileRequest;
StopSendingFileRequest;
ConfirmReceivingFileRequest;
DenyReceivingFileRequest;
ConnectScoRequest;
DisconnectScoRequest;
IsScoConnectedRequest;
AnswerWaitingCallRequest;
IgnoreWaitingCallRequest;
ToggleCallsRequest;
SendMetaDataRequest;
SendPlayStatusRequest;
};
protocol PBluetooth
{
manager PContent;
manages PBluetoothRequest;
/**
* The potential exists for a racy shutdown so the following sequence of
* messages is used to shutdown safely:
*
* 1. [BeginShutdown] (Parent -> Child [Optional])
* 2. StopNotifying (Child -> Parent)
* 3. NotificationsStopped (Parent -> Child)
* 4. __delete__() (Child -> Parent)
*/
child:
/**
* Sent when a settings change has enabled or disabled the bluetooth firmware.
*/
Enabled(bool enabled);
/**
* Sent when a bluetooth signal is broadcasted to child processes.
*/
Notify(BluetoothSignal signal);
/**
* Sent when the parent process is about to be shut down. See shutdown note
* above.
*/
BeginShutdown();
/**
* Sent to inform the child process that it will no longer receive any
* messages from the parent. See shutdown note above.
*/
NotificationsStopped();
parent:
/**
* Sent when the child no longer needs to use bluetooth. See shutdown note
* above.
*/
__delete__();
/**
* Sent when the child needs to receive signals related to the given node.
*/
RegisterSignalHandler(nsString node);
/**
* Sent when the child no longer needs to receive signals related to the given
* node.
*/
UnregisterSignalHandler(nsString node);
/**
* Sent when the child no longer needs to receive any messages from the
* parent. See shutdown note above.
*/
StopNotifying();
/**
* Sent when the child makes an asynchronous request to the parent.
*/
PBluetoothRequest(Request request);
/**
* FIXME: Bug 547703.
*
* This is the state machine we want:
*
* start state NOTIFYING:
* send Enabled goto NOTIFYING;
* send Notify goto NOTIFYING;
* recv RegisterSignalHandler goto NOTIFYING;
* recv UnregisterSignalHandler goto NOTIFYING;
* send BeginShutdown goto PARENT_DONE;
* recv StopNotifying goto CHILD_DONE;
*
* state PARENT_DONE:
* recv RegisterSignalHandler goto PARENT_DONE;
* recv UnregisterSignalHandler goto PARENT_DONE;
* recv StopNotifying goto CHILD_DONE;
*
* state CHILD_DONE:
* send Enabled goto CHILD_DONE;
* send Notify goto CHILD_DONE;
* send BeginShutdown goto CHILD_DONE;
* send NotificationsStopped goto DONE;
*
* state DONE:
* recv __delete__;
*/
};
} // namespace bluetooth
} // namespace dom
} // namespace mozilla