2014-11-03 04:03:49 -08: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/. */
|
|
|
|
|
|
|
|
#include "BluetoothDaemonConnection.h"
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/un.h>
|
|
|
|
#include <unistd.h>
|
2015-05-26 09:29:02 -07:00
|
|
|
#include "mozilla/ipc/BluetoothDaemonConnectionConsumer.h"
|
2015-04-28 01:18:12 -07:00
|
|
|
#include "mozilla/ipc/DataSocket.h"
|
2014-11-03 04:03:49 -08:00
|
|
|
#include "nsTArray.h"
|
|
|
|
#include "nsXULAppAPI.h"
|
|
|
|
|
|
|
|
#ifdef CHROMIUM_LOG
|
|
|
|
#undef CHROMIUM_LOG
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(MOZ_WIDGET_GONK)
|
|
|
|
#include <android/log.h>
|
|
|
|
#define CHROMIUM_LOG(args...) __android_log_print(ANDROID_LOG_INFO, "I/O", args);
|
|
|
|
#else
|
|
|
|
#include <stdio.h>
|
|
|
|
#define IODEBUG true
|
|
|
|
#define CHROMIUM_LOG(args...) if (IODEBUG) printf(args);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace ipc {
|
|
|
|
|
|
|
|
// The connection to the Bluetooth daemon is established
|
|
|
|
// using an abstract socket name. The \0 prefix will be added
|
|
|
|
// by the |Connect| method.
|
|
|
|
static const char sBluetoothdSocketName[] = "bluez_hal_socket";
|
|
|
|
|
|
|
|
//
|
|
|
|
// BluetoothDaemonPDU
|
|
|
|
//
|
|
|
|
|
|
|
|
BluetoothDaemonPDU::BluetoothDaemonPDU(uint8_t aService, uint8_t aOpcode,
|
|
|
|
uint16_t aPayloadSize)
|
2015-06-08 01:20:17 -07:00
|
|
|
: mConsumer(nullptr)
|
2015-04-30 02:29:25 -07:00
|
|
|
, mUserData(nullptr)
|
2014-11-03 04:03:49 -08:00
|
|
|
{
|
2015-06-08 01:20:17 -07:00
|
|
|
// Allocate memory
|
|
|
|
size_t availableSpace = HEADER_SIZE + aPayloadSize;
|
|
|
|
ResetBuffer(new uint8_t[availableSpace], 0, 0, availableSpace);
|
|
|
|
|
|
|
|
// Reserve PDU header
|
2014-11-03 04:03:49 -08:00
|
|
|
uint8_t* data = Append(HEADER_SIZE);
|
|
|
|
MOZ_ASSERT(data);
|
|
|
|
|
|
|
|
// Setup PDU header
|
|
|
|
data[OFF_SERVICE] = aService;
|
|
|
|
data[OFF_OPCODE] = aOpcode;
|
|
|
|
memcpy(data + OFF_LENGTH, &aPayloadSize, sizeof(aPayloadSize));
|
|
|
|
}
|
|
|
|
|
|
|
|
BluetoothDaemonPDU::BluetoothDaemonPDU(size_t aPayloadSize)
|
2015-06-08 01:20:17 -07:00
|
|
|
: mConsumer(nullptr)
|
2015-04-30 02:29:25 -07:00
|
|
|
, mUserData(nullptr)
|
2015-06-08 01:20:17 -07:00
|
|
|
{
|
|
|
|
size_t availableSpace = HEADER_SIZE + aPayloadSize;
|
|
|
|
ResetBuffer(new uint8_t[availableSpace], 0, 0, availableSpace);
|
|
|
|
}
|
|
|
|
|
|
|
|
BluetoothDaemonPDU::~BluetoothDaemonPDU()
|
|
|
|
{
|
|
|
|
nsAutoArrayPtr<uint8_t> data(GetBuffer());
|
|
|
|
ResetBuffer(nullptr, 0, 0, 0);
|
|
|
|
}
|
2014-11-03 04:03:49 -08:00
|
|
|
|
2014-11-05 06:43:06 -08:00
|
|
|
void
|
|
|
|
BluetoothDaemonPDU::GetHeader(uint8_t& aService, uint8_t& aOpcode,
|
|
|
|
uint16_t& aPayloadSize)
|
|
|
|
{
|
|
|
|
memcpy(&aService, GetData(OFF_SERVICE), sizeof(aService));
|
|
|
|
memcpy(&aOpcode, GetData(OFF_OPCODE), sizeof(aOpcode));
|
|
|
|
memcpy(&aPayloadSize, GetData(OFF_LENGTH), sizeof(aPayloadSize));
|
|
|
|
}
|
|
|
|
|
2014-11-03 04:03:49 -08:00
|
|
|
ssize_t
|
|
|
|
BluetoothDaemonPDU::Send(int aFd)
|
|
|
|
{
|
|
|
|
struct iovec iv;
|
|
|
|
memset(&iv, 0, sizeof(iv));
|
|
|
|
iv.iov_base = GetData(GetLeadingSpace());
|
|
|
|
iv.iov_len = GetSize();
|
|
|
|
|
|
|
|
struct msghdr msg;
|
|
|
|
memset(&msg, 0, sizeof(msg));
|
|
|
|
msg.msg_iov = &iv;
|
|
|
|
msg.msg_iovlen = 1;
|
|
|
|
msg.msg_control = nullptr;
|
|
|
|
msg.msg_controllen = 0;
|
|
|
|
|
|
|
|
ssize_t res = TEMP_FAILURE_RETRY(sendmsg(aFd, &msg, 0));
|
|
|
|
if (res < 0) {
|
|
|
|
MOZ_ASSERT(errno != EBADF); /* internal error */
|
|
|
|
OnError("sendmsg", errno);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
Consume(res);
|
|
|
|
|
2015-04-30 02:29:25 -07:00
|
|
|
if (mConsumer) {
|
|
|
|
// We successfully sent a PDU, now store the
|
|
|
|
// result runnable in the consumer.
|
|
|
|
mConsumer->StoreUserData(*this);
|
|
|
|
}
|
|
|
|
|
2014-11-03 04:03:49 -08:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define CMSGHDR_CONTAINS_FD(_cmsghdr) \
|
|
|
|
( ((_cmsghdr)->cmsg_level == SOL_SOCKET) && \
|
|
|
|
((_cmsghdr)->cmsg_type == SCM_RIGHTS) )
|
|
|
|
|
|
|
|
ssize_t
|
|
|
|
BluetoothDaemonPDU::Receive(int aFd)
|
|
|
|
{
|
|
|
|
struct iovec iv;
|
|
|
|
memset(&iv, 0, sizeof(iv));
|
|
|
|
iv.iov_base = GetData(0);
|
|
|
|
iv.iov_len = GetAvailableSpace();
|
|
|
|
|
|
|
|
uint8_t cmsgbuf[CMSG_SPACE(sizeof(int))];
|
|
|
|
|
|
|
|
struct msghdr msg;
|
|
|
|
memset(&msg, 0, sizeof(msg));
|
|
|
|
msg.msg_iov = &iv;
|
|
|
|
msg.msg_iovlen = 1;
|
|
|
|
msg.msg_control = cmsgbuf;
|
|
|
|
msg.msg_controllen = sizeof(cmsgbuf);
|
|
|
|
|
|
|
|
ssize_t res = TEMP_FAILURE_RETRY(recvmsg(aFd, &msg, MSG_NOSIGNAL));
|
|
|
|
if (res < 0) {
|
|
|
|
MOZ_ASSERT(errno != EBADF); /* internal error */
|
|
|
|
OnError("recvmsg", errno);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (msg.msg_flags & (MSG_CTRUNC | MSG_OOB | MSG_ERRQUEUE)) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
SetRange(0, res);
|
|
|
|
|
|
|
|
struct cmsghdr *chdr = CMSG_FIRSTHDR(&msg);
|
|
|
|
|
|
|
|
for (; chdr; chdr = CMSG_NXTHDR(&msg, chdr)) {
|
|
|
|
if (NS_WARN_IF(!CMSGHDR_CONTAINS_FD(chdr))) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
// Retrieve sent file descriptor. If multiple file descriptors
|
|
|
|
// have been sent, we close all but the final one.
|
|
|
|
mReceivedFd = *(static_cast<int*>(CMSG_DATA(chdr)));
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
BluetoothDaemonPDU::AcquireFd()
|
|
|
|
{
|
|
|
|
return mReceivedFd.forget();
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
BluetoothDaemonPDU::UpdateHeader()
|
|
|
|
{
|
|
|
|
size_t len = GetPayloadSize();
|
|
|
|
if (len >= MAX_PAYLOAD_LENGTH) {
|
|
|
|
return NS_ERROR_ILLEGAL_VALUE;
|
|
|
|
}
|
|
|
|
uint16_t len16 = static_cast<uint16_t>(len);
|
|
|
|
|
|
|
|
memcpy(GetData(OFF_LENGTH), &len16, sizeof(len16));
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t
|
|
|
|
BluetoothDaemonPDU::GetPayloadSize() const
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(GetSize() >= HEADER_SIZE);
|
|
|
|
|
|
|
|
return GetSize() - HEADER_SIZE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
BluetoothDaemonPDU::OnError(const char* aFunction, int aErrno)
|
|
|
|
{
|
|
|
|
CHROMIUM_LOG("%s failed with error %d (%s)",
|
|
|
|
aFunction, aErrno, strerror(aErrno));
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// BluetoothDaemonPDUConsumer
|
|
|
|
//
|
|
|
|
|
|
|
|
BluetoothDaemonPDUConsumer::BluetoothDaemonPDUConsumer()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
BluetoothDaemonPDUConsumer::~BluetoothDaemonPDUConsumer()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
//
|
|
|
|
// BluetoothDaemonConnectionIO
|
|
|
|
//
|
|
|
|
|
2015-06-03 02:53:50 -07:00
|
|
|
class BluetoothDaemonConnectionIO final : public ConnectionOrientedSocketIO
|
2014-11-03 04:03:49 -08:00
|
|
|
{
|
|
|
|
public:
|
2015-06-02 01:01:57 -07:00
|
|
|
BluetoothDaemonConnectionIO(nsIThread* aConsumerThread,
|
|
|
|
MessageLoop* aIOLoop,
|
|
|
|
int aFd, ConnectionStatus aConnectionStatus,
|
2015-06-03 02:53:50 -07:00
|
|
|
UnixSocketConnector* aConnector,
|
2014-11-03 04:03:49 -08:00
|
|
|
BluetoothDaemonConnection* aConnection,
|
|
|
|
BluetoothDaemonPDUConsumer* aConsumer);
|
|
|
|
|
2015-04-30 03:55:37 -07:00
|
|
|
// Methods for |DataSocketIO|
|
|
|
|
//
|
2014-11-03 04:03:49 -08:00
|
|
|
|
2015-04-30 03:55:37 -07:00
|
|
|
nsresult QueryReceiveBuffer(UnixSocketIOBuffer** aBuffer) override;
|
|
|
|
void ConsumeBuffer() override;
|
|
|
|
void DiscardBuffer() override;
|
2014-11-03 04:03:49 -08:00
|
|
|
|
2015-04-30 03:55:37 -07:00
|
|
|
// Methods for |SocketIOBase|
|
|
|
|
//
|
2014-11-03 04:03:49 -08:00
|
|
|
|
2015-04-30 03:55:37 -07:00
|
|
|
SocketBase* GetSocketBase() override;
|
2014-11-03 04:03:49 -08:00
|
|
|
|
2015-06-02 01:01:58 -07:00
|
|
|
bool IsShutdownOnConsumerThread() const override;
|
2015-04-30 03:55:37 -07:00
|
|
|
bool IsShutdownOnIOThread() const override;
|
|
|
|
|
2015-06-02 01:01:58 -07:00
|
|
|
void ShutdownOnConsumerThread() override;
|
2015-04-30 03:55:37 -07:00
|
|
|
void ShutdownOnIOThread() override;
|
2014-11-03 04:03:49 -08:00
|
|
|
|
2015-04-30 03:55:37 -07:00
|
|
|
private:
|
2014-11-03 04:03:49 -08:00
|
|
|
BluetoothDaemonConnection* mConnection;
|
|
|
|
BluetoothDaemonPDUConsumer* mConsumer;
|
|
|
|
nsAutoPtr<BluetoothDaemonPDU> mPDU;
|
|
|
|
bool mShuttingDownOnIOThread;
|
|
|
|
};
|
|
|
|
|
|
|
|
BluetoothDaemonConnectionIO::BluetoothDaemonConnectionIO(
|
2015-06-02 01:01:57 -07:00
|
|
|
nsIThread* aConsumerThread,
|
|
|
|
MessageLoop* aIOLoop,
|
|
|
|
int aFd,
|
2015-01-19 18:17:25 -08:00
|
|
|
ConnectionStatus aConnectionStatus,
|
2015-06-03 02:53:50 -07:00
|
|
|
UnixSocketConnector* aConnector,
|
2014-11-03 04:03:49 -08:00
|
|
|
BluetoothDaemonConnection* aConnection,
|
|
|
|
BluetoothDaemonPDUConsumer* aConsumer)
|
2015-06-03 02:53:50 -07:00
|
|
|
: ConnectionOrientedSocketIO(aConsumerThread,
|
|
|
|
aIOLoop,
|
|
|
|
aFd,
|
2015-06-03 02:53:50 -07:00
|
|
|
aConnectionStatus,
|
|
|
|
aConnector)
|
2015-06-02 01:01:57 -07:00
|
|
|
, mConnection(aConnection)
|
|
|
|
, mConsumer(aConsumer)
|
|
|
|
, mShuttingDownOnIOThread(false)
|
2014-11-03 04:03:49 -08:00
|
|
|
{
|
|
|
|
MOZ_ASSERT(mConnection);
|
|
|
|
MOZ_ASSERT(mConsumer);
|
2015-01-19 18:17:25 -08:00
|
|
|
}
|
|
|
|
|
2015-04-30 03:55:37 -07:00
|
|
|
// |DataSocketIO|
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
BluetoothDaemonConnectionIO::QueryReceiveBuffer(UnixSocketIOBuffer** aBuffer)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aBuffer);
|
|
|
|
|
|
|
|
if (!mPDU) {
|
|
|
|
/* There's only one PDU for receiving. We reuse it every time. */
|
|
|
|
mPDU = new BluetoothDaemonPDU(BluetoothDaemonPDU::MAX_PAYLOAD_LENGTH);
|
|
|
|
}
|
|
|
|
*aBuffer = mPDU.get();
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
BluetoothDaemonConnectionIO::ConsumeBuffer()
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(mConsumer);
|
|
|
|
|
|
|
|
mConsumer->Handle(*mPDU);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
BluetoothDaemonConnectionIO::DiscardBuffer()
|
|
|
|
{
|
|
|
|
// Nothing to do.
|
|
|
|
}
|
|
|
|
|
|
|
|
// |SocketIOBase|
|
|
|
|
|
|
|
|
SocketBase*
|
|
|
|
BluetoothDaemonConnectionIO::GetSocketBase()
|
|
|
|
{
|
|
|
|
return mConnection;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2015-06-02 01:01:58 -07:00
|
|
|
BluetoothDaemonConnectionIO::IsShutdownOnConsumerThread() const
|
2015-04-30 03:55:37 -07:00
|
|
|
{
|
2015-06-02 01:01:57 -07:00
|
|
|
MOZ_ASSERT(IsConsumerThread());
|
2015-04-30 03:55:37 -07:00
|
|
|
|
|
|
|
return mConnection == nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BluetoothDaemonConnectionIO::IsShutdownOnIOThread() const
|
|
|
|
{
|
|
|
|
return mShuttingDownOnIOThread;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2015-06-02 01:01:58 -07:00
|
|
|
BluetoothDaemonConnectionIO::ShutdownOnConsumerThread()
|
2015-04-30 03:55:37 -07:00
|
|
|
{
|
2015-06-02 01:01:57 -07:00
|
|
|
MOZ_ASSERT(IsConsumerThread());
|
2015-06-02 01:01:58 -07:00
|
|
|
MOZ_ASSERT(!IsShutdownOnConsumerThread());
|
2015-04-30 03:55:37 -07:00
|
|
|
|
|
|
|
mConnection = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
BluetoothDaemonConnectionIO::ShutdownOnIOThread()
|
|
|
|
{
|
2015-06-02 01:01:57 -07:00
|
|
|
MOZ_ASSERT(!IsConsumerThread());
|
2015-04-30 03:55:37 -07:00
|
|
|
MOZ_ASSERT(!mShuttingDownOnIOThread);
|
|
|
|
|
|
|
|
Close(); // will also remove fd from I/O loop
|
|
|
|
mShuttingDownOnIOThread = true;
|
|
|
|
}
|
|
|
|
|
2014-11-03 04:03:49 -08:00
|
|
|
//
|
|
|
|
// BluetoothDaemonConnection
|
|
|
|
//
|
|
|
|
|
2015-05-21 04:34:37 -07:00
|
|
|
BluetoothDaemonConnection::BluetoothDaemonConnection(
|
2015-05-26 09:29:02 -07:00
|
|
|
BluetoothDaemonPDUConsumer* aPDUConsumer,
|
|
|
|
BluetoothDaemonConnectionConsumer* aConsumer,
|
|
|
|
int aIndex)
|
2015-06-02 01:01:57 -07:00
|
|
|
: mIO(nullptr)
|
|
|
|
, mPDUConsumer(aPDUConsumer)
|
2015-05-26 09:29:02 -07:00
|
|
|
, mConsumer(aConsumer)
|
|
|
|
, mIndex(aIndex)
|
2015-05-21 04:34:37 -07:00
|
|
|
{
|
|
|
|
MOZ_ASSERT(mConsumer);
|
|
|
|
}
|
2014-11-03 04:03:49 -08:00
|
|
|
|
|
|
|
BluetoothDaemonConnection::~BluetoothDaemonConnection()
|
|
|
|
{ }
|
|
|
|
|
2015-05-21 04:34:37 -07:00
|
|
|
// |ConnectionOrientedSocket|
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
BluetoothDaemonConnection::PrepareAccept(UnixSocketConnector* aConnector,
|
2015-06-02 01:01:57 -07:00
|
|
|
nsIThread* aConsumerThread,
|
2015-06-02 01:01:57 -07:00
|
|
|
MessageLoop* aIOLoop,
|
2015-05-21 04:34:37 -07:00
|
|
|
ConnectionOrientedSocketIO*& aIO)
|
2014-11-03 04:03:49 -08:00
|
|
|
{
|
2015-04-30 03:55:37 -07:00
|
|
|
MOZ_ASSERT(!mIO);
|
2014-11-03 04:03:49 -08:00
|
|
|
|
2015-04-30 03:55:37 -07:00
|
|
|
SetConnectionStatus(SOCKET_CONNECTING);
|
2014-11-03 04:03:49 -08:00
|
|
|
|
2015-04-30 03:55:37 -07:00
|
|
|
mIO = new BluetoothDaemonConnectionIO(
|
2015-06-02 01:01:57 -07:00
|
|
|
aConsumerThread, aIOLoop, -1, UnixSocketWatcher::SOCKET_IS_CONNECTING,
|
2015-06-03 02:53:50 -07:00
|
|
|
aConnector, this, mPDUConsumer);
|
2015-05-21 04:34:37 -07:00
|
|
|
aIO = mIO;
|
2014-11-03 04:03:49 -08:00
|
|
|
|
2015-05-21 04:34:37 -07:00
|
|
|
return NS_OK;
|
2015-01-19 18:17:25 -08:00
|
|
|
}
|
|
|
|
|
2015-04-30 03:55:37 -07:00
|
|
|
// |DataSocket|
|
|
|
|
|
|
|
|
void
|
|
|
|
BluetoothDaemonConnection::SendSocketData(UnixSocketIOBuffer* aBuffer)
|
2015-01-19 18:17:25 -08:00
|
|
|
{
|
2015-04-30 03:55:37 -07:00
|
|
|
MOZ_ASSERT(mIO);
|
2015-06-02 01:01:57 -07:00
|
|
|
MOZ_ASSERT(mIO->IsConsumerThread());
|
2015-01-19 18:17:25 -08:00
|
|
|
|
2015-06-02 01:01:57 -07:00
|
|
|
mIO->GetIOLoop()->PostTask(
|
2015-04-30 03:55:37 -07:00
|
|
|
FROM_HERE,
|
|
|
|
new SocketIOSendTask<BluetoothDaemonConnectionIO,
|
|
|
|
UnixSocketIOBuffer>(mIO, aBuffer));
|
|
|
|
}
|
2015-01-19 18:17:25 -08:00
|
|
|
|
2015-04-30 03:55:37 -07:00
|
|
|
// |SocketBase|
|
2015-01-19 18:17:25 -08:00
|
|
|
|
2015-04-30 03:55:37 -07:00
|
|
|
void
|
2015-05-20 01:50:43 -07:00
|
|
|
BluetoothDaemonConnection::Close()
|
2015-04-30 03:55:37 -07:00
|
|
|
{
|
|
|
|
if (!mIO) {
|
|
|
|
CHROMIUM_LOG("Bluetooth daemon already disconnected!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-06-02 01:01:57 -07:00
|
|
|
MOZ_ASSERT(mIO->IsConsumerThread());
|
|
|
|
|
2015-06-02 01:01:58 -07:00
|
|
|
mIO->ShutdownOnConsumerThread();
|
2015-06-02 01:01:57 -07:00
|
|
|
mIO->GetIOLoop()->PostTask(FROM_HERE, new SocketIOShutdownTask(mIO));
|
2015-04-30 03:55:37 -07:00
|
|
|
mIO = nullptr;
|
|
|
|
|
|
|
|
NotifyDisconnect();
|
2015-01-19 18:17:25 -08:00
|
|
|
}
|
|
|
|
|
2015-05-26 09:29:02 -07:00
|
|
|
void
|
|
|
|
BluetoothDaemonConnection::OnConnectSuccess()
|
|
|
|
{
|
|
|
|
mConsumer->OnConnectSuccess(mIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
BluetoothDaemonConnection::OnConnectError()
|
|
|
|
{
|
|
|
|
mConsumer->OnConnectError(mIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
BluetoothDaemonConnection::OnDisconnect()
|
|
|
|
{
|
|
|
|
mConsumer->OnDisconnect(mIndex);
|
|
|
|
}
|
|
|
|
|
2014-11-03 04:03:49 -08:00
|
|
|
}
|
|
|
|
}
|