4 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef _EXTERNAL_SENSOR_H_
21 #define _EXTERNAL_SENSOR_H_
23 #include <sensor_base.h>
24 #include <sensor_common.h>
28 class external_sensor : public sensor_base {
31 virtual ~external_sensor();
32 int send_data(const char* data, int data_cnt);
33 std::string get_key(void);
34 bool set_source_connected(bool connected);
35 bool get_source_connected(void);
36 virtual void on_receive(unsigned long long timestamp, const float* data, int data_cnt) = 0;
37 virtual int set_attribute(int32_t attribute, char *value, int value_size);
39 bool register_key(const std::string &key);
41 bool unregister_key(void);
44 bool m_source_connected;
45 cmutex m_source_mutex;
47 #endif /* _EXTERNAL_SENSOR_H_ */