2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef _DEVICE_STATUS_HEADPHONE_H_
18 #define _DEVICE_STATUS_HEADPNOHE_H_
21 #include <runtime_info.h>
22 #include <bluetooth.h>
23 #include "../sub_provider_base.h"
27 class device_status_headphone : public sub_provider_base {
29 device_status_headphone();
30 ~device_status_headphone() {}
32 int subscribe(const char* subject, const char* zone);
33 int unsubscribe(const char* subject, const char* zone);
34 int read(const char* subject, const char* zone);
37 string_set_t client_zone;
42 bool bt_audio_callback_on;
43 bool bt_event_handler_added;
44 int bt_event_handling_count;
46 bool get_current_status();
47 void set_bt_audio_callback();
48 void unset_bt_audio_callback();
49 void set_bt_audio_state(bool state);
51 void generate_data_packet(json &data);
53 void handle_audio_jack_event();
55 static gboolean handle_bt_event(gpointer data);
56 static void on_audio_jack_state_changed(runtime_info_key_e runtime_key, void* user_data);
57 static void on_bt_connection_changed(bool connected, bt_device_connection_info_s *conn_info, void *user_data);
58 static bool on_bt_bond(bt_device_info_s *device_info, void* user_data);
62 #endif // _DEVICE_STATUS_HEADPHONE_H_