diff options
Diffstat (limited to 'src/platform/Tizen/Bluetooth/BluetoothSocketManager.h')
-rw-r--r-- | src/platform/Tizen/Bluetooth/BluetoothSocketManager.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/platform/Tizen/Bluetooth/BluetoothSocketManager.h b/src/platform/Tizen/Bluetooth/BluetoothSocketManager.h new file mode 100644 index 0000000..343a623 --- /dev/null +++ b/src/platform/Tizen/Bluetooth/BluetoothSocketManager.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TIZENAPIS_PLATFROM_BLUETOOTH_SOCKET_MANAGER_H_ +#define TIZENAPIS_PLATFROM_BLUETOOTH_SOCKET_MANAGER_H_ + +#include <dpl/shared_ptr.h> +#include <Commons/ThreadPool.h> +#include <API/Bluetooth/IBluetoothSocketManager.h> +#include <API/Bluetooth/BluetoothFactory.h> +#include <bluetooth.h> +#include <dpl/mutex.h> +#include <vector> + +using namespace TizenApis::Api; +using namespace TizenApis::Api::Bluetooth; + +namespace TizenApis { +namespace Platform { +namespace Bluetooth { + + +class BluetoothSocketManager : public Api::Bluetooth::IBluetoothSocketManager +{ + friend class TizenApis::Api::Bluetooth::BluetoothFactory; +public: + virtual ~BluetoothSocketManager(); + virtual std::string getUUID(); + virtual unsigned int getProtocol(); + virtual unsigned int getState(); + virtual BluetoothDeviceData getPeer(); + virtual int setSocketNotifier(EventBTSocketNotificationEmitterPtr emitter); + virtual int writeData(const char *data, const unsigned int length); + virtual EventBTReadDataType readData(); + virtual int close(); + virtual void setSocketData(BluetoothSocketData socketData); + virtual void setReadData(EventBTReadDataType readData); + void setDataReceivedEmit(bt_socket_received_data_s *data); + void connectionStateChangedEmit(int result, bt_socket_connection_state_e connection_state, + bt_socket_connection_s *connection); +private: + EventBTReadDataType m_readData; + DPL::Mutex m_mtx; + BluetoothSocketData m_socketData; + EventBTSocketNotificationEmitterPtr m_EventBTSocketNotificationEmitterPtr; +protected: + BluetoothSocketManager(); + +}; + +} +} +} + +#endif /* WRTPLUGINS_API_BluetoothSocketManager_H_ */ + |