4 * Copyright (c) 2017 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 __SENSOR_PROVIDER_CHANNEL_HANDLER__
21 #define __SENSOR_PROVIDER_CHANNEL_HANDLER__
23 #include <channel_handler.h>
24 #include <sensor_internal.h>
25 #include "sensor_provider.h"
29 class sensor_provider::channel_handler : public ipc::channel_handler
32 channel_handler(sensor_provider *provider);
34 void connected(ipc::channel *ch);
35 void disconnected(ipc::channel *ch);
36 void read(ipc::channel *ch, ipc::message &msg);
38 void read_complete(ipc::channel *ch);
39 void error_caught(ipc::channel *ch, int error);
41 void set_start_cb(sensord_provider_start_cb cb, void *user_data);
42 void set_stop_cb(sensord_provider_stop_cb cb, void *user_data);
43 void set_interval_cb(sensord_provider_interval_changed_cb cb, void *user_data);
46 sensor_provider *m_provider;
48 sensord_provider_start_cb m_start_cb;
49 sensord_provider_stop_cb m_stop_cb;
50 sensord_provider_interval_changed_cb m_interval_changed_cb;
52 void *m_start_user_data;
53 void *m_stop_user_data;
54 void *m_interval_changed_user_data;
59 #endif /* __SENSOR_PROVIDER_CHANNEL_HANDLER__ */