dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
     2 /* vim: set ts=2 et sw=2 tw=80: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     5  * You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef mozilla_dom_bluetooth_bluetoothservicebluedroid_h__
     8 #define mozilla_dom_bluetooth_bluetoothservicebluedroid_h__
    10 #include <hardware/bluetooth.h>
    12 #include "BluetoothCommon.h"
    13 #include "BluetoothService.h"
    15 BEGIN_BLUETOOTH_NAMESPACE
    17 class BluetoothServiceBluedroid : public BluetoothService
    18 {
    19 public:
    20   static const bt_interface_t* GetBluetoothInterface();
    22   BluetoothServiceBluedroid();
    23   ~BluetoothServiceBluedroid();
    25   virtual nsresult StartInternal();
    26   virtual nsresult StopInternal();
    28   virtual nsresult GetDefaultAdapterPathInternal(
    29                                              BluetoothReplyRunnable* aRunnable);
    31   virtual nsresult GetConnectedDevicePropertiesInternal(uint16_t aProfileId,
    32                                              BluetoothReplyRunnable* aRunnable);
    34   virtual nsresult GetPairedDevicePropertiesInternal(
    35                                      const nsTArray<nsString>& aDeviceAddress,
    36                                      BluetoothReplyRunnable* aRunnable);
    38   virtual nsresult StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable);
    39   virtual nsresult StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable);
    41   virtual nsresult
    42   SetProperty(BluetoothObjectType aType,
    43               const BluetoothNamedValue& aValue,
    44               BluetoothReplyRunnable* aRunnable);
    46   virtual nsresult
    47   GetServiceChannel(const nsAString& aDeviceAddress,
    48                     const nsAString& aServiceUuid,
    49                     BluetoothProfileManagerBase* aManager);
    51   virtual bool
    52   UpdateSdpRecords(const nsAString& aDeviceAddress,
    53                    BluetoothProfileManagerBase* aManager);
    55   virtual nsresult
    56   CreatePairedDeviceInternal(const nsAString& aDeviceAddress,
    57                              int aTimeout,
    58                              BluetoothReplyRunnable* aRunnable);
    60   virtual nsresult
    61   RemoveDeviceInternal(const nsAString& aDeviceObjectPath,
    62                        BluetoothReplyRunnable* aRunnable);
    64   virtual bool
    65   SetPinCodeInternal(const nsAString& aDeviceAddress, const nsAString& aPinCode,
    66                      BluetoothReplyRunnable* aRunnable);
    68   virtual bool
    69   SetPasskeyInternal(const nsAString& aDeviceAddress, uint32_t aPasskey,
    70                      BluetoothReplyRunnable* aRunnable);
    72   virtual bool
    73   SetPairingConfirmationInternal(const nsAString& aDeviceAddress, bool aConfirm,
    74                                  BluetoothReplyRunnable* aRunnable);
    76   virtual bool
    77   SetAuthorizationInternal(const nsAString& aDeviceAddress, bool aAllow,
    78                            BluetoothReplyRunnable* aRunnable);
    80   virtual nsresult
    81   PrepareAdapterInternal();
    83   virtual void
    84   Connect(const nsAString& aDeviceAddress,
    85           uint32_t aCod,
    86           uint16_t aServiceUuid,
    87           BluetoothReplyRunnable* aRunnable);
    89   virtual bool
    90   IsConnected(uint16_t aProfileId);
    92   virtual void
    93   Disconnect(const nsAString& aDeviceAddress, uint16_t aServiceUuid,
    94              BluetoothReplyRunnable* aRunnable);
    96   virtual void
    97   SendFile(const nsAString& aDeviceAddress,
    98            BlobParent* aBlobParent,
    99            BlobChild* aBlobChild,
   100            BluetoothReplyRunnable* aRunnable);
   102   virtual void
   103   SendFile(const nsAString& aDeviceAddress,
   104            nsIDOMBlob* aBlob,
   105            BluetoothReplyRunnable* aRunnable);
   107   virtual void
   108   StopSendingFile(const nsAString& aDeviceAddress,
   109                   BluetoothReplyRunnable* aRunnable);
   111   virtual void
   112   ConfirmReceivingFile(const nsAString& aDeviceAddress, bool aConfirm,
   113                        BluetoothReplyRunnable* aRunnable);
   115   virtual void
   116   ConnectSco(BluetoothReplyRunnable* aRunnable);
   118   virtual void
   119   DisconnectSco(BluetoothReplyRunnable* aRunnable);
   121   virtual void
   122   IsScoConnected(BluetoothReplyRunnable* aRunnable);
   124   virtual void
   125   AnswerWaitingCall(BluetoothReplyRunnable* aRunnable);
   127   virtual void
   128   IgnoreWaitingCall(BluetoothReplyRunnable* aRunnable);
   130   virtual void
   131   ToggleCalls(BluetoothReplyRunnable* aRunnable);
   133   virtual void
   134   SendMetaData(const nsAString& aTitle,
   135                const nsAString& aArtist,
   136                const nsAString& aAlbum,
   137                int64_t aMediaNumber,
   138                int64_t aTotalMediaCount,
   139                int64_t aDuration,
   140                BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
   142   virtual void
   143   SendPlayStatus(int64_t aDuration,
   144                  int64_t aPosition,
   145                  const nsAString& aPlayStatus,
   146                  BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
   148   virtual void
   149   UpdatePlayStatus(uint32_t aDuration,
   150                    uint32_t aPosition,
   151                    ControlPlayStatus aPlayStatus) MOZ_OVERRIDE;
   153   virtual nsresult
   154   SendSinkMessage(const nsAString& aDeviceAddresses,
   155                   const nsAString& aMessage) MOZ_OVERRIDE;
   157   virtual nsresult
   158   SendInputMessage(const nsAString& aDeviceAddresses,
   159                    const nsAString& aMessage) MOZ_OVERRIDE;
   160 };
   162 END_BLUETOOTH_NAMESPACE
   164 #endif

mercurial