2012-09-25 13:13:15 -07: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_BluetoothUnixSocketConnector_h
|
|
|
|
#define mozilla_dom_bluetooth_BluetoothUnixSocketConnector_h
|
|
|
|
|
|
|
|
#include "BluetoothCommon.h"
|
2012-10-01 00:03:28 -07:00
|
|
|
#include <sys/socket.h>
|
2012-09-25 13:13:15 -07:00
|
|
|
#include <mozilla/ipc/UnixSocket.h>
|
|
|
|
|
|
|
|
BEGIN_BLUETOOTH_NAMESPACE
|
|
|
|
|
|
|
|
class BluetoothUnixSocketConnector : public mozilla::ipc::UnixSocketConnector
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BluetoothUnixSocketConnector(BluetoothSocketType aType, int aChannel,
|
|
|
|
bool aAuth, bool aEncrypt);
|
|
|
|
virtual ~BluetoothUnixSocketConnector()
|
|
|
|
{}
|
|
|
|
virtual int Create() MOZ_OVERRIDE;
|
2013-03-19 10:23:47 -07:00
|
|
|
virtual bool CreateAddr(bool aIsServer,
|
2012-10-01 00:03:28 -07:00
|
|
|
socklen_t& aAddrSize,
|
2013-03-19 10:23:47 -07:00
|
|
|
mozilla::ipc::sockaddr_any& aAddr,
|
2012-10-01 00:03:28 -07:00
|
|
|
const char* aAddress) MOZ_OVERRIDE;
|
2012-10-10 22:49:11 -07:00
|
|
|
virtual bool SetUp(int aFd) MOZ_OVERRIDE;
|
2013-03-19 10:23:47 -07:00
|
|
|
virtual void GetSocketAddr(const mozilla::ipc::sockaddr_any& aAddr,
|
2012-10-17 17:11:05 -07:00
|
|
|
nsAString& aAddrStr) MOZ_OVERRIDE;
|
|
|
|
|
2012-09-25 13:13:15 -07:00
|
|
|
private:
|
|
|
|
BluetoothSocketType mType;
|
|
|
|
int mChannel;
|
|
|
|
bool mAuth;
|
|
|
|
bool mEncrypt;
|
|
|
|
};
|
|
|
|
|
|
|
|
END_BLUETOOTH_NAMESPACE
|
|
|
|
|
|
|
|
#endif
|