Imported Upstream version 0.9.1
[platform/upstream/iotivity.git] / service / soft-sensor-manager / SoftSensorPlugin / IndoorTrajectorySensor / include / tizen_CbleDevice.h
1 /******************************************************************
2 *
3 * Copyright 2014 Samsung Electronics All Rights Reserved.
4 *
5 *
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 *      http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 ******************************************************************/
20
21 #ifndef CBLEDEVICE_H_
22 #define CBLEDEVICE_H_
23
24 #include <bluetooth.h>
25 #include <map>
26 #include <string>
27
28
29 class CbleDevice
30 {
31     private :
32         typedef bt_adapter_device_discovery_info_s ble_value;
33         typedef std::map<std::string, ble_value>    CbleDeviceMAP;
34         CbleDeviceMAP device;
35
36     public :
37         unsigned long time_count;
38
39         CbleDevice();
40         ~CbleDevice();
41
42         int insert( ble_value *discovery_info );
43
44         ble_value *getNext( int seq );
45
46         int setRSSI( std::string addr, int rssi );
47
48         ble_value *get( std::string addr );
49
50         bool find( std::string addr );
51
52         int size( void );
53
54         void erase( CbleDeviceMAP::iterator itr );
55
56         void clear( void );
57
58         bool isTimeOut( void );
59 };
60
61
62 #endif /* CBLEDEVICE_H_ */