ad9f35ad85d0d7256a878a6579fe9cfced06154a
[framework/telephony/libtcore.git] / include / co_sat.h
1 /*
2  * libtcore
3  *
4  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Ja-young Gu <jygu@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20
21 #ifndef __TCORE_CO_SAT_H__
22 #define __TCORE_CO_SAT_H__
23
24 #include <core_object.h>
25
26 enum tcore_sat_result{
27         TCORE_SAT_SUCCESS,
28         TCORE_SAT_SUCCESS_PARTIAL_COMPREHENSION,
29         TCORE_SAT_UNABLE_TO_PERFORM_CMD,
30         TCORE_SAT_REQUIRED_VALUE_MISSING,
31         TCORE_SAT_COMMAND_NOT_UNDERSTOOD,
32         TCORE_SAT_BEYOND_ME_CAPABILITY,
33         TCORE_SAT_COMMAND_TYPE_NOT_UNDERSTOOD,
34         TCORE_SAT_ERROR_FATAL
35 };
36
37 struct tcore_sat_proactive_command {
38         int cmd_num;
39         enum tel_sat_proactive_cmd_type cmd_type;
40         union {
41                 struct tel_sat_display_text_tlv display_text;
42                 struct tel_sat_get_inkey_tlv get_inkey;
43                 struct tel_sat_get_input_tlv get_input;
44                 struct tel_sat_more_time_tlv more_time;
45                 struct tel_sat_play_tone_tlv play_tone;
46                 struct tel_sat_setup_menu_tlv setup_menu;
47                 struct tel_sat_select_item_tlv select_item;
48                 struct tel_sat_send_sms_tlv send_sms;
49                 struct tel_sat_send_ss_tlv send_ss;
50                 struct tel_sat_send_ussd_tlv send_ussd;
51                 struct tel_sat_setup_call_tlv setup_call;
52                 struct tel_sat_refresh_tlv refresh;
53                 struct tel_sat_provide_local_info_tlv provide_local_info;
54                 struct tel_sat_setup_event_list_tlv setup_event_list;
55                 struct tel_sat_setup_idle_mode_text_tlv setup_idle_mode_text;
56                 struct tel_sat_send_dtmf_tlv send_dtmf;
57                 struct tel_sat_language_notification_tlv language_notification;
58                 struct tel_sat_launch_browser_tlv launch_browser;
59                 struct tel_sat_open_channel_tlv open_channel;
60                 struct tel_sat_close_channel_tlv close_channel;
61                 struct tel_sat_receive_channel_tlv receive_data;
62                 struct tel_sat_send_channel_tlv send_data;
63                 struct tel_sat_get_channel_status_tlv get_channel_status;
64 /*
65                 TelSatRefreshIndInfo_t refresh;
66                 TelSatProvideLocalInfoIndInfo_t provideLocInfo;
67                 TelSatLaunchBrowserIndInfo_t launchBrowser;
68                 TelSatSetupIdleModeTextIndInfo_t idleText;
69                 TelSatSendDtmfIndInfo_t sendDtmf;
70                 TelSatLanguageNotificationIndInfo_t languageNotification;
71                 TelSatOpenChannelIndInfo_t openChannel;
72                 TelSatCloseChannelIndInfo_t closeChannel;
73                 TelSatReceiveDataIndInfo_t receiveData;
74                 TelSatSendDataIndInfo_t sendData;
75                 TelSatGetChannelStatusIndInfo_t getChannelStatus;*/
76         } data;
77 };
78
79 struct tcore_sat_operations {
80         TReturn (*envelope)(CoreObject *o, UserRequest *ur);
81         TReturn (*terminal_response)(CoreObject *o, UserRequest *ur);
82 };
83
84 int tcore_sat_decode_proactive_command(unsigned char* tlv_origin, unsigned int tlv_length, struct tcore_sat_proactive_command* decoded_tlv);
85 int tcore_sat_encode_envelop_cmd(const struct treq_sat_envelop_cmd_data *src_envelop, char *dst_envelop);
86 int tcore_sat_encode_terminal_response(const struct treq_sat_terminal_rsp_data *src_tr, char *dst_tr);
87
88 CoreObject* tcore_sat_new(TcorePlugin *p, const char *name, struct tcore_sat_operations *ops, TcoreHal *hal);
89 void        tcore_sat_free(CoreObject *n);
90
91 #endif