2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 #ifndef __TIZEN_BLUETOOTH_HEALTH_CHANNEL_H__
19 #define __TIZEN_BLUETOOTH_HEALTH_CHANNEL_H__
22 #include <bluetooth.h>
23 #include <JavaScriptCore/JavaScript.h>
25 #include <MultiCallbackUserData.h>
26 #include "BluetoothDevice.h"
27 #include "BluetoothHealthApplication.h"
32 class BluetoothHealthChannel : public Common::SecurityAccessor
35 BluetoothHealthChannel(unsigned int channel, BluetoothDeviceSharedPtr remoteDevice, bt_hdp_channel_type_e type, BluetoothHealthApplicationSharedPtr application);
36 virtual ~BluetoothHealthChannel();
38 bool getConnectionState() const;
39 void setConnectionState(bool isConnected);
40 unsigned int getChannel() const;
41 std::string getChannelTypeStr() const;
42 bt_hdp_channel_type_e getChannelType() const;
43 JSValueRef getApp(JSContextRef context);
44 JSValueRef getPeer(JSContextRef context);
45 Common::MultiCallbackUserDataPtr getListener() const;
47 unsigned long sendData(char* data, unsigned long size);
49 void setListener(Common::MultiCallbackUserDataPtr callback);
53 unsigned int mChannel;
55 std::string mChannelTypeStr;
56 bt_hdp_channel_type_e mChannelType;
57 BluetoothDeviceSharedPtr mRemoteDevice;
58 BluetoothHealthApplicationSharedPtr mApp;
60 Common::MultiCallbackUserDataPtr mListener;
63 typedef BluetoothHealthChannel* BluetoothHealthChannelPtr;
68 #endif // __TIZEN_BLUETOOTH_HEALTH_CHANNEL_H__