1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,165 @@ 1.4 +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ 1.5 +/* vim: set ts=2 et sw=2 tw=80: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.8 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef mozilla_dom_bluetooth_bluetoothservicebluedroid_h__ 1.11 +#define mozilla_dom_bluetooth_bluetoothservicebluedroid_h__ 1.12 + 1.13 +#include <hardware/bluetooth.h> 1.14 + 1.15 +#include "BluetoothCommon.h" 1.16 +#include "BluetoothService.h" 1.17 + 1.18 +BEGIN_BLUETOOTH_NAMESPACE 1.19 + 1.20 +class BluetoothServiceBluedroid : public BluetoothService 1.21 +{ 1.22 +public: 1.23 + static const bt_interface_t* GetBluetoothInterface(); 1.24 + 1.25 + BluetoothServiceBluedroid(); 1.26 + ~BluetoothServiceBluedroid(); 1.27 + 1.28 + virtual nsresult StartInternal(); 1.29 + virtual nsresult StopInternal(); 1.30 + 1.31 + virtual nsresult GetDefaultAdapterPathInternal( 1.32 + BluetoothReplyRunnable* aRunnable); 1.33 + 1.34 + virtual nsresult GetConnectedDevicePropertiesInternal(uint16_t aProfileId, 1.35 + BluetoothReplyRunnable* aRunnable); 1.36 + 1.37 + virtual nsresult GetPairedDevicePropertiesInternal( 1.38 + const nsTArray<nsString>& aDeviceAddress, 1.39 + BluetoothReplyRunnable* aRunnable); 1.40 + 1.41 + virtual nsresult StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable); 1.42 + virtual nsresult StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable); 1.43 + 1.44 + virtual nsresult 1.45 + SetProperty(BluetoothObjectType aType, 1.46 + const BluetoothNamedValue& aValue, 1.47 + BluetoothReplyRunnable* aRunnable); 1.48 + 1.49 + virtual nsresult 1.50 + GetServiceChannel(const nsAString& aDeviceAddress, 1.51 + const nsAString& aServiceUuid, 1.52 + BluetoothProfileManagerBase* aManager); 1.53 + 1.54 + virtual bool 1.55 + UpdateSdpRecords(const nsAString& aDeviceAddress, 1.56 + BluetoothProfileManagerBase* aManager); 1.57 + 1.58 + virtual nsresult 1.59 + CreatePairedDeviceInternal(const nsAString& aDeviceAddress, 1.60 + int aTimeout, 1.61 + BluetoothReplyRunnable* aRunnable); 1.62 + 1.63 + virtual nsresult 1.64 + RemoveDeviceInternal(const nsAString& aDeviceObjectPath, 1.65 + BluetoothReplyRunnable* aRunnable); 1.66 + 1.67 + virtual bool 1.68 + SetPinCodeInternal(const nsAString& aDeviceAddress, const nsAString& aPinCode, 1.69 + BluetoothReplyRunnable* aRunnable); 1.70 + 1.71 + virtual bool 1.72 + SetPasskeyInternal(const nsAString& aDeviceAddress, uint32_t aPasskey, 1.73 + BluetoothReplyRunnable* aRunnable); 1.74 + 1.75 + virtual bool 1.76 + SetPairingConfirmationInternal(const nsAString& aDeviceAddress, bool aConfirm, 1.77 + BluetoothReplyRunnable* aRunnable); 1.78 + 1.79 + virtual bool 1.80 + SetAuthorizationInternal(const nsAString& aDeviceAddress, bool aAllow, 1.81 + BluetoothReplyRunnable* aRunnable); 1.82 + 1.83 + virtual nsresult 1.84 + PrepareAdapterInternal(); 1.85 + 1.86 + virtual void 1.87 + Connect(const nsAString& aDeviceAddress, 1.88 + uint32_t aCod, 1.89 + uint16_t aServiceUuid, 1.90 + BluetoothReplyRunnable* aRunnable); 1.91 + 1.92 + virtual bool 1.93 + IsConnected(uint16_t aProfileId); 1.94 + 1.95 + virtual void 1.96 + Disconnect(const nsAString& aDeviceAddress, uint16_t aServiceUuid, 1.97 + BluetoothReplyRunnable* aRunnable); 1.98 + 1.99 + virtual void 1.100 + SendFile(const nsAString& aDeviceAddress, 1.101 + BlobParent* aBlobParent, 1.102 + BlobChild* aBlobChild, 1.103 + BluetoothReplyRunnable* aRunnable); 1.104 + 1.105 + virtual void 1.106 + SendFile(const nsAString& aDeviceAddress, 1.107 + nsIDOMBlob* aBlob, 1.108 + BluetoothReplyRunnable* aRunnable); 1.109 + 1.110 + virtual void 1.111 + StopSendingFile(const nsAString& aDeviceAddress, 1.112 + BluetoothReplyRunnable* aRunnable); 1.113 + 1.114 + virtual void 1.115 + ConfirmReceivingFile(const nsAString& aDeviceAddress, bool aConfirm, 1.116 + BluetoothReplyRunnable* aRunnable); 1.117 + 1.118 + virtual void 1.119 + ConnectSco(BluetoothReplyRunnable* aRunnable); 1.120 + 1.121 + virtual void 1.122 + DisconnectSco(BluetoothReplyRunnable* aRunnable); 1.123 + 1.124 + virtual void 1.125 + IsScoConnected(BluetoothReplyRunnable* aRunnable); 1.126 + 1.127 + virtual void 1.128 + AnswerWaitingCall(BluetoothReplyRunnable* aRunnable); 1.129 + 1.130 + virtual void 1.131 + IgnoreWaitingCall(BluetoothReplyRunnable* aRunnable); 1.132 + 1.133 + virtual void 1.134 + ToggleCalls(BluetoothReplyRunnable* aRunnable); 1.135 + 1.136 + virtual void 1.137 + SendMetaData(const nsAString& aTitle, 1.138 + const nsAString& aArtist, 1.139 + const nsAString& aAlbum, 1.140 + int64_t aMediaNumber, 1.141 + int64_t aTotalMediaCount, 1.142 + int64_t aDuration, 1.143 + BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; 1.144 + 1.145 + virtual void 1.146 + SendPlayStatus(int64_t aDuration, 1.147 + int64_t aPosition, 1.148 + const nsAString& aPlayStatus, 1.149 + BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE; 1.150 + 1.151 + virtual void 1.152 + UpdatePlayStatus(uint32_t aDuration, 1.153 + uint32_t aPosition, 1.154 + ControlPlayStatus aPlayStatus) MOZ_OVERRIDE; 1.155 + 1.156 + virtual nsresult 1.157 + SendSinkMessage(const nsAString& aDeviceAddresses, 1.158 + const nsAString& aMessage) MOZ_OVERRIDE; 1.159 + 1.160 + virtual nsresult 1.161 + SendInputMessage(const nsAString& aDeviceAddresses, 1.162 + const nsAString& aMessage) MOZ_OVERRIDE; 1.163 +}; 1.164 + 1.165 +END_BLUETOOTH_NAMESPACE 1.166 + 1.167 +#endif 1.168 +