Initial refactoring merge
[platform/core/telephony/libtcore.git] / include / co_sat.h
1 /*
2  * libtcore
3  *
4  * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
5  * Copyright (c) 2013 Intel Corporation. All rights reserved.
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 #ifndef __CO_SAT_H__
21 #define __CO_SAT_H__
22
23 #include <core_object.h>
24 #include "type/sat_internal.h"
25 #include <tel_return.h>
26
27 #ifdef __cplusplus
28         extern "C" {
29 #endif
30
31 /* OEM operations */
32 typedef struct {
33         TelReturn (*send_envelope)(CoreObject *co, const TelSatRequestEnvelopCmdData *envelop_data, TcoreObjectResponseCallback cb, void *cb_data);
34         TelReturn (*send_terminal_response)(CoreObject *co, const TelSatRequestTerminalResponseData *terminal_rsp_data, TcoreObjectResponseCallback cb, void *cb_data);
35         TelReturn (*send_user_confirmation)(CoreObject *co, const TelSatRequestUserConfirmationData *user_conf_data, TcoreObjectResponseCallback cb, void *cb_data);
36 }TcoreSatOps;
37
38 CoreObject *tcore_sat_new(TcorePlugin *p, TcoreSatOps *sat_ops, TcoreHal *hal);
39 void tcore_sat_free(CoreObject *co);
40 void tcore_sat_override_ops(CoreObject *co, TcoreSatOps *sat_ops);
41 gboolean tcore_sat_set_ops(CoreObject *co, TcoreSatOps *ops);
42
43 gboolean tcore_sat_decode_proactive_command(unsigned char* tlv_origin, unsigned int tlv_length,
44                 TelSatDecodedProactiveData* decoded_tlv, int* decode_err_code);
45 int tcore_sat_decode_call_control_result(unsigned char* tlv_origin, unsigned int tlv_length, TelSatNotiCallControlResultInd* call_ctrl_result_tlv);
46 gboolean tcore_sat_encode_envelop_cmd(const TelSatRequestEnvelopCmdData *src_envelop, char *dst_envelop, int* envelope_length);
47 gboolean tcore_sat_encode_terminal_response(const TelSatRequestTerminalResponseData *src_tr, char *dst_tr, int* tr_length);
48
49 #ifdef __cplusplus
50 }
51 #endif
52
53 #endif  /* __CO_SAT_H__ */