+++ /dev/null
-AT based modem plugin
+tel-plugin-atmodem (0.1.8) unstable; urgency=low
+
+ * Fix OBS Build Error
+ * Git: slp/pkgs/t/tel-plugin-atmodem
+ * Tag: tel-plugin-atmodem_0.1.8
+
+ -- Youngman Park <youngman.park@samsung.com> Fri, 25 May 2012 14:35:07 +0900
+
+tel-plugin-atmodem (0.1.7) unstable; urgency=low
+
+ * Fix Build Error
+ * Git: slp/pkgs/t/tel-plugin-atmodem
+ * Tag: tel-plugin-atmodem_0.1.7
+
+ -- Youngman Park <youngman.park@samsung.com> Fri, 18 May 2012 11:25:07 +0900
+
+tel-plugin-atmodem (0.1.6) unstable; urgency=low
+
+ * Add Call New API ( call custom service )
+ * Git: slp/pkgs/t/tel-plugin-atmodem
+ * Tag: tel-plugin-atmodem_0.1.6
+
+ -- Youngman Park <youngman.park@samsung.com> Mon, 07 May 2012 17:10:07 +0900
+
+tel-plugin-atmodem (0.1.5) unstable; urgency=low
+
+ * Adding the <CR> at the last SIM/SMS AT cmds
+ * Git: slp/pkgs/t/tel-plugin-atmodem
+ * Tag: tel-plugin-atmodem_0.1.5
+
+ -- JaYoung Gu <jygu@samsung.com> Tue, 11 Apr 2012 08:17:07 +0900
+
tel-plugin-atmodem (0.1.4) unstable; urgency=low
* version up for code sync with public binary
tel-plugin-atmodem (0.1.3) unstable; urgency=low
* Fix prefix (TAPI_ to TCORE_)
- * Git: pkgs/t/tel-plugin-atmodem
+ * Git: slp/pkgs/t/tel-plugin-atmodem
* Tag: tel-plugin-atmodem_0.1.3
-- Inho Oh <inho48.oh@samsung.com> Tue, 27 Mar 2012 22:11:38 +0900
tel-plugin-atmodem (0.1.2) unstable; urgency=low
* Fix build break and Add .spec file for OBS
- * Git: pkgs/t/tel-plugin-atmodem
- * tel-plugin-atmodem_0.1.2
+ * Git: slp/pkgs/t/tel-plugin-atmodem
+ * Tag: tel-plugin-atmodem_0.1.2
-- DongHoo Park <donghoo.park@samsung.com> Sat, 17 Mar 2012 02:30:20 +0900
tel-plugin-atmodem (0.1.1) unstable; urgency=low
* Remove unused header
- * Git: pkgs/t/tel-plugin-atmodem
+ * Git: slp/pkgs/t/tel-plugin-atmodem
* Tag: tel-plugin-atmodem_0.1.1
-- Inho Oh <inho48.oh@samsung.com> Fri, 16 Mar 2012 02:39:47 +0900
tel-plugin-atmodem (0.1.0) unstable; urgency=low
* Initial
- * Git: pkgs/t/tel-plugin-atmodem
+ * Git: slp/pkgs/t/tel-plugin-atmodem
* Tag: tel-plugin-atmodem_0.1.0
-- Inho Oh <inho48.oh@samsung.com> Thu, 15 Mar 2012 22:37:29 +0900
#define AT_NOTI_TOK_ERROR_INTERNEL(token, file, line) \\r
{\\r
err("AT_NOTI_TOK_ERROR_INTERNEL %s:%d %s",file,line,token?token:"");\\r
- return;\\r
+ return TRUE;\\r
}\\r
\r
#endif /* __ATCHANNEL_H__ */\r
#ifndef __S_CALL_H__
#define __S_CALL_H__
-gboolean s_call_init( TcorePlugin *p );
-void s_call_exit( TcorePlugin *p );
+gboolean s_call_init(TcorePlugin *p, TcoreHal *h);
+void s_call_exit(TcorePlugin *p);
#endif
#ifndef __S_MODEM_H__
#define __S_MODEM_H__
-gboolean s_modem_init(TcorePlugin *p);
+gboolean s_modem_init(TcorePlugin *p, TcoreHal *h);
void s_modem_exit(TcorePlugin *p);
gboolean s_modem_send_poweron(TcorePlugin *p);
+
#endif
#ifndef __S_NETWORK_H__
#define __S_NETWORK_H__
-
-gboolean s_network_init(TcorePlugin *p);
+gboolean s_network_init(TcorePlugin *p, TcoreHal *h);
void s_network_exit(TcorePlugin *p);
#endif
#ifndef __S_PS_H__
#define __S_PS_H__
-
-gboolean s_ps_init(TcorePlugin *p);
+gboolean s_ps_init(TcorePlugin *p, TcoreHal *h);
void s_ps_exit(TcorePlugin *p);
#endif
#ifndef __S_SIM_H__
#define __S_SIM_H__
-
-gboolean s_sim_init(TcorePlugin *p);
+gboolean s_sim_init(TcorePlugin *p, TcoreHal *h);
void s_sim_exit(TcorePlugin *p);
#endif
#ifndef __S_SMS_H__
#define __S_SMS_H__
-
-gboolean s_sms_init(TcorePlugin *p);
+gboolean s_sms_init(TcorePlugin *p, TcoreHal *h);
void s_sms_exit(TcorePlugin *p);
#endif
#ifndef __S_SS_H__
#define __S_SS_H__
-
-gboolean s_ss_init( TcorePlugin *p );
-void s_ss_exit( TcorePlugin *p );
-
-
+gboolean s_ss_init(TcorePlugin *p, TcoreHal *h);
+void s_ss_exit(TcorePlugin *p);
#endif
#sbs-git:slp/pkgs/t/tel-plugin-atmodem
-Name: tel-plugin-atmodem
-Summary: Telephony AT Modem library
-Version: 0.1.4
+Name: tel-plugin-atmodem
+Summary: Telephony AT Modem library
+Version: 0.1.15
Release: 1
Group: System/Libraries
License: Apache
%make_install
%files
+%manifest tel-plugin-atmodem.manifest
%defattr(-,root,root,-)
#%doc COPYING
%{_libdir}/telephony/plugins/atmodem-plugin*
if(spc.line1 != NULL)
free(spc.line1);
spc.line1 = NULL;
-
+
spc.sms_pdu_len = 0;
spc.cum_pdu_len =0;
spc.sms_pdu_mode = FALSE;
-
+
if(spc.ppdu !=NULL)
free(spc.ppdu);
spc.ppdu = NULL;
dbg("Final response arrived. call response callback");
// 1. add final rsp string into sp_response
- sp_response->finalResponse = strdup(line);
+ sp_response->finalResponse = strdup(line);
- // 1.1 reverse intermediates
+ // 1.1 reverse intermediates
reverseIntermediates(sp_response);
- // 2. pop head pending from queue -> call callback hung pending(on_response) ->
+ // 2. pop head pending from queue -> call callback hung pending(on_response) ->
// release sp_response/s_responsePrefix -> release userRequest/pending -> send next pending from queue
// warning) length have no meaning. data always pointer sp_response
tcore_hal_dispatch_response_data(hal, ID_RESERVED_AT, strlen(line), sp_response);
if(strStartsWith(s,"+CMT:")){
- //SMS incoming
+ //SMS incoming
cmd = EVENT_SMS_INCOM_MSG;
-
+
smsPdu.cmdLine = strdup(s);
smsPdu.pdu = malloc(pdu_len);
memcpy(smsPdu.pdu, sms_pdu, pdu_len);
smsPdu.len = pdu_len;
-
+
tcore_plugin_core_object_event_emit(plugin, cmd, &smsPdu);
free(smsPdu.cmdLine);
free(smsPdu.pdu);
}
/* Ignore unsolicited responses until we're initialized.
* This is OK because the RIL library will poll for initial state
- */
+ */
else if (strStartsWith(s,"%SCFUN:")){
/* SS specific -- modem power status notification */
cmd = EVENT_MODEM_PHONE_STATE;
free(line);
- dbg("%SCLCC cmd : %d",cmd);
+ dbg("%SCLCC cmd : %d",cmd);
}
else if (strStartsWith(s,"+CRING:")
|| strStartsWith(s,"RING")){
else if(strStartsWith(s,"+CCWA:")){
dbg("call waiting notification - wait for SCLCC with status 5");
return;
- }
+ }
else if (strStartsWith(s,"+CREG:")
|| strStartsWith(s,"+CGREG:")){
cmd = EVENT_NETWORK_REGISTRATION;
}
else if (strStartsWith(s,"+CMGS:")) {
cmd = EVENT_SMS_SEND_ACK;
- }
+ }
else if (strStartsWith(s,"%SCDEV:")) {
cmd = EVENT_SMS_DEVICE_READY;
- }
+ }
else if(strStartsWith(s,"+CIEV:")){
cmd = EVENT_NETWORK_ICON_INFO;
}
/* Send Event */
if(cmd)
{
- line = strdup(s);
+ line = strdup(s);
tcore_plugin_core_object_event_emit(plugin, cmd, line);
free(line);
}
-
+
}
static void processLine(TcoreHal *hal, char *line, TcorePlugin* p)
{
TcoreQueue* pPendingQueue = NULL;
- TcorePending* pPending =NULL;
+ TcorePending* pPending =NULL;
gboolean result_status = FALSE;
pPendingQueue =(TcoreQueue*)tcore_hal_ref_queue(hal);
pPending = (TcorePending*)tcore_queue_ref_head(pPendingQueue); //topmost request
if(TCORE_RETURN_SUCCESS == tcore_pending_get_send_status(pPending, &result_status)
&& (result_status == FALSE))//request not sent but data comes - Unsolicited msg!
- {
+ {
/* no command pending */
dbg("no command pending. call onUnsolicited()");
onUnsolicited(line, p, NULL, 0);
sp_response->success = 1;
handleFinalResponse(hal, line);
} else if (isFinalResponseError(line)) {
- dbg("final response -ERROR. call handleFinalResponse()");
+ dbg("final response -ERROR. call handleFinalResponse()");
sp_response->success = 0;
handleFinalResponse(hal, line);
} else switch (s_type) {
addIntermediate(line);
} else {
/* we already have an intermediate response */
- dbg("[SINGLELINE]:we already have an intermediate response. call onUnsolicited()");
+ dbg("[SINGLELINE]:we already have an intermediate response. call onUnsolicited()");
onUnsolicited(line,p, NULL, 0);
}
}
* the buffer continues until a \0
*/
-/*check sms pdu cumulating process - data hijacking*/
+ /*check sms pdu cumulating process - data hijacking*/
if(spc.sms_pdu_mode == TRUE)
{ //continue sms pdu buffering
dbg("resume pdu buffering. pdu size : %d, gathered size : %d",spc.sms_pdu_len,spc.cum_pdu_len);
len = spc.sms_pdu_len - spc.cum_pdu_len; //length needed
-
+
if(act_len > len){
dbg("whole pdu received - data surplus");
memcpy(spc.ppdu_marker, act_data,len);//data fully copied
act_data = act_data + len;
act_len = act_len - len;
dbg("recv string changed to = %s, length changed to : %d", (char*)act_data, act_len);
-
+
onUnsolicited(spc.line1, p, spc.ppdu, spc.sms_pdu_len);
- stopSMSBuffering();
- dbg("incoming sms handled. back to normal mode & continue");
+ stopSMSBuffering();
+ dbg("incoming sms handled. back to normal mode & continue");
}
else if(act_len == len){
dbg("exactly whole pdu received");
-
+
memcpy(spc.ppdu_marker, act_data,len);//data fully copied
spc.cum_pdu_len = spc.cum_pdu_len + len;
-
+
onUnsolicited(spc.line1, p, spc.ppdu, spc.sms_pdu_len);
- stopSMSBuffering();
- dbg("all incoming data consumed. return");
+ stopSMSBuffering();
+ dbg("all incoming data consumed. return");
return TRUE;
}
else {
return TRUE;
}
}
-
-
- if (*s_ATBufferCur == '\0')
+
+
+ if (*s_ATBufferCur == '\0')
{
/* empty buffer */
s_ATBufferCur = s_ATBuffer;
*s_ATBufferCur = '\0';
p_read = s_ATBuffer;
}
- else
- {
+ else
+ {
/* *s_ATBufferCur != '\0' */
/* there's data in the buffer from the last read */
p_eol = findNextEOL(s_ATBufferCur);
- if (p_eol == NULL)
+ if (p_eol == NULL)
{
/* a partial line. move it up and prepare to read more */
unsigned int len;
p_eol = findNextEOL(s_ATBufferCur);
- if(p_eol !=NULL) /*end of line found!*/
+ if(p_eol !=NULL) /*end of line found!*/
{
/* a full line in the buffer. Place a \0 over the \r and return */
ret = s_ATBufferCur;
/* and there will be a \0 at *p_read */
dbg("complete line found. process it/n");
- dbg("rsp line : %s/n",ret);
+ dbg("rsp line : %s/n",ret);
if(1 == isSMSUnsolicited(ret))
{
dbg("start of incoming sms found!!! - next data is PDU");
startSMSBuffering(ret);
s_ATBufferCur++; //move starting point by 1 - it goes to the very starting point of PDU
leftover_len = p_marker - s_ATBufferCur;
-
+
dbg("count leftover : %d", leftover_len);
if(leftover_len <0){
- dbg("pointer address error -serious!");
+ dbg("pointer address error -serious!");
return FALSE;
}
else if(leftover_len ==0){
- dbg("no pdu received - wait for incoming data");
+ dbg("no pdu received - wait for incoming data");
spc.cum_pdu_len =0;
spc.ppdu_marker = spc.ppdu;
}
else if(leftover_len >= spc.sms_pdu_len){
- dbg("whole pdu already received!");
+ dbg("whole pdu already received!");
memcpy(spc.ppdu, s_ATBufferCur, spc.sms_pdu_len);
spc.cum_pdu_len = spc.sms_pdu_len;
onUnsolicited(spc.line1, p, spc.ppdu, spc.sms_pdu_len);
s_ATBufferCur = s_ATBufferCur+spc.sms_pdu_len;
- dbg("move buffercur to point the very end of pdu!");
+ dbg("move buffercur to point the very end of pdu!");
stopSMSBuffering();
}
else {
- dbg("staring part of pdu received!");
- memcpy(spc.ppdu, s_ATBufferCur,leftover_len);
- spc.ppdu_marker = spc.ppdu + leftover_len;
- spc.cum_pdu_len = leftover_len;
- s_ATBufferCur = s_ATBufferCur + leftover_len;
- }
+ dbg("staring part of pdu received!");
+ memcpy(spc.ppdu, s_ATBufferCur,leftover_len);
+ spc.ppdu_marker = spc.ppdu + leftover_len;
+ spc.cum_pdu_len = leftover_len;
+ s_ATBufferCur = s_ATBufferCur + leftover_len;
+ }
}
else
- {
+ {
processLine(hal, ret,p);
}
}
return FALSE;
}
- tcore_plugin_set_hal(p, h);
-
tcore_hal_add_send_hook(h, on_hal_send, p);
tcore_hal_add_recv_callback(h, on_hal_recv, p);
- s_modem_init(p);
- s_network_init(p);
- s_sim_init(p);
+ s_modem_init(p, h);
+ s_network_init(p, h);
+ s_sim_init(p, h);
// s_sap_init(p);
- s_ps_init(p);
- s_call_init(p);
- s_ss_init(p);
- s_sms_init(p);
+ s_ps_init(p, h);
+ s_call_init(p, h);
+ s_ss_init(p, h);
+ s_sms_init(p, h);
// s_phonebook_init(p);
#ifndef TEST_AT_SOCKET
tcore_hal_set_power(h, TRUE);
extern char *s_responsePrefix;
extern enum ATCommandType s_type;
-struct call_confirm_info_t {
- CallObject *co;
- enum tcore_response_command resp;
-};
-
struct CLCC_call_t {
struct CLCC_call_info_t {
int id;
- enum tcore_call_direction direction;
+ enum tcore_call_direction direction;
enum tcore_call_status status;
- enum tcore_call_type type;
+ enum tcore_call_type type;
int mpty;
int num_len;
int num_type;
};
-static gboolean _call_request_message( CoreObject *o, UserRequest* ur, char* cmd_string,
+static gboolean _call_request_message( CoreObject *o, UserRequest* ur, char* cmd_string,
unsigned int cmd_length, void* on_resp, void* user_data);
static void _call_status_idle( TcorePlugin *p, CallObject *co );
static TReturn _call_list_get( CoreObject *o, CallObject *co );
static void on_confirmation_call_message_send( TcorePending *p, gboolean result, void *user_data ); // from Kernel
-static void on_confirmation_call_request( TcorePending *p, int data_len, const void *data, void *user_data ); // from Modem
-static void on_confirmation_call_hold( TcorePending *p, int data_len, const void *data, void *user_data );
-static void on_confirmation_call_swap( TcorePending *p, int data_len, const void *data, void *user_data );
-static void on_confirmation_call_split( TcorePending *p, int data_len, const void *data, void *user_data );
-static void on_confirmation_call_hold_and_accept( TcorePending *p, int data_len, const void *data, void *user_data );
-static void on_confirmation_call_endall( TcorePending *p, int data_len, const void *data, void *user_data ); // from Modem
-
static void on_response_call_list_get(TcorePending *p, int data_len, const void *data, void *user_data);
-static void on_notification_call_waiting( CoreObject *o, const void *data, void *user_data );
-static void on_notification_call_incoming( CoreObject *o, const void *data, void *user_data );
-static void on_notification_call_status( CoreObject *o, const void *data, void *user_data);
+static gboolean on_notification_call_waiting( CoreObject *o, const void *data, void *user_data );
+static gboolean on_notification_call_incoming( CoreObject *o, const void *data, void *user_data );
+static gboolean on_notification_call_status( CoreObject *o, const void *data, void *user_data);
static int _callFromCLCCLine(char *line, struct CLCC_call_t *p_call);
case 5:
return TCORE_CALL_STATUS_WAITING;
case 6:
- return TCORE_CALL_STATUS_DIALING; //connecting not exist. set to dialing
- case 7:
+ return TCORE_CALL_STATUS_DIALING; //connecting not exist. set to dialing
+ case 7:
return TCORE_CALL_STATUS_IDLE;
default:
info_len = sizeof(struct ATReqMetaInfo);
dbg("_call_request_message - cmd : %s, cmdlen :%d (including '\r')",cmd_string, cmd_len);
-
+
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, cmd_len, cmd_string);
}
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
tcore_hal_send_request(h, pending);
return TRUE;
}
-static void _call_status_idle( TcorePlugin *p, CallObject *co )
+static void _call_status_idle( TcorePlugin *p, CallObject *co )
{
struct tnoti_call_status_idle data;
tcore_call_object_set_status( co, TCORE_CALL_STATUS_IDLE );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
o,
TNOTI_CALL_STATUS_IDLE,
sizeof(struct tnoti_call_status_idle),
tcore_call_object_set_status( co, TCORE_CALL_STATUS_DIALING );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_STATUS_DIALING,
sizeof(struct tnoti_call_status_dialing),
tcore_call_object_set_status( co, TCORE_CALL_STATUS_ALERT );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_STATUS_ALERT,
sizeof(struct tnoti_call_status_alert),
tcore_call_object_set_status( co, TCORE_CALL_STATUS_ACTIVE );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_STATUS_ACTIVE,
sizeof(struct tnoti_call_status_active),
tcore_call_object_set_status( co, TCORE_CALL_STATUS_HELD );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_STATUS_HELD,
sizeof(struct tnoti_call_status_held),
data.active_line = tcore_call_object_get_active_line( co );
dbg("data.active_line : [%d]", data.active_line );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_STATUS_INCOMING,
sizeof(struct tnoti_call_status_incoming),
static TReturn _call_list_get( CoreObject *o, CallObject *co )
{
gboolean ret = FALSE;
- UserRequest* ur = NULL;
+ UserRequest* ur = NULL;
- char* cmd_str = NULL;
+ char* cmd_str = NULL;
struct ATReqMetaInfo metainfo;
- int info_len =0;
+ int info_len =0;
if ( !o )
return TCORE_RETURN_FAILURE;
cmd_str = g_strdup("AT+CLCC\r");
- ret = _call_request_message ( o, ur, cmd_str, strlen(cmd_str), on_response_call_list_get, NULL);
-
+ ret = _call_request_message ( o, ur, cmd_str, strlen(cmd_str), on_response_call_list_get, NULL);
+
if ( !ret )
return TCORE_RETURN_FAILURE;
metainfo = (struct ATReqMetaInfo*)tcore_user_request_ref_metainfo(ur,&info_len);
if((metainfo->type == SINGLELINE)||
- (metainfo->type == MULTILINE))
+ (metainfo->type == MULTILINE))
{
- //cp rsp prefix
+ //cp rsp prefix
s_responsePrefix = strdup(metainfo->responsePrefix);
- dbg("duplicating responsePrefix : %s\n", s_responsePrefix);
+ dbg("duplicating responsePrefix : %s\n", s_responsePrefix);
}
else
{
}
//set atcmd type into s_type
- s_type = metainfo->type;
+ s_type = metainfo->type;
if (result == FALSE) {
/* Fail */
}
}
-static void _confirmation_call( CoreObject *o, UserRequest *ur, TReturn err, struct call_confirm_info_t *ci )
+static void on_confirmation_call_outgoing( TcorePending *p, int data_len, const void *data, void *user_data )
{
- struct tresp_call_general resp;
+ CoreObject *o = 0;
+ UserRequest *ur = 0;
+
+ struct tresp_call_dial resp;
- if ( !ci->co )
- dbg("call object is NULL, is it general requst??");
+ o = tcore_pending_ref_core_object(p);
+ ur = tcore_pending_ref_user_request(p);
- resp.type = (enum telephony_call_type )tcore_call_object_get_type( ci->co );
- resp.id = tcore_call_object_get_id( ci->co );
- resp.err = err;
+ if(sp_response->success >0)
+ resp.err = TCORE_RETURN_SUCCESS;
+ else
+ resp.err = TCORE_RETURN_FAILURE;
+
+ ReleaseResponse();
if (ur) {
- tcore_user_request_send_response(ur, ci->resp, sizeof(struct tresp_call_general), &resp);
+ tcore_user_request_send_response(ur, TRESP_CALL_DIAL, sizeof(struct tresp_call_dial), &resp);
} else {
dbg("[ error ] ur is NULL");
return ;
}
+}
- dbg("resp.err : [ 0x%x ]", resp.err);
+static void on_confirmation_call_accept( TcorePending *p, int data_len, const void *data, void *user_data )
+{
+ CoreObject *o = 0;
+ UserRequest *ur = 0;
-#if 0
- _call_list_get( o, ci->co );
-#endif
+ struct tresp_call_answer resp;
+
+ o = tcore_pending_ref_core_object(p);
+ ur = tcore_pending_ref_user_request(p);
+
+ if(sp_response->success >0)
+ resp.err = TCORE_RETURN_SUCCESS;
+ else
+ resp.err = TCORE_RETURN_FAILURE;
+
+ ReleaseResponse();
+
+ resp.id = tcore_call_object_get_id( (CallObject*)user_data );
+
+ if (ur) {
+ tcore_user_request_send_response(ur, TRESP_CALL_ANSWER, sizeof(struct tresp_call_answer), &resp);
+ } else {
+ dbg("[ error ] ur is NULL");
+ return ;
+ }
}
-static void on_confirmation_call_request( TcorePending *p, int data_len, const void *data, void *user_data )
+static void on_confirmation_call_reject( TcorePending *p, int data_len, const void *data, void *user_data )
{
- CoreObject* o = 0;
- UserRequest* ur = 0;
- TReturn err = TCORE_RETURN_SUCCESS;
+ CoreObject *o = 0;
+ UserRequest *ur = 0;
- struct call_confirm_info_t* ci = 0;
+ struct tresp_call_answer resp;
o = tcore_pending_ref_core_object(p);
ur = tcore_pending_ref_user_request(p);
+ if(sp_response->success >0)
+ resp.err = TCORE_RETURN_SUCCESS;
+ else
+ resp.err = TCORE_RETURN_FAILURE;
+
+ ReleaseResponse();
+
+ resp.id = tcore_call_object_get_id( (CallObject*)user_data );
- ci = (struct call_confirm_info_t *)user_data;
- if ( !ci ) {
- dbg("[ error ] user_data is NULL");
+ if (ur) {
+ tcore_user_request_send_response(ur, TRESP_CALL_ANSWER, sizeof(struct tresp_call_answer), &resp);
+
+ } else {
+ dbg("[ error ] ur is NULL");
return ;
}
+}
+
+static void on_confirmation_call_replace( TcorePending *p, int data_len, const void *data, void *user_data )
+{
+ CoreObject *o = 0;
+ UserRequest *ur = 0;
+
+ struct tresp_call_answer resp;
+
+ o = tcore_pending_ref_core_object(p);
+ ur = tcore_pending_ref_user_request(p);
+
+ resp.id = tcore_call_object_get_id( (CallObject*)user_data );
if(sp_response->success >0)
- err = TCORE_RETURN_SUCCESS;
+ resp.err = TCORE_RETURN_SUCCESS;
else
- err = TCORE_RETURN_FAILURE;
+ resp.err = TCORE_RETURN_FAILURE;
ReleaseResponse();
- _confirmation_call( o, ur, err, ci );
- g_free( ci );
+ if (ur) {
+ tcore_user_request_send_response(ur, TRESP_CALL_ANSWER, sizeof(struct tresp_call_answer), &resp);
+
+ } else {
+ dbg("[ error ] ur is NULL");
+ return ;
+ }
}
-static void on_confirmation_call_split( TcorePending *p, int data_len, const void *data, void *user_data )
+static void on_confirmation_call_hold_and_accept( TcorePending *p, int data_len, const void *data, void *user_data )
{
CoreObject* o = 0;
UserRequest* ur = 0;
- struct tresp_call_general resp;
- struct call_confirm_info_t *ci = 0;
+ struct tresp_call_answer resp;
dbg("ok, function entrance");
- printResponse();
o = tcore_pending_ref_core_object(p);
ur = tcore_pending_ref_user_request(p);
- ci = (struct call_confirm_info_t *)user_data;
- if ( !ci ) {
- dbg("[ error ] user_data is NULL");
- goto out;
- }
+ resp.id = tcore_call_object_get_id( (CallObject*)user_data );
- resp.type = (enum telephony_call_type )tcore_call_object_get_type( ci->co );
- resp.id = tcore_call_object_get_id( ci->co );
- if(sp_response->success >0){
- resp.err = FALSE;
- }else{
- resp.err = TRUE;
- }
+ if(sp_response->success >0)
+ resp.err = TCORE_RETURN_SUCCESS;
+ else
+ resp.err = TCORE_RETURN_FAILURE;
ReleaseResponse();
+
if ( ur ) {
- tcore_user_request_send_response(ur, ci->resp, sizeof(struct tresp_call_general), &resp);
+ tcore_user_request_send_response(ur, TRESP_CALL_ANSWER, sizeof(struct tresp_call_answer), &resp);
} else {
dbg("[ error ] ur is NULL");
- goto out;
+ return ;
}
if ( !resp.err ) {
- GSList *active = 0;
+ GSList *l = 0;
CallObject *co = 0;
- active = tcore_call_object_find_by_status( o, TCORE_CALL_STATUS_ACTIVE );
- if ( !active ) {
+ l = tcore_call_object_find_by_status( o, TCORE_CALL_STATUS_ACTIVE );
+ if ( !l ) {
dbg("[ error ] can't find active call");
- goto out;
+ return ;
}
- co = (CallObject*)active->data;
+ co = (CallObject*)l->data;
if ( !co ) {
dbg("[ error ] can't get active call object");
- goto out;
+ return ;
}
tcore_call_object_set_status( co, TCORE_CALL_STATUS_HELD );
- tcore_call_object_set_status( ci->co, TCORE_CALL_STATUS_ACTIVE );
}
+}
+
+static void on_confirmation_call_release_all( TcorePending *p, int data_len, const void *data, void *user_data )
+{
+ CoreObject *o = 0;
+ UserRequest *ur = 0;
+
+ struct tresp_call_end resp;
-out:
- g_free( ci );
+ o = tcore_pending_ref_core_object(p);
+ ur = tcore_pending_ref_user_request(p);
+
+
+ resp.type = CALL_END_TYPE_ALL;
+ resp.id = tcore_call_object_get_id( (CallObject*)user_data );
+
+ if(sp_response->success >0)
+ resp.err = TCORE_RETURN_SUCCESS;
+ else
+ resp.err = TCORE_RETURN_FAILURE;
+
+ ReleaseResponse();
+
+ if (ur) {
+ tcore_user_request_send_response(ur, TRESP_CALL_END, sizeof(struct tresp_call_end), &resp);
+ } else {
+ dbg("[ error ] ur is NULL");
+ return ;
+ }
+}
+
+
+
+static void on_confirmation_call_release_specific( TcorePending *p, int data_len, const void *data, void *user_data )
+{
+ CoreObject *o = 0;
+ UserRequest *ur = 0;
+
+ struct tresp_call_end resp;
+
+ o = tcore_pending_ref_core_object(p);
+ ur = tcore_pending_ref_user_request(p);
+
+ resp.type = CALL_END_TYPE_DEFAULT;
+ resp.id = tcore_call_object_get_id( (CallObject*)user_data );
+
+ if(sp_response->success >0)
+ resp.err = TCORE_RETURN_SUCCESS;
+ else
+ resp.err = TCORE_RETURN_FAILURE;
+
+ ReleaseResponse();
+
+ if (ur) {
+ tcore_user_request_send_response(ur, TRESP_CALL_END, sizeof(struct tresp_call_end), &resp);
+
+ } else {
+ dbg("[ error ] ur is NULL");
+ return ;
+ }
+}
+
+static void on_confirmation_call_release_all_active( TcorePending *p, int data_len, const void *data, void *user_data )
+{
+ CoreObject *o = 0;
+ UserRequest *ur = 0;
+
+ struct tresp_call_end resp;
+
+ o = tcore_pending_ref_core_object(p);
+ ur = tcore_pending_ref_user_request(p);
+
+ resp.type = CALL_END_TYPE_ACTIVE_ALL;
+ resp.id = tcore_call_object_get_id( (CallObject*)user_data );
+
+ if(sp_response->success >0)
+ resp.err = TCORE_RETURN_SUCCESS;
+ else
+ resp.err = TCORE_RETURN_FAILURE;
+
+ ReleaseResponse();
+
+ if (ur) {
+ tcore_user_request_send_response(ur, TRESP_CALL_END, sizeof(struct tresp_call_end), &resp);
+
+ } else {
+ dbg("[ error ] ur is NULL");
+ return ;
+ }
}
+static void on_confirmation_call_release_all_held( TcorePending *p, int data_len, const void *data, void *user_data )
+{
+ CoreObject *o = 0;
+ UserRequest *ur = 0;
+
+ struct tresp_call_end resp;
+
+ o = tcore_pending_ref_core_object(p);
+ ur = tcore_pending_ref_user_request(p);
+
+ resp.type = CALL_END_TYPE_HOLD_ALL;
+ resp.id = tcore_call_object_get_id( (CallObject*)user_data );
+
+ if(sp_response->success >0)
+ resp.err = TCORE_RETURN_SUCCESS;
+ else
+ resp.err = TCORE_RETURN_FAILURE;
+
+ ReleaseResponse();
+
+ if (ur) {
+ tcore_user_request_send_response(ur, TRESP_CALL_END, sizeof(struct tresp_call_end), &resp);
+
+ } else {
+ dbg("[ error ] ur is NULL");
+ return ;
+ }
+}
static void on_confirmation_call_hold( TcorePending *p, int data_len, const void *data, void *user_data )
{
CoreObject* o = 0;
UserRequest* ur = 0;
- struct tresp_call_general resp;
- struct call_confirm_info_t *ci = 0;
+ struct tresp_call_hold resp;
dbg("ok, function entrance");
- printResponse();
o = tcore_pending_ref_core_object(p);
ur = tcore_pending_ref_user_request(p);
- ci = (struct call_confirm_info_t *)user_data;
- if ( !ci ) {
- dbg("[ error ] user_data is NULL");
- goto out;
- }
+ resp.id = tcore_call_object_get_id( (CallObject*)user_data );
- resp.type = (enum telephony_call_type )tcore_call_object_get_type( ci->co );
- resp.id = tcore_call_object_get_id( ci->co );
-
- if(sp_response->success >0){
- resp.err = FALSE;
- }else{
- resp.err = TRUE;
- }
+ if(sp_response->success >0)
+ resp.err = TCORE_RETURN_SUCCESS;
+ else
+ resp.err = TCORE_RETURN_FAILURE;
ReleaseResponse();
-
if ( ur ) {
- tcore_user_request_send_response(ur, ci->resp, sizeof(struct tresp_call_general), &resp);
+ tcore_user_request_send_response(ur, TRESP_CALL_HOLD, sizeof(struct tresp_call_hold), &resp);
} else {
dbg("[ error ] ur is NULL");
- goto out;
+ return ;
}
if ( !resp.err ) {
active = tcore_call_object_find_by_status( o, TCORE_CALL_STATUS_ACTIVE );
if ( !active ) {
dbg("[ error ] can't find active call");
- goto out;
+ return ;
}
co = (CallObject*)active->data;
if ( !co ) {
dbg("[ error ] can't get active call object");
- goto out;
+ return ;
}
tcore_call_object_set_status( co, TCORE_CALL_STATUS_HELD );
}
-out:
- g_free( ci );
+}
+
+static void on_confirmation_call_active( TcorePending *p, int data_len, const void *data, void *user_data )
+{
+ CoreObject *o = 0;
+ UserRequest *ur = 0;
+
+ struct tresp_call_active resp;
+
+ o = tcore_pending_ref_core_object(p);
+ ur = tcore_pending_ref_user_request(p);
+
+ resp.id = tcore_call_object_get_id( (CallObject*)user_data );
+
+ if(sp_response->success >0)
+ resp.err = TCORE_RETURN_SUCCESS;
+ else
+ resp.err = TCORE_RETURN_FAILURE;
+
+ ReleaseResponse();
+
+ if (ur) {
+ tcore_user_request_send_response(ur, TRESP_CALL_ACTIVE, sizeof(struct tresp_call_active), &resp);
+
+ } else {
+ dbg("[ error ] ur is NULL");
+ return ;
+ }
}
CoreObject* o = 0;
UserRequest* ur = 0;
- struct tresp_call_general resp;
- struct call_confirm_info_t *ci = 0;
+ struct tresp_call_swap resp;
dbg("ok, function entrance");
- printResponse();
o = tcore_pending_ref_core_object(p);
ur = tcore_pending_ref_user_request(p);
- ci = (struct call_confirm_info_t *)user_data;
- if ( !ci ) {
- dbg("[ error ] user_data is NULL");
- goto out;
- }
-
+ resp.id = tcore_call_object_get_id( (CallObject*)user_data );
- resp.type = (enum telephony_call_type )tcore_call_object_get_type( ci->co );
- resp.id = tcore_call_object_get_id( ci->co );
- if(sp_response->success >0){
- resp.err = FALSE;
- }else{
- resp.err = TRUE;
- }
+ if(sp_response->success >0)
+ resp.err = TCORE_RETURN_SUCCESS;
+ else
+ resp.err = TCORE_RETURN_FAILURE;
ReleaseResponse();
if ( ur ) {
- tcore_user_request_send_response(ur, ci->resp, sizeof(struct tresp_call_general), &resp);
+ tcore_user_request_send_response(ur, TRESP_CALL_SWAP, sizeof(struct tresp_call_swap), &resp);
} else {
dbg("[ error ] ur is NULL");
- goto out;
+ return ;
}
if ( !resp.err ) {
held = tcore_call_object_find_by_status( o, TCORE_CALL_STATUS_HELD );
if ( !held ) {
dbg("[ error ] can't find held call");
- goto out;
+ return ;
}
active = tcore_call_object_find_by_status( o, TCORE_CALL_STATUS_ACTIVE );
if ( !active ) {
dbg("[ error ] can't find active call");
- goto out;
+ return ;
}
co = (CallObject*)held->data;
if ( !co ) {
dbg("[ error ] can't get held call object");
- goto out;
+ return ;
}
resp.id = tcore_call_object_get_id( co );
tcore_call_object_set_status( co, TCORE_CALL_STATUS_ACTIVE );
- tcore_user_request_send_response(ur, TRESP_CALL_ACTIVE, sizeof(struct tresp_call_general), &resp);
+ tcore_user_request_send_response(ur, TRESP_CALL_ACTIVE, sizeof(struct tresp_call_active), &resp);
co = (CallObject*)active->data;
if ( !co ) {
dbg("[ error ] can't get active call object");
- goto out;
+ return ;
}
resp.id = tcore_call_object_get_id( co );
tcore_call_object_set_status( co, TCORE_CALL_STATUS_HELD );
- tcore_user_request_send_response(ur, TRESP_CALL_HOLD, sizeof(struct tresp_call_general), &resp);
+ tcore_user_request_send_response(ur, TRESP_CALL_HOLD, sizeof(struct tresp_call_hold), &resp);
}
+}
+
+static void on_confirmation_call_join( TcorePending *p, int data_len, const void *data, void *user_data )
+{
+ CoreObject *o = 0;
+ UserRequest *ur = 0;
+
+ struct tresp_call_join resp;
+
+ o = tcore_pending_ref_core_object(p);
+ ur = tcore_pending_ref_user_request(p);
+
+ resp.id = tcore_call_object_get_id( (CallObject*)user_data );
+
+ if(sp_response->success >0)
+ resp.err = TCORE_RETURN_SUCCESS;
+ else
+ resp.err = TCORE_RETURN_FAILURE;
-out:
- g_free( ci );
+ ReleaseResponse();
+
+ if (ur) {
+ tcore_user_request_send_response(ur, TRESP_CALL_JOIN, sizeof(struct tresp_call_join), &resp);
+
+ } else {
+ dbg("[ error ] ur is NULL");
+ return ;
+ }
}
-static void on_confirmation_call_hold_and_accept( TcorePending *p, int data_len, const void *data, void *user_data )
+static void on_confirmation_call_split( TcorePending *p, int data_len, const void *data, void *user_data )
{
CoreObject* o = 0;
UserRequest* ur = 0;
- struct tresp_call_general resp;
- struct call_confirm_info_t *ci = 0;
+
+ struct tresp_call_split resp;
dbg("ok, function entrance");
- printResponse();
o = tcore_pending_ref_core_object(p);
ur = tcore_pending_ref_user_request(p);
- ci = (struct call_confirm_info_t *)user_data;
- if ( !ci ) {
- dbg("[ error ] user_data is NULL");
- goto out;
- }
-
+ resp.id = tcore_call_object_get_id( (CallObject*)user_data );
- resp.type = (enum telephony_call_type )tcore_call_object_get_type( ci->co );
- resp.id = tcore_call_object_get_id( ci->co );
-
- if(sp_response->success >0){
- resp.err = FALSE;
- }else{
- resp.err = TRUE;
- }
+ if(sp_response->success >0)
+ resp.err = TCORE_RETURN_SUCCESS;
+ else
+ resp.err = TCORE_RETURN_FAILURE;
ReleaseResponse();
-
+
if ( ur ) {
- tcore_user_request_send_response(ur, ci->resp, sizeof(struct tresp_call_general), &resp);
+ tcore_user_request_send_response(ur, TRESP_CALL_SPLIT, sizeof(struct tresp_call_split), &resp);
} else {
dbg("[ error ] ur is NULL");
- goto out;
+ return ;
}
if ( !resp.err ) {
- GSList *l = 0;
+ GSList *active = 0;
CallObject *co = 0;
- l = tcore_call_object_find_by_status( o, TCORE_CALL_STATUS_ACTIVE );
- if ( !l ) {
+ active = tcore_call_object_find_by_status( o, TCORE_CALL_STATUS_ACTIVE );
+ if ( !active ) {
dbg("[ error ] can't find active call");
- goto out;
+ return ;
}
- co = (CallObject*)l->data;
+ co = (CallObject*)active->data;
if ( !co ) {
dbg("[ error ] can't get active call object");
- goto out;
+ return ;
}
tcore_call_object_set_status( co, TCORE_CALL_STATUS_HELD );
+ tcore_call_object_set_status( (CallObject*)user_data, TCORE_CALL_STATUS_ACTIVE );
}
+}
+
+static void on_confirmation_call_deflect( TcorePending *p, int data_len, const void *data, void *user_data )
+{
+ CoreObject *o = 0;
+ UserRequest *ur = 0;
-out:
- g_free( ci );
+ struct tresp_call_deflect resp;
+
+ o = tcore_pending_ref_core_object(p);
+ ur = tcore_pending_ref_user_request(p);
+
+ resp.id = tcore_call_object_get_id( (CallObject*)user_data );
+
+ if(sp_response->success >0)
+ resp.err = TCORE_RETURN_SUCCESS;
+ else
+ resp.err = TCORE_RETURN_FAILURE;
+
+ ReleaseResponse();
+
+ if (ur) {
+ tcore_user_request_send_response(ur, TRESP_CALL_DEFLECT, sizeof(struct tresp_call_deflect), &resp);
+
+ } else {
+ dbg("[ error ] ur is NULL");
+ return ;
+ }
+}
+
+static void on_confirmation_call_transfer( TcorePending *p, int data_len, const void *data, void *user_data )
+{
+ CoreObject *o = 0;
+ UserRequest *ur = 0;
+
+ struct tresp_call_transfer resp;
+
+ o = tcore_pending_ref_core_object(p);
+ ur = tcore_pending_ref_user_request(p);
+
+ resp.id = tcore_call_object_get_id( (CallObject*)user_data );
+
+ if(sp_response->success >0)
+ resp.err = TCORE_RETURN_SUCCESS;
+ else
+ resp.err = TCORE_RETURN_FAILURE;
+
+ ReleaseResponse();
+
+ if (ur) {
+ tcore_user_request_send_response(ur, TRESP_CALL_TRANSFER, sizeof(struct tresp_call_transfer), &resp);
+
+ } else {
+ dbg("[ error ] ur is NULL");
+ return ;
+ }
}
-// RESPONSE
+// RESPONSE
static void on_confirmation_call_endall( TcorePending *p, int data_len, const void *data, void *user_data )
{
CoreObject* o = 0;
UserRequest* ur = 0;
- //TReturn err = TCORE_RETURN_SUCCESS;
- struct call_confirm_info_t* ci = 0;
-
+
dbg("on_confirmation_call_endall - 1st result. wait for final result");
//skip response handling - actual result will be handled in on_confirmation_call_request
ReleaseResponse();
-
- ci = (struct call_confirm_info_t *)user_data;
- if ( !ci ) {
- dbg("[ error ] user_data is NULL");
- return ;
- }
}
-// RESPONSE
+// RESPONSE
static void on_response_call_list_get(TcorePending *p, int data_len, const void *data, void *user_data)
{
TcorePlugin* plugin = 0;
CoreObject* o = 0;
CallObject* co = 0;
- struct ATLine *p_cur;
+ struct ATLine *p_cur;
char* cmd= 0;
- struct CLCC_call_t* call_list = 0;
+ struct CLCC_call_t* call_list = 0;
int i = 0, countCalls =0, countValidCalls =0, err =0;
-
+
plugin = tcore_pending_ref_plugin( p );
o = tcore_pending_ref_core_object( p );
if(sp_response->success > 0)
{
- /* count the calls */
- for (countCalls = 0, p_cur = sp_response->p_intermediates
- ; p_cur != NULL
- ; p_cur = p_cur->p_next
- ) {
- countCalls++;
- }
- dbg("total calls : %d",countCalls);
+ /* count the calls */
+ for (countCalls = 0, p_cur = sp_response->p_intermediates
+ ; p_cur != NULL
+ ; p_cur = p_cur->p_next
+ ) {
+ countCalls++;
+ }
+ dbg("total calls : %d",countCalls);
- if(countCalls ==0)
- return;
+ if(countCalls ==0)
+ return;
call_list = g_new0( struct CLCC_call_t, countCalls);
-
+
for (countValidCalls = 0, p_cur = sp_response->p_intermediates
- ; p_cur != NULL
- ; p_cur = p_cur->p_next)
- {
+ ; p_cur != NULL
+ ; p_cur = p_cur->p_next)
+ {
err = _callFromCLCCLine( p_cur->line, call_list + countValidCalls );
- if (err != 0) {
- continue;
- }
+ if (err != 0) {
+ continue;
+ }
co = tcore_call_object_find_by_id( o, call_list[i].info.id );
if ( !co ) {
int err;
int state;
- int mode;
- int isMT;
- char* num;
-
- err = at_tok_start(&line);
- if (err < 0) goto error;
-
-//id
- err = at_tok_nextint(&line, &(p_call->info.id));
- if (err < 0) goto error;
- dbg("id : [%d]\n", p_call->info.id );
-//MO/MTcall
- err = at_tok_nextint(&line, &isMT);
- if (err < 0) goto error;
+ int mode;
+ int isMT;
+ char* num;
+
+ err = at_tok_start(&line);
+ if (err < 0) goto error;
+
+ //id
+ err = at_tok_nextint(&line, &(p_call->info.id));
+ if (err < 0) goto error;
+ dbg("id : [%d]\n", p_call->info.id );
+ //MO/MTcall
+ err = at_tok_nextint(&line, &isMT);
+ if (err < 0) goto error;
+
+ if(isMT ==0)
+ p_call->info.direction = TCORE_CALL_DIRECTION_OUTGOING;
+ else
+ p_call->info.direction = TCORE_CALL_DIRECTION_INCOMING;
- if(isMT ==0)
- p_call->info.direction = TCORE_CALL_DIRECTION_OUTGOING;
- else
- p_call->info.direction = TCORE_CALL_DIRECTION_INCOMING;
-
dbg("direction : [ %d ]\n", p_call->info.direction);
-//state
- err = at_tok_nextint(&line, &state);
- if (err < 0) goto error;
+ //state
+ err = at_tok_nextint(&line, &state);
+ if (err < 0) goto error;
- switch(state){
- case 0: //active
- p_call->info.status = TCORE_CALL_STATUS_ACTIVE;
- break;
- case 1:
- p_call->info.status = TCORE_CALL_STATUS_HELD;
- break;
- case 2:
- p_call->info.status = TCORE_CALL_STATUS_DIALING;
- break;
- case 3:
- p_call->info.status = TCORE_CALL_STATUS_ALERT;
- break;
- case 4:
- p_call->info.status = TCORE_CALL_STATUS_INCOMING;
- break;
- case 5:
- p_call->info.status = TCORE_CALL_STATUS_WAITING;
- break;
- }
+ switch(state){
+ case 0: //active
+ p_call->info.status = TCORE_CALL_STATUS_ACTIVE;
+ break;
+ case 1:
+ p_call->info.status = TCORE_CALL_STATUS_HELD;
+ break;
+ case 2:
+ p_call->info.status = TCORE_CALL_STATUS_DIALING;
+ break;
+ case 3:
+ p_call->info.status = TCORE_CALL_STATUS_ALERT;
+ break;
+ case 4:
+ p_call->info.status = TCORE_CALL_STATUS_INCOMING;
+ break;
+ case 5:
+ p_call->info.status = TCORE_CALL_STATUS_WAITING;
+ break;
+ }
dbg("status : [%d]\n", p_call->info.status );
-
-//mode
- err = at_tok_nextint(&line, &mode);
- if (err < 0) goto error;
-
- switch(mode)
- {
- case 0:
- p_call->info.type = TCORE_CALL_TYPE_VOICE;
- break;
- case 1:
- p_call->info.type = TCORE_CALL_TYPE_VIDEO;
- break;
-
- default: // only Voice/VT call is supported in CS. treat other unknown calls as error
- dbg("invalid type : [%d]\n", mode );
- goto error;
- break;
- }
+ //mode
+ err = at_tok_nextint(&line, &mode);
+ if (err < 0) goto error;
+
+ switch(mode)
+ {
+ case 0:
+ p_call->info.type = TCORE_CALL_TYPE_VOICE;
+ break;
+
+ case 1:
+ p_call->info.type = TCORE_CALL_TYPE_VIDEO;
+ break;
+
+ default: // only Voice/VT call is supported in CS. treat other unknown calls as error
+ dbg("invalid type : [%d]\n", mode );
+ goto error;
+ break;
+ }
dbg("type : [%d]\n", p_call->info.type );
-
- err = at_tok_nextint(&line, &(p_call->info.mpty));
+
+ err = at_tok_nextint(&line, &(p_call->info.mpty));
if (err < 0) goto error;
- dbg("mpty : [%d]\n", p_call->info.mpty );
+ dbg("mpty : [%d]\n", p_call->info.mpty );
- if (at_tok_hasmore(&line)) {
- err = at_tok_nextstr(&line, &num);
+ if (at_tok_hasmore(&line)) {
+ err = at_tok_nextstr(&line, &num);
- /* tolerate null here */
- if (err < 0) return 0;
+ /* tolerate null here */
+ if (err < 0) return 0;
- memcpy(p_call->number, num, strlen(num));
- dbg("number : [ %s ]\n", p_call->number );
+ memcpy(p_call->number, num, strlen(num));
+ dbg("number : [ %s ]\n", p_call->number );
- p_call->info.num_len = strlen(num);
- dbg("num_len : [0x%x]\n", p_call->info.num_len );
+ p_call->info.num_len = strlen(num);
+ dbg("num_len : [0x%x]\n", p_call->info.num_len );
- err = at_tok_nextint(&line, &(p_call->info.num_type));
- if (err < 0) goto error;
- dbg("num_type : [0x%x]\n", p_call->info.num_type );
-
- }
+ err = at_tok_nextint(&line, &(p_call->info.num_type));
+ if (err < 0) goto error;
+ dbg("num_type : [0x%x]\n", p_call->info.num_type );
+
+ }
return 0;
// NOTIFICATION
-static void on_notification_call_waiting( CoreObject *o, const void *data, void *user_data )
+static gboolean on_notification_call_waiting( CoreObject *o, const void *data, void *user_data )
{
TcorePlugin* plugin = NULL;
char* cmd = NULL, *num = NULL;
CallObject *co, *dupco = 0;
- int id, status, err, type, mpty,direction;
+ int id, status, err, type, mpty,direction;
GSList* pList = NULL;
#define LINE_DEFAULT 0
- dbg("call waiting noti : %s", cmd);
+ dbg("call waiting noti : %s", cmd);
plugin = tcore_object_ref_plugin(o);
cmd = (char*)data;
dbg("id: %d, direction : %d, status : %d, type :%d, mpty : %d, num : %s", id,direction,status, type, mpty, num);
}
else {
- dbg("id: %d, direction : %d, status : %d, type :%d, mpty : %d, num : NULL", id,direction,status, type, mpty);
+ dbg("id: %d, direction : %d, status : %d, type :%d, mpty : %d, num : NULL", id,direction,status, type, mpty);
}
// check call with incoming status already exist
pList = tcore_call_object_find_by_status(o, TCORE_CALL_STATUS_WAITING);
if(pList != NULL){
dbg("waiting call already exist. skip");
- return;
+ return TRUE;
}
pList = tcore_call_object_find_by_status(o, TCORE_CALL_STATUS_INCOMING);
if(pList != NULL){
dbg("incoming call already exist. skip");
- return;
+ return TRUE;
}
dupco = tcore_call_object_find_by_id(o, id);
if(dupco!= NULL){
dbg("co with same id already exist. skip");
- return;
+ return TRUE;
}
// make new co, add to list
co = tcore_call_object_new( o, id);
- if ( !co ) {
- dbg("[ error ] co is NULL");
- return ;
- }
+ if ( !co ) {
+ dbg("[ error ] co is NULL");
+ return TRUE;
+ }
tcore_call_object_set_type(co, _call_type(type));
tcore_call_object_set_multiparty_state(co,_call_is_in_mpty(mpty));
tcore_call_object_set_active_line(co, LINE_DEFAULT);
_call_list_get( o, co );
+
+ return TRUE;
}
-static void on_notification_call_incoming( CoreObject *o, const void *data, void *user_data )
+static gboolean on_notification_call_incoming( CoreObject *o, const void *data, void *user_data )
{
TcorePlugin* plugin = NULL;
char* cmd = NULL, *num = NULL;
CallObject *co, *dupco = 0;
- int id, status, err, type, mpty,direction;
+ int id, status, err, type, mpty,direction;
GSList* pList = NULL;
#define LINE_DEFAULT 0
- dbg("call incoming noti : %s", cmd);
+ dbg("call incoming noti : %s", cmd);
plugin = tcore_object_ref_plugin(o);
cmd = (char*)data;
dbg("id: %d, direction : %d, status : %d, type :%d, mpty : %d, num : %s", id,direction,status, type, mpty, num);
}
else {
- dbg("id: %d, direction : %d, status : %d, type :%d, mpty : %d, num : NULL", id,direction,status, type, mpty);
+ dbg("id: %d, direction : %d, status : %d, type :%d, mpty : %d, num : NULL", id,direction,status, type, mpty);
}
// check call with incoming status already exist
pList = tcore_call_object_find_by_status(o, TCORE_CALL_STATUS_INCOMING);
if(pList != NULL){
dbg("incoming call already exist. skip");
- return;
+ return TRUE;
}
dupco = tcore_call_object_find_by_id(o, id);
if(dupco!= NULL){
dbg("co with same id already exist. skip");
- return;
+ return TRUE;
}
// make new co, add to list
co = tcore_call_object_new( o, id);
- if ( !co ) {
- dbg("[ error ] co is NULL");
- return ;
- }
+ if ( !co ) {
+ dbg("[ error ] co is NULL");
+ return TRUE;
+ }
tcore_call_object_set_type(co, _call_type(type));
tcore_call_object_set_multiparty_state(co,_call_is_in_mpty(mpty));
_call_list_get( o, co );
+ return TRUE;
}
-static void on_notification_call_status( CoreObject *o, const void *data, void *user_data)
+static gboolean on_notification_call_status( CoreObject *o, const void *data, void *user_data)
{
char* cmd = NULL, *num = NULL;
TcorePlugin* p = 0;
enum tcore_call_status co_status;
- p = tcore_object_ref_plugin( o );
+ p = tcore_object_ref_plugin( o );
cmd = (char*)data;
at_tok_start(&cmd);
err = at_tok_nextint(&cmd,&type);
err = at_tok_nextint(&cmd,&mpty);
- if(at_tok_hasmore(&cmd)) {
+ if (at_tok_hasmore(&cmd)) {
err = at_tok_nextstr(&cmd,&num);
dbg("id: %d, direction : %d, status : %d, type :%d, mpty : %d, num : %s", id,direction,status, type, mpty, num);
}
- else {
- dbg("id: %d, direction : %d, status : %d, type :%d, mpty : %d, num : NULL", id,direction,status, type, mpty);
+ else {
+ dbg("id: %d, direction : %d, status : %d, type :%d, mpty : %d, num : NULL", id,direction,status, type, mpty);
}
co_status = _call_status(status);
co = tcore_call_object_find_by_id(o,id);
if ( !co ) {
dbg("co is NULL");
- return ;
+ return TRUE;
}
_call_status_active( p, co );
case CALL_STATUS_DIALING:
{
dbg("call(%d) status : [ dialing ]", id);
- co = tcore_call_object_find_by_id(o,id);
+ co = tcore_call_object_find_by_id(o,id);
if ( !co ) {
co = tcore_call_object_new( o, id );
if ( !co ) {
dbg("error : tcore_call_object_new [ id : %d ]", id);
- return ;
+ return TRUE;
}
}
{
dbg("call(%d) status : [ alert ]", id);
- co = tcore_call_object_find_by_id(o, id);
+ co = tcore_call_object_find_by_id(o, id);
if ( !co ) {
dbg("co is NULL");
- return ;
+ return TRUE;
}
_call_list_get( o, co );
default:
break;
- }
+ }
+
+ return TRUE;
}
static TReturn s_call_outgoing( CoreObject *o, UserRequest *ur )
char* raw_str= NULL;
char* cmd_str = NULL;
const char *cclir;
- struct call_confirm_info_t* ci = 0;
struct ATReqMetaInfo metainfo;
int info_len =0;
enum tcore_call_cli_mode clir = CALL_CLI_MODE_DEFAULT;
data = (struct treq_call_dial*)tcore_user_request_ref_data( ur, 0 );
p = tcore_object_ref_plugin( o );
-
- ci = g_new0( struct call_confirm_info_t, 1 );
- ci->co = NULL;
- ci->resp = TRESP_CALL_DIAL;
clir = _get_clir_status( data->number );
-//Compose ATCmd string
- switch (clir)
+//Compose ATCmd string
+ switch (clir)
{
- case TCORE_CALL_CLI_MODE_PRESENT:
+ case TCORE_CALL_CLI_MODE_PRESENT:
cclir = "I";
break; /*invocation*/
- case TCORE_CALL_CLI_MODE_RESTRICT:
- cclir = "i";
+ case TCORE_CALL_CLI_MODE_RESTRICT:
+ cclir = "i";
break; /*suppression*/
case TCORE_CALL_CLI_MODE_DEFAULT:
default:
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
- ret = _call_request_message ( o, ur, cmd_str, strlen(cmd_str), on_confirmation_call_request, ci);
+ ret = _call_request_message ( o, ur, cmd_str, strlen(cmd_str), on_confirmation_call_outgoing, co);
free(raw_str);
- free(cmd_str);
-
+ free(cmd_str);
+
if ( !ret ) {
tcore_call_object_free( o, co );
return TCORE_RETURN_FAILURE;
{
CallObject* co = 0;
struct treq_call_answer* data = 0;
-// unsigned int ipc_size = 0;
gboolean ret = FALSE;
char* cmd_str = NULL;
struct ATReqMetaInfo metainfo ;
unsigned int info_len =0;
-
- struct call_confirm_info_t* ci = 0;
-
data = (struct treq_call_answer*)tcore_user_request_ref_data( ur, 0 );
co = tcore_call_object_find_by_id( o, data->id );
- ci = g_new0( struct call_confirm_info_t, 1 );
- ci->co = co;
- ci->resp = TRESP_CALL_ANSWER;
-
-
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
//set metainfo
if ( data->type == CALL_ANSWER_TYPE_ACCEPT ) {
cmd_str = g_strdup_printf("%s%s","ATA","\r");
- ret = _call_request_message ( o, ur, (void*)cmd_str, strlen(cmd_str), on_confirmation_call_request, ci);
+ ret = _call_request_message ( o, ur, (void*)cmd_str, strlen(cmd_str), on_confirmation_call_accept, co);
free(cmd_str);
if ( !ret )
return TCORE_RETURN_FAILURE;
switch ( data->type ) {
case CALL_ANSWER_TYPE_REJECT: {
dbg("call answer reject");
- tcore_call_control_answer_reject( o, ur, on_confirmation_call_request, ci );
+ tcore_call_control_answer_reject( o, ur, on_confirmation_call_reject, co );
} break;
case CALL_ANSWER_TYPE_REPLACE: {
dbg("call answer replace");
- tcore_call_control_answer_replace( o, ur, on_confirmation_call_request, ci );
+ tcore_call_control_answer_replace( o, ur, on_confirmation_call_replace, co );
} break;
case CALL_ANSWER_TYPE_HOLD_ACCEPT: {
dbg("call answer hold and accept");
- tcore_call_control_answer_hold_and_accept( o, ur, on_confirmation_call_hold_and_accept, ci );
+ tcore_call_control_answer_hold_and_accept( o, ur, on_confirmation_call_hold_and_accept, co );
} break;
default :
CallObject* co = 0;
struct treq_call_end* data = 0;
- struct call_confirm_info_t* ci = 0;
gboolean ret = FALSE;
UserRequest* ur_dup = 0;
co = tcore_call_object_find_by_id( o, data->id );
- ci = g_new0( struct call_confirm_info_t, 1 );
- ci->co = co;
-
if ( data->type == CALL_END_TYPE_ALL ) {
- ci->resp = TRESP_CALL_END_ALL;
-
- //releaseAll do not exist on legacy request. send CHLD=0, CHLD=1 in sequence
- chld0_cmd = g_strdup("AT+CHLD=0\r");
- chld1_cmd = g_strdup("AT+CHLD=1\r");
+ //releaseAll do not exist on legacy request. send CHLD=0, CHLD=1 in sequence
+ chld0_cmd = g_strdup("AT+CHLD=0\r");
+ chld1_cmd = g_strdup("AT+CHLD=1\r");
memset(&metainfo1, 0, sizeof(struct ATReqMetaInfo));
memset(&metainfo2, 0, sizeof(struct ATReqMetaInfo));
free(chld0_cmd);
if ( !ret )
return TCORE_RETURN_FAILURE;
-
- ret = _call_request_message(o, ur, chld1_cmd, strlen(chld1_cmd), on_confirmation_call_request, ci);
+
+ ret = _call_request_message(o, ur, chld1_cmd, strlen(chld1_cmd), on_confirmation_call_release_all, co);
free(chld1_cmd);
if ( !ret )
- return TCORE_RETURN_FAILURE;
+ return TCORE_RETURN_FAILURE;
} else {
int id = 0;
id = tcore_call_object_get_id( co );
- ci->resp = TRESP_CALL_END;
-
dbg("call end call id [%d]", id);
- tcore_call_control_end_specific( o, ur, id, on_confirmation_call_request, ci );
+ tcore_call_control_end_specific( o, ur, id, on_confirmation_call_release_specific, co );
} break;
case CALL_END_TYPE_ACTIVE_ALL: {
- ci->resp = TRESP_CALL_END_ALL_ACTIVE;
-
dbg("call end all active");
- tcore_call_control_end_all_active( o, ur, on_confirmation_call_request, ci );
+ tcore_call_control_end_all_active( o, ur, on_confirmation_call_release_all_active, co );
} break;
case TCORE_CALL_END_ALL_HELD: {
- ci->resp = TRESP_CALL_END_ALL_HELD;
-
dbg("call end all held");
- tcore_call_control_end_all_held( o, ur, on_confirmation_call_request, ci );
+ tcore_call_control_end_all_held( o, ur, on_confirmation_call_release_all_held, co );
} break;
default :
static TReturn s_call_hold( CoreObject *o, UserRequest *ur )
{
- struct call_confirm_info_t* ci = 0;
- unsigned int *id = 0;
- id = (unsigned int*)tcore_user_request_ref_data( ur, 0 );
+ struct treq_call_hold *hold = 0;
+ CallObject *co = 0;
- ci = g_new0( struct call_confirm_info_t, 1 );
+ hold = (struct treq_call_hold*)tcore_user_request_ref_data( ur, 0 );
- dbg("call id : [ %d ]", *id);
+ dbg("call id : [ %d ]", hold->id);
- ci->co = tcore_call_object_find_by_id( o, *id );
- ci->resp = TRESP_CALL_HOLD;
+ co = tcore_call_object_find_by_id( o, hold->id );
- tcore_call_control_hold( o, ur, on_confirmation_call_hold, ci );
+ tcore_call_control_hold( o, ur, on_confirmation_call_hold, co );
return TCORE_RETURN_SUCCESS;
}
static TReturn s_call_active( CoreObject *o, UserRequest *ur )
{
- struct call_confirm_info_t* ci = 0;
- unsigned int *id = 0;
- id = (unsigned int*)tcore_user_request_ref_data( ur, 0 );
+ struct treq_call_active *active = 0;
+ CallObject *co = 0;
- ci = g_new0( struct call_confirm_info_t, 1 );
+ active = (struct treq_call_active*)tcore_user_request_ref_data( ur, 0 );
- dbg("call id : [ %d ]", *id);
+ dbg("call id : [ %d ]", active->id);
- ci->co = tcore_call_object_find_by_id( o, *id );
- ci->resp = TRESP_CALL_ACTIVE;
+ co = tcore_call_object_find_by_id( o, active->id );
- tcore_call_control_active( o, ur, on_confirmation_call_request, ci );
+ tcore_call_control_active( o, ur, on_confirmation_call_active, co );
return TCORE_RETURN_SUCCESS;
}
static TReturn s_call_swap( CoreObject *o, UserRequest *ur )
{
- struct call_confirm_info_t* ci = 0;
- unsigned int *id = 0;
- id = (unsigned int*)tcore_user_request_ref_data( ur, 0 );
-
- ci = g_new0( struct call_confirm_info_t, 1 );
+ struct treq_call_swap *swap = 0;
+ CallObject *co = 0;
+ swap = (struct treq_call_swap*)tcore_user_request_ref_data( ur, 0 );
- dbg("call id : [ %d ]", *id);
+ dbg("call id : [ %d ]", swap->id);
- ci->co = tcore_call_object_find_by_id( o, *id );
- ci->resp = TRESP_CALL_SWAP;
+ co = tcore_call_object_find_by_id( o, swap->id );
- tcore_call_control_swap( o, ur, on_confirmation_call_swap, ci );
+ tcore_call_control_swap( o, ur, on_confirmation_call_swap, co );
return TCORE_RETURN_SUCCESS;
}
static TReturn s_call_join( CoreObject *o, UserRequest *ur )
{
- struct call_confirm_info_t* ci = 0;
- unsigned int *id = 0;
- id = (unsigned int*)tcore_user_request_ref_data( ur, 0 );
+ struct treq_call_join *join = 0;
+ CallObject *co = 0;
- ci = g_new0( struct call_confirm_info_t, 1 );
+ join = (struct treq_call_join*)tcore_user_request_ref_data( ur, 0 );
- dbg("call id : [ %d ]", *id);
+ dbg("call id : [ %d ]", join->id);
- ci->co = tcore_call_object_find_by_id( o, *id );
- ci->resp = TRESP_CALL_JOIN;
+ co = tcore_call_object_find_by_id( o, join->id );
- tcore_call_control_join( o, ur, on_confirmation_call_request, ci );
+ tcore_call_control_join( o, ur, on_confirmation_call_join, co );
return TCORE_RETURN_SUCCESS;
}
static TReturn s_call_split( CoreObject *o, UserRequest *ur )
{
- struct call_confirm_info_t* ci = 0;
- unsigned int *id = 0;
+ struct treq_call_split *split = 0;
+ CallObject *co = 0;
- ci = g_new0( struct call_confirm_info_t, 1 );
+ split = (struct treq_call_split*)tcore_user_request_ref_data( ur, 0 );
- id = (unsigned int *)tcore_user_request_ref_data( ur, 0 );
- ci->co = tcore_call_object_find_by_id ( o, *id );
- ci->resp = TRESP_CALL_SPLIT;
+ co = tcore_call_object_find_by_id ( o, split->id );
- tcore_call_control_split( o, ur, *id, on_confirmation_call_split, ci );
+ tcore_call_control_split( o, ur, split->id, on_confirmation_call_split, co );
return TCORE_RETURN_SUCCESS;
}
static TReturn s_call_deflect( CoreObject *o, UserRequest *ur )
{
- struct call_confirm_info_t* ci = 0;
- char *number = 0;
+ struct treq_call_deflect *deflect = 0;
+ CallObject *co = 0;
- ci = g_new0( struct call_confirm_info_t, 1 );
- number = (char*)tcore_user_request_ref_data( ur, 0 );
+ deflect = (struct treq_call_deflect*)tcore_user_request_ref_data( ur, 0 );
- ci->co = tcore_call_object_find_by_number( o, number );
- ci->resp = TRESP_CALL_DEFLECT;
+ co = tcore_call_object_find_by_number( o, deflect->number );
- tcore_call_control_deflect( o, ur, number, on_confirmation_call_request, ci );
+ tcore_call_control_deflect( o, ur, deflect->number, on_confirmation_call_deflect, co );
return TCORE_RETURN_SUCCESS;
}
static TReturn s_call_transfer( CoreObject *o, UserRequest *ur )
{
- struct call_confirm_info_t* ci = 0;
- unsigned int *id = 0;
- id = (unsigned int*)tcore_user_request_ref_data( ur, 0 );
+ struct treq_call_transfer *transfer = 0;
+ CallObject *co = 0;
- ci = g_new0( struct call_confirm_info_t, 1 );
+ transfer = (struct treq_call_transfer*)tcore_user_request_ref_data( ur, 0 );
- dbg("call id : [ %d ]", *id);
+ dbg("call id : [ %d ]", transfer->id);
- ci->co = tcore_call_object_find_by_id( o, *id );
- ci->resp = TRESP_CALL_TRANSFER;
+ co = tcore_call_object_find_by_id( o, transfer->id );
- tcore_call_control_transfer( o, ur, on_confirmation_call_request, ci );
+ tcore_call_control_transfer( o, ur, on_confirmation_call_transfer, co );
return TCORE_RETURN_SUCCESS;
}
static TReturn s_call_send_dtmf( CoreObject *o, UserRequest *ur )
{
- struct call_confirm_info_t* ci = 0;
- ci = g_new0( struct call_confirm_info_t, 1 );
-
- ci->co = 0;
- ci->resp = TRESP_CALL_SEND_DTMF;
-
return TCORE_RETURN_SUCCESS;
}
return TCORE_RETURN_SUCCESS;
}
-
static struct tcore_call_operations call_ops = {
.dial = s_call_outgoing,
.answer = s_call_answer,
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_WAITING,
sizeof(unsigned int),
}
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_FORWARDED,
sizeof(unsigned int),
}
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_BARRED_INCOMING,
sizeof(unsigned int),
}
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_BARRED_OUTGOING,
sizeof(unsigned int),
}
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_DEFLECTED,
sizeof(unsigned int),
}
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_CLIR_SUPPRESSION_REJECT,
sizeof(unsigned int),
}
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_FORWARD_UNCONDITIONAL,
sizeof(unsigned int),
}
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_FORWARD_CONDITIONAL,
sizeof(unsigned int),
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_FORWARDED_CALL,
sizeof(unsigned int),
(void*)&id );
}
-static void s_call_info_mt_deflected_call( CoreObject *o, char* number )
+static void s_call_info_mt_deflected_call( CoreObject *o, char* number )
{
CallObject *co = 0;
int id = 0;
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_DEFLECTED_CALL,
sizeof(unsigned int),
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_TRANSFERED_CALL,
sizeof(unsigned int),
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_HELD,
sizeof(unsigned int),
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_ACTIVE,
sizeof(unsigned int),
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_JOINED,
sizeof(unsigned int),
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_RELEASED_ON_HOLD,
sizeof(unsigned int),
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_TRANSFER_ALERT,
sizeof(unsigned int),
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_TRANSFERED,
sizeof(unsigned int),
id = tcore_call_object_get_id( co );
- tcore_server_send_notification( tcore_plugin_ref_server(p),
+ tcore_server_send_notification( tcore_plugin_ref_server(p),
tcore_plugin_ref_core_object(p, "call"),
TNOTI_CALL_INFO_CF_CHECK_MESSAGE,
sizeof(unsigned int),
static struct tcore_call_information_operations call_information_ops = {
- .mo_call_col = 0,
+ .mo_call_col = 0,
.mo_call_waiting = s_call_info_mo_waiting,
.mo_call_cug = 0,
.mo_call_forwarded = s_call_info_mo_forwarded,
.call_cf_check_message = s_call_info_cf_check_message,
};
-gboolean s_call_init( TcorePlugin *p )
+gboolean s_call_init(TcorePlugin *p, TcoreHal *h)
{
CoreObject *o = NULL;
// TcoreHal *h = NULL;
struct property_call_info *data = NULL;
- o = tcore_call_new( p, "call", &call_ops );
+ o = tcore_call_new(p, "call", &call_ops, h);
if (!o)
return FALSE;
return FALSE;
wqd->id = id;
- wqd->ur = tcore_user_request_dup(ur);
+ wqd->ur = tcore_user_request_ref(ur);
g_queue_push_tail(queue, wqd);
dbg("id = %d, ur = 0x%x", wqd->id, wqd->ur);
if((metainfo->type == SINGLELINE)||
(metainfo->type == MULTILINE))
{
- //cp rsp prefix
+ //cp rsp prefix
s_responsePrefix = strdup(metainfo->responsePrefix);
- dbg("duplicating responsePrefix : %s\n", s_responsePrefix);
+ dbg("duplicating responsePrefix : %s\n", s_responsePrefix);
}
else
{
dbg("SEND OK");
}
}
-static void on_sys_event_modem_power(CoreObject *o, const void *event_info, void *user_data)
+static gboolean on_sys_event_modem_power(CoreObject *o, const void *event_info, void *user_data)
{
struct tnoti_modem_power modem_power;
enum cp_state *state;
} else {
dbg("useless state : (0x%x)", *state);
- return ;
+ return TRUE;
}
tcore_server_send_notification(tcore_plugin_ref_server(tcore_object_ref_plugin(o)), o, TNOTI_MODEM_POWER,
sizeof(struct tnoti_modem_power), &modem_power);
+
+ return TRUE;
}
-static void on_event_modem_power(CoreObject *o, const void *event_info, void *user_data)
+static gboolean on_event_modem_power(CoreObject *o, const void *event_info, void *user_data)
{
struct treq_modem_set_flightmode flight_mode_set;
struct tnoti_modem_power modem_power;
strg = tcore_server_find_storage(tcore_plugin_ref_server(tcore_object_ref_plugin(o)), "vconf");
flight_mode_set.enable = tcore_storage_get_bool(strg, STORAGE_KEY_SETAPPL_FLIGHT_MODE_BOOL);
- h = tcore_plugin_ref_hal(tcore_object_ref_plugin(o));
+ h = tcore_object_get_hal(o);
tcore_hal_set_power_state(h, TRUE);
tcore_server_send_notification(tcore_plugin_ref_server(tcore_object_ref_plugin(o)), o, TNOTI_MODEM_POWER,
sizeof(struct tnoti_modem_power), &modem_power);
+
+ return TRUE;
}
-static void on_event_modem_phone_state(CoreObject *o, const void *event_info, void *user_data)
+static gboolean on_event_modem_phone_state(CoreObject *o, const void *event_info, void *user_data)
{
char* line = (char*)event_info;
GQueue *queue;
tcore_server_send_notification(tcore_plugin_ref_server(tcore_object_ref_plugin(o)), o, TNOTI_MODEM_FLIGHT_MODE,
sizeof(struct tnoti_modem_flight_mode), &modem_flight_mode);
+
+ return TRUE;
}
static void on_response_poweron(TcorePending *p, int data_len, const void *data, void *user_data)
{
int response = 0;
int err;
-#define CPAS_RES_READY 0
-#define CPAS_RES_UNAVAIL 1
+#define CPAS_RES_READY 0
+#define CPAS_RES_UNAVAIL 1
#define CPAS_RES_UNKNOWN 2
#define CPAS_RES_RINGING 3
#define CPAS_RES_CALL_PROGRESS 4
//print sp_response - for debug
printResponse();
- if(sp_response->success > 0){
+ if(sp_response->success > 0){
dbg("RESPONSE OK");
//parse response
line = sp_response->p_intermediates->line;
switch(response)
{
case CPAS_RES_READY:
- case CPAS_RES_RINGING:
+ case CPAS_RES_RINGING:
case CPAS_RES_CALL_PROGRESS:
case CPAS_RES_ASLEEP:
bpoweron = TRUE;
dbg("CPAS once again");
s_modem_send_poweron(tcore_object_ref_plugin(tcore_pending_ref_core_object(p)));
- }
+ }
}
static void on_response_set_flight_mode(TcorePending *p, int data_len, const void *data, void *user_data)
ur = tcore_pending_ref_user_request(p);
if(sp_response->success > 0)
- {
+ {
dbg("RESPONSE OK");
//parse response
queue = tcore_object_ref_user_data(o);
- if (queue)
+ if (queue)
{
- ur = tcore_user_request_dup(ur);
+ ur = tcore_user_request_ref(ur);
util_add_waiting_job(queue, ID_RESERVED_AT, ur);
}
ReleaseResponse();
- }
+ }
else
{
dbg("RESPONSE NOK");
line = sp_response->finalResponse;
err = at_tok_start(&line);
- if (err < 0)
+ if (err < 0)
{
dbg("err cause not specified or string corrupted");
- res.result = TCORE_RETURN_3GPP_ERROR;
+ res.result = TCORE_RETURN_3GPP_ERROR;
}
else
{
err = at_tok_nextint(&line, &response);
- if (err < 0)
+ if (err < 0)
{
dbg("err not specified or string not contail error");
- res.result = TCORE_RETURN_3GPP_ERROR;
+ res.result = TCORE_RETURN_3GPP_ERROR;
}
else
{
- res.result = convertCMEError((enum ATCMEError)response);
+ res.result = convertCMEError((enum ATCMEError)response);
}
ReleaseResponse();
-
+
tcore_user_request_send_response(ur, TRESP_MODEM_SET_FLIGHTMODE, sizeof(struct tresp_modem_set_flightmode), &res);
}
}
char *line;
int response;
int err;
-
+
printResponse();
memset(&res, 0, sizeof(struct tresp_modem_get_imei));
strncpy(res.imei, line, 16);
dbg("imei = [%s]", res.imei);
-
+
plugin = tcore_pending_ref_plugin(p);
imei_property = tcore_plugin_ref_property(plugin, "IMEI");
- if (imei_property)
+ if (imei_property)
{
imei_property->sn_index = TAPI_MISC_ME_IMEI;
imei_property->sn_len = strlen(res.imei);
line = sp_response->finalResponse;
err = at_tok_start(&line);
- if (err < 0)
+ if (err < 0)
{
dbg("err cause not specified or string corrupted");
res.result = TCORE_RETURN_3GPP_ERROR;
else
{
err = at_tok_nextint(&line, &response);
- if (err < 0)
+ if (err < 0)
{
dbg("err not specified or string not contail error");
- res.result = TCORE_RETURN_3GPP_ERROR;
+ res.result = TCORE_RETURN_3GPP_ERROR;
}
else
{
- res.result = convertCMEError((enum ATCMEError)response);
+ res.result = convertCMEError((enum ATCMEError)response);
}
}
}
-
+
ReleaseResponse();
-
+
ur = tcore_pending_ref_user_request(p);
tcore_user_request_send_response(ur, TRESP_MODEM_GET_IMEI, sizeof(struct tresp_modem_get_imei), &res);
struct TelMiscVersionInformation *vi_property;
struct tresp_modem_get_version res;
UserRequest *ur;
- char* line=NULL;
+ char* line=NULL;
char *swver= NULL,*hwver=NULL, *caldate=NULL,*pcode=NULL,*id=NULL;
int response, err;
err = at_tok_nextstr(&line,&id);
dbg("version: sw=[%s], hw=[%s], rf_cal=[%s], product_code=[%s], model_id=[%s]", swver, hwver, caldate, pcode, id);
-
+
vi = calloc(sizeof(struct TelMiscVersionInformation), 1);
memcpy(vi->szSwVersion, swver, strlen(swver));
memcpy(vi->szHwVersion, hwver, strlen(hwver));
snprintf(res.hardware, (AT_VER_LEN >strlen(hwver) ?strlen(hwver):AT_VER_LEN), "%s", hwver);
plugin = tcore_pending_ref_plugin(p);
- vi_property = tcore_plugin_ref_property(plugin, "VERSION");
+ vi_property = tcore_plugin_ref_property(plugin, "VERSION");
memcpy(vi_property, vi, sizeof(struct TelMiscVersionInformation));
}
else
memset(&res, 0, sizeof(struct tresp_modem_get_version));
err = at_tok_start(&line);
- if (err < 0)
+ if (err < 0)
{
dbg("err cause not specified or string corrupted");
res.result = TCORE_RETURN_3GPP_ERROR;
else
{
err = at_tok_nextint(&line, &response);
- if (err < 0)
+ if (err < 0)
{
dbg("err not specified or string not contail error");
- res.result = TCORE_RETURN_3GPP_ERROR;
+ res.result = TCORE_RETURN_3GPP_ERROR;
}
else
{
- res.result = convertCMEError((enum ATCMEError)response);
+ res.result = convertCMEError((enum ATCMEError)response);
}
}
- }
+ }
ReleaseResponse();
ur = tcore_pending_ref_user_request(p);
tcore_user_request_send_response(ur, TRESP_MODEM_GET_VERSION, sizeof(struct tresp_modem_get_version), &res);
-
+
}
static TReturn power_on(CoreObject *o, UserRequest *ur)
static TReturn power_off(CoreObject *o, UserRequest *ur)
{
+ struct tnoti_modem_power modem_power;
+ modem_power.state = MODEM_STATE_OFFLINE;
+
+ tcore_modem_set_powered(o, FALSE);
+
+ tcore_server_send_notification( tcore_plugin_ref_server(tcore_object_ref_plugin(o)), o, TNOTI_MODEM_POWER,
+ sizeof(struct tnoti_modem_power), &modem_power);
+
return TCORE_RETURN_SUCCESS;
}
static TReturn power_reset(CoreObject *o, UserRequest *ur)
int info_len =0;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = NUMERIC;
tcore_pending_set_priority(pending, TCORE_PENDING_PRIORITY_DEFAULT);
tcore_pending_set_send_callback(pending, on_confirmation_modem_message_send, NULL);
-
+
tcore_hal_send_request(h, pending);
struct ATReqMetaInfo metainfo;
int info_len =0;
- p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ p = tcore_object_ref_plugin(o);
+ h = tcore_object_get_hal(o);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = SINGLELINE;
cmd_str = g_strdup("AT+CGMR\r");
- dbg("cmd : %s, prefix(if any) : %s, cmd_len : %d",cmd_str, "N/A", strlen(cmd_str));
-
+ dbg("cmd : %s, prefix(if any) : %s, cmd_len : %d",cmd_str, "N/A", strlen(cmd_str));
+
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
free(cmd_str);
int info_len =0;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
req_data = tcore_user_request_ref_data(ur, NULL);
-
if (req_data->enable) {
dbg("Flight mode on/n");
cmd_str = g_strdup("AT+CFUN=0\r");
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
- dbg("cmd : %s, prefix(if any) : %s, cmd_len : %d",cmd_str, "N/A", strlen(cmd_str));
+ dbg("cmd : %s, prefix(if any) : %s, cmd_len : %d",cmd_str, "N/A", strlen(cmd_str));
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
.get_version = get_version,
};
-gboolean s_modem_init(TcorePlugin *p)
+gboolean s_modem_init(TcorePlugin *p, TcoreHal *h)
{
CoreObject *o;
GQueue *work_queue;
struct TelMiscVersionInformation *vi_property;
struct TelMiscSNInformation *imei_property;
- o = tcore_modem_new(p, "modem", &modem_ops);
+ o = tcore_modem_new(p, "modem", &modem_ops, h);
if (!o)
return FALSE;
char* cmd_str = NULL;
struct ATReqMetaInfo metainfo;
int info_len =0;
-
+
ur = tcore_user_request_new(NULL, NULL);
- hal = tcore_plugin_ref_hal(p);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = SINGLELINE;
dbg("cmd : %s, prefix(if any) :%s, cmd_len : %d",cmd_str, metainfo.responsePrefix, strlen(cmd_str));
o = tcore_plugin_ref_core_object(p, "modem");
-
+ hal = tcore_object_get_hal(o);
+
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
free(cmd_str);
TcorePending *pending = NULL;
plugin = tcore_object_ref_plugin(o);
- hal = tcore_plugin_ref_hal(plugin);
+ hal = tcore_object_get_hal(o);
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(atcmd), atcmd);
return;
}
-static void on_event_network_regist(CoreObject *o, const void *event_info, void *user_data)
+static gboolean on_event_network_regist(CoreObject *o, const void *event_info, void *user_data)
{
struct tnoti_network_registration_status regist_status;
enum telephony_network_service_domain_status cs_status;
else if (strStartsWith(line,"+CGREG:"))
svc_domain = NETWORK_SERVICE_DOMAIN_PS;
else
- return;
+ return TRUE;
dbg("svc_domain = 0x%x", svc_domain);
TNOTI_NETWORK_REGISTRATION_STATUS, sizeof(struct tnoti_network_registration_status), ®ist_status);
get_serving_network(o, NULL);
+
+ return TRUE;
}
-static void on_event_network_icon_info(CoreObject *o, const void *event_info, void *user_data)
+static gboolean on_event_network_icon_info(CoreObject *o, const void *event_info, void *user_data)
{
char *line = (char *)event_info;
static struct tnoti_network_icon_info net_icon_info = {0xff,0,0,0};
case CIND_NOTI_RSSI:
dbg("CIND_NOTI_RSSI. ind=%d",ind);
net_icon_info.rssi = ind;
- break;
+ break;
case CIND_NOTI_BATTERY:
dbg("CIND_NOTI_BATTERY. ind=%d",ind);
net_icon_info.battery = ind;
- break;
+ break;
default:
err("This event is not handled val=%d",descr);
- return;
+ return TRUE;
}
+
dbg("type=%d, rssi=%d, battery=%d, hdr_rssi=%d",
- net_icon_info.type, net_icon_info.rssi, net_icon_info.battery, net_icon_info.hdr_rssi);
+ net_icon_info.type, net_icon_info.rssi, net_icon_info.battery, net_icon_info.hdr_rssi);
+
tcore_server_send_notification(tcore_plugin_ref_server(tcore_object_ref_plugin(o)), o, TNOTI_NETWORK_ICON_INFO,
sizeof(struct tnoti_network_icon_info), &net_icon_info);
+
+ return TRUE;
}
static void on_sim_resp_hook_get_netname(UserRequest *ur, enum tcore_response_command command, unsigned int data_len,
.get_serving_network = get_serving_network,
};
-gboolean s_network_init(TcorePlugin *plugin)
+gboolean s_network_init(TcorePlugin *plugin, TcoreHal *h)
{
CoreObject *o;
- o = tcore_network_new(plugin, "umts_network", &network_ops);
+ o = tcore_network_new(plugin, "umts_network", &network_ops, h);
if (!o)
return FALSE;
metainfo = (struct ATReqMetaInfo*)tcore_user_request_ref_metainfo(ur,&info_len);
if ((metainfo->type == SINGLELINE)||(metainfo->type == MULTILINE)) {
- //cp rsp prefix
+ //cp rsp prefix
s_responsePrefix = strdup(metainfo->responsePrefix);
- dbg("duplicating responsePrefix : %s\n", s_responsePrefix);
+ dbg("duplicating responsePrefix : %s\n", s_responsePrefix);
}
else {
s_responsePrefix = NULL;
char *line = NULL, *ip = NULL, *gateway = NULL;//, *netmask = NULL;
/* count the PDP contexts */
- for (pdpContextCnt = 0, p_cur = p_response->p_intermediates
- ; p_cur != NULL
- ; p_cur = p_cur->p_next) {
- pdpContextCnt++;
- }
-
- dbg("Total number of PDP contexts : %d",pdpContextCnt);
-
- if(pdpContextCnt == 0)
+ for (pdpContextCnt = 0, p_cur = p_response->p_intermediates
+ ; p_cur != NULL
+ ; p_cur = p_cur->p_next) {
+ pdpContextCnt++;
+ }
+
+ dbg("Total number of PDP contexts : %d",pdpContextCnt);
+
+ if(pdpContextCnt == 0)
return;
for (p_cur = p_response->p_intermediates
- ; p_cur != NULL
- ; p_cur = p_cur->p_next) {
+ ; p_cur != NULL
+ ; p_cur = p_cur->p_next) {
line = p_response->p_intermediates->line;
-
+
err = at_tok_start(&line);
err = at_tok_nextint(&line,&p_cid);
dbg("cid: %d", p_cid);
-
+
/* Send IP Configuration noti only on the requested CID. */
if (p_cid && (cid == (unsigned int)p_cid)) {
err = at_tok_nextstr(&line,&pdp_type);
dbg("inet_pton() failed.");
return;
}
-
+
snprintf(addr_buf[0], 20, "%d.%d.%d.%d", noti.ip_address[0], noti.ip_address[1],
noti.ip_address[2], noti.ip_address[3]);
ip = addr_buf[0];
gateway = addr_buf[3];
dbg("gateway = [%s]", gateway);
- /* FIX ME: use static netmask. */
+ /* FIX ME: use static netmask. */
noti.subnet_mask[0] = 255;
noti.subnet_mask[1] = 255;
noti.subnet_mask[2] = 255;
struct ATLine *p_cur;
CoreObject *ps_context = (CoreObject *)user_data;
char *line = NULL;
-
+
printResponse();
if (sp_response->success > 0) {
dbg("RESPONSE OK");
-
+
for (p_cur = sp_response->p_intermediates
- ; p_cur != NULL
- ; p_cur = p_cur->p_next) {
+ ; p_cur != NULL
+ ; p_cur = p_cur->p_next) {
line = sp_response->p_intermediates->line;
dbg("%s\n", line);
}
-
+
dbg("Call on_ipc_event_ps_ipconfiguration");
on_event_ps_ipconfiguration(tcore_pending_ref_core_object(pending), sp_response, ps_context);
}
dbg("RESPONSE OK");
line = sp_response->p_intermediates->line;
dbg("on_response_ps_attached: %s", line);
-
+
ur = tcore_user_request_new(NULL, NULL);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
memcpy(metainfo.responsePrefix,"+CGDCONT:",strlen("+CGDCONT:"));
cmd_str = g_strdup("AT+CGDCONT?\r");
pl = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(pl);
+ h = tcore_object_get_hal(o);
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
free(cmd_str);
-
+
tcore_pending_set_timeout(pending, 0);
tcore_pending_set_response_callback(pending, on_response_get_ipconfiguration, ps_context);
tcore_pending_link_user_request(pending, ur);
tcore_pending_set_priority(pending, TCORE_PENDING_PRIORITY_DEFAULT);
tcore_pending_set_send_callback(pending, on_confirmation_ps_message_send, NULL);
- tcore_hal_send_request(h, pending);
+ tcore_hal_send_request(h, pending);
}
else {
dbg("RESPONSE NOK");
}
-
+
ReleaseResponse();
}
char* cmd_str = NULL;
struct ATReqMetaInfo metainfo;
int info_len =0;
-
+
printResponse();
if (sp_response->success > 0) {
info_len = sizeof(struct ATReqMetaInfo);
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
-
+
dbg(" Send: ATD*99***1#\r ");
cmd_str = g_strdup("ATD*99***1#\r");
pl = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(pl);
+ h = tcore_object_get_hal(o);
pending = tcore_pending_new(o, ID_RESERVED_AT);
-
+
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
free(cmd_str);
tcore_pending_set_timeout(pending, 0);
- tcore_pending_set_response_callback(pending, on_response_ps_attached, ps_context);
+ tcore_pending_set_response_callback(pending, on_response_ps_attached, ps_context);
tcore_pending_link_user_request(pending, ur);
tcore_pending_set_priority(pending, TCORE_PENDING_PRIORITY_DEFAULT);
tcore_pending_set_send_callback(pending, on_confirmation_ps_message_send, NULL);
else {
dbg("RESPONSE NOK");
tcore_context_set_state(ps_context, CONTEXT_STATE_DEACTIVATED);
- }
+ }
ReleaseResponse();
}
}
else {
dbg("RESPONSE NOK");
- }
+ }
ReleaseResponse();
}
{
TcorePlugin *p = NULL;
TcoreHal *h = NULL;
- TcorePending *pending = NULL;
+ TcorePending *pending = NULL;
UserRequest *ur;
unsigned int cid;
- char* cmd_str = NULL;
+ char* cmd_str = NULL;
struct ATReqMetaInfo metainfo;
int info_len =0;
-
+
if ( !o )
return TCORE_RETURN_FAILURE;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
-
- ur = tcore_user_request_new(NULL, NULL);
+
+ ur = tcore_user_request_new(NULL, NULL);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = NO_RESULT;
info_len = sizeof(struct ATReqMetaInfo);
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
-
+
cid = tcore_context_get_id(ps_context);
-
+
dbg("Example: AT+CGACT=1,0");
cmd_str = g_strdup_printf("%s=%d,%d%s","AT+CGACT", 1, cid, "\r");
-
+
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
free(cmd_str);
tcore_pending_set_timeout(pending, 0);
- tcore_pending_set_response_callback(pending, on_response_active_set, ps_context);
+ tcore_pending_set_response_callback(pending, on_response_active_set, ps_context);
tcore_pending_link_user_request(pending, ur);
tcore_pending_set_priority(pending, TCORE_PENDING_PRIORITY_DEFAULT);
tcore_pending_set_send_callback(pending, on_confirmation_ps_message_send, NULL);
printResponse();
if (sp_response->success > 0) {
- dbg("RESPONSE OK");
+ dbg("RESPONSE OK");
pdp_active_set(tcore_pending_ref_core_object(p), ps_context);
}
else {
dbg("RESPONSE NOK");
tcore_context_set_state(tcore_pending_ref_core_object(p), CONTEXT_STATE_DEACTIVATED);
- }
+ }
ReleaseResponse();
}
unsigned int cid;
enum co_context_type pdp_type;
enum co_context_d_comp d_comp;
- enum co_context_h_comp h_comp;
+ enum co_context_h_comp h_comp;
char *cmd_str = NULL;
struct ATReqMetaInfo metainfo;
- int info_len =0;
+ int info_len =0;
if ( !o )
return TCORE_RETURN_FAILURE;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
ur = tcore_user_request_new(NULL, NULL);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = NO_RESULT;
pdp_type = tcore_context_get_type(ps_context);
d_comp = tcore_context_get_data_compression(ps_context);
h_comp = tcore_context_get_header_compression(ps_context);
-
+
dbg("Example: AT+CGDCONT=1,\"IP\",\"www.example.co.kr\",,0,0");
- cmd_str = g_strdup_printf("AT+CGDCONT=%d,\"%d\",\"%s\",%s,%d,%d%s",
- cid, pdp_type, apn, addr, d_comp, h_comp, "\r");
+ cmd_str = g_strdup_printf("AT+CGDCONT=%d,\"%d\",\"%s\",%s,%d,%d%s",
+ cid, pdp_type, apn, addr, d_comp, h_comp, "\r");
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
UserRequest *ur;
unsigned int cid;
- char* cmd_str = NULL;
+ char* cmd_str = NULL;
struct ATReqMetaInfo metainfo;
- int info_len =0;
+ int info_len =0;
if ( !o )
return TCORE_RETURN_FAILURE;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
ur = tcore_user_request_new(NULL, NULL);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = NO_RESULT;
info_len = sizeof(struct ATReqMetaInfo);
-
+
cid = tcore_context_get_id(ps_context);
-
+
dbg("Example: AT+CGACT=0,1");
cmd_str = g_strdup_printf("%s=%d,%d%s","AT+CGACT", 0, cid, "\r");
-
+
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
free(cmd_str);
static struct tcore_ps_operations ps_ops =
{
- .pin_ctrl = NULL,
.activate_context = activate_ps_context,
.deactivate_context = deactivate_ps_context
};
-gboolean s_ps_init(TcorePlugin *p)
+gboolean s_ps_init(TcorePlugin *p, TcoreHal *h)
{
CoreObject *o;
GQueue *work_queue;
- o = tcore_ps_new(p, "umts_ps", &ps_ops);
+ o = tcore_ps_new(p, "umts_ps", &ps_ops, h);
if (!o)
return FALSE;
enum s_sim_sec_locktype_e{
SEC_LOCK_TYPE_NONE =0,
SEC_LOCK_TYPE_READY, /* ME is not locked */
- SEC_LOCK_TYPE_PS, /* PH-SIM, Lock Phone to SIM/UICC card(MT asks password when other than current SIM/UICC card inserted; MT may remember certain amount of
- previously used cards thus not requiring password when they are inserted ) */
- SEC_LOCK_TYPE_PF, /* PH-FSIM, Lock Phone to the very First inserted SIM/UICC card ( MT asks password when other than the first SIM/UICC card is inserted ) */
- SEC_LOCK_TYPE_SC, /*Lock SIM/UICC card ( SIM asks password in ME power-up and when this command is issued ) */
- SEC_LOCK_TYPE_FD, /* SIM card or active application in the UICC(GSM or USIM) fixed dialing memory feature */
+ SEC_LOCK_TYPE_PS, /* PH-SIM, Lock Phone to SIM/UICC card(MT asks password when other than current SIM/UICC card inserted; MT may remember certain amount of
+ previously used cards thus not requiring password when they are inserted ) */
+ SEC_LOCK_TYPE_PF, /* PH-FSIM, Lock Phone to the very First inserted SIM/UICC card ( MT asks password when other than the first SIM/UICC card is inserted ) */
+ SEC_LOCK_TYPE_SC, /*Lock SIM/UICC card ( SIM asks password in ME power-up and when this command is issued ) */
+ SEC_LOCK_TYPE_FD, /* SIM card or active application in the UICC(GSM or USIM) fixed dialing memory feature */
SEC_LOCK_TYPE_PN, /* Network Personalization */
- SEC_LOCK_TYPE_PU, /* Network subset Personalization */
- SEC_LOCK_TYPE_PP, /* Service Provider Personalization */
- SEC_LOCK_TYPE_PC, /* Corporate Personalization */
- SEC_LOCK_TYPE_SC2, /* Lock PIN2 ( ... ) */
- SEC_LOCL_TYPE_PUK2, /* Lock PUK2 (... ) */
- SEC_LOCK_TYPE_ACL, /* ACL */
-
- SEC_LOCK_TYPE_NO_SIM, /* SIM is not inserted */
- SEC_LOCK_TYPE_UNAVAIL, /* SIM is inserted but can not communicate with SIM ( SIM interface error ) */
- SEC_SIM_INIT_COMPLETED, /* SIM Initialize Completed */
- SEC_PB_INIT_COMPLETED, /* Phonebook Initialize Completed*/
- SEC_SIM_INIT_CRASH, /* SIM Crash request from SMC lab*/
-
- SEC_LOCK_TYPE_MAX
+ SEC_LOCK_TYPE_PU, /* Network subset Personalization */
+ SEC_LOCK_TYPE_PP, /* Service Provider Personalization */
+ SEC_LOCK_TYPE_PC, /* Corporate Personalization */
+ SEC_LOCK_TYPE_SC2, /* Lock PIN2 ( ... ) */
+ SEC_LOCL_TYPE_PUK2, /* Lock PUK2 (... ) */
+ SEC_LOCK_TYPE_ACL, /* ACL */
+
+ SEC_LOCK_TYPE_NO_SIM, /* SIM is not inserted */
+ SEC_LOCK_TYPE_UNAVAIL, /* SIM is inserted but can not communicate with SIM ( SIM interface error ) */
+ SEC_SIM_INIT_COMPLETED, /* SIM Initialize Completed */
+ SEC_PB_INIT_COMPLETED, /* Phonebook Initialize Completed*/
+ SEC_SIM_INIT_CRASH, /* SIM Crash request from SMC lab*/
+
+ SEC_LOCK_TYPE_MAX
};
enum s_sim_sec_lockkey_e{
SEC_LOCK_KEY_NONE,
- SEC_LOCK_KEY_UNLOCKED, /* Not necessary */
- SEC_LOCK_KEY_PIN, /* PIN required as a password */
- SEC_LOCK_KEY_PUK, /* 0PUK required as a password */
- SEC_LOCK_KEY_PIN2, /* PIN2 required as a password */
- SEC_LOCK_KEY_PUK2, /* PUK2 required as a password */
- SEC_LOCK_KEY_PERM_BLOCKED, /* PIN Permanent Blocked */
- SEC_LOCK_KEY_PIN2_DISABLE, /* PIN2 Lock Disabled*/
- SEC_LOCK_KEY_MAX
+ SEC_LOCK_KEY_UNLOCKED, /* Not necessary */
+ SEC_LOCK_KEY_PIN, /* PIN required as a password */
+ SEC_LOCK_KEY_PUK, /* 0PUK required as a password */
+ SEC_LOCK_KEY_PIN2, /* PIN2 required as a password */
+ SEC_LOCK_KEY_PUK2, /* PUK2 required as a password */
+ SEC_LOCK_KEY_PERM_BLOCKED, /* PIN Permanent Blocked */
+ SEC_LOCK_KEY_PIN2_DISABLE, /* PIN2 Lock Disabled*/
+ SEC_LOCK_KEY_MAX
};
int err;
if(line == NULL)
return FALSE;
-
+
dbg("incoming string : %s\n", line);
-
+
//rip off %SCPIN:
at_tok_start(&line);
// 1. find type string
err = at_tok_nextstr(&line, &type);
if(err<0){
- // no type string found.
+ // no type string found.
type = NULL;
}
if(type !=NULL){
else if(strStartsWith (type, "INIT_ERROR"))
*lock_type = SEC_SIM_INIT_CRASH;
else
- *lock_type = SEC_LOCK_TYPE_NONE;
- }
+ *lock_type = SEC_LOCK_TYPE_NONE;
+ }
else
type = SEC_LOCK_TYPE_NONE;
else
*lock_key = SEC_LOCK_KEY_NONE;
}
- else
+ else
*lock_key = SEC_LOCK_KEY_NONE;
-
-
-// 4. apply exceptional case.
+
+
+ // 4. apply exceptional case.
//if type is READY, key has no meanig
- if(*lock_type == SEC_LOCK_TYPE_READY)
- *lock_key = SEC_LOCK_KEY_UNLOCKED;
+ if(*lock_type == SEC_LOCK_TYPE_READY)
+ *lock_key = SEC_LOCK_KEY_UNLOCKED;
// no sim, unvail, init_comp, init_error have no key info
- if((*lock_type == SEC_LOCK_TYPE_NO_SIM)||(*lock_type == SEC_LOCK_TYPE_UNAVAIL)||
+ if((*lock_type == SEC_LOCK_TYPE_NO_SIM)||(*lock_type == SEC_LOCK_TYPE_UNAVAIL)||
(*lock_type == SEC_SIM_INIT_COMPLETED)||(*lock_type == SEC_SIM_INIT_CRASH))
- *lock_key = SEC_LOCK_KEY_NONE;
-
+ *lock_key = SEC_LOCK_KEY_NONE;
+
dbg("type : %d, key : %d\n", *lock_type, *lock_key);
-
- return TRUE;
+
+ return TRUE;
}
static enum tcore_response_command _find_resp_command(UserRequest *ur)
case TREQ_SIM_GET_PNN:
return TRESP_SIM_GET_PNN;
break;
- case TREQ_SIM_GET_CPHS_SHORTNETNAME:
- return TRESP_SIM_GET_CPHS_SHORTNETNAME;
- break;
- case TREQ_SIM_GET_CPHS_FULLNETNAME:
- return TRESP_SIM_GET_CPHS_FULLNETNAME;
+ case TREQ_SIM_GET_CPHS_NETNAME:
+ return TRESP_SIM_GET_CPHS_NETNAME;
break;
case TREQ_SIM_GET_OPLMNWACT:
return TRESP_SIM_GET_OPLMNWACT;
if((metainfo->type == SINGLELINE)||
(metainfo->type == MULTILINE))
{
- //cp rsp prefix
+ //cp rsp prefix
s_responsePrefix = strdup(metainfo->responsePrefix);
- dbg("duplicating responsePrefix : %s\n", s_responsePrefix);
+ dbg("duplicating responsePrefix : %s\n", s_responsePrefix);
}
else
{
//set atcmd type into s_type
s_type = metainfo->type;
-
+
if (result == FALSE) {
/* Fail */
dbg("SEND FAIL");
enum tel_sim_type sim_type = SIM_TYPE_UNKNOWN;
char* line=NULL;
int ret = 0;
-
+
if(sp_response->success > 0)
{
line = sp_response->p_intermediates->line;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
ret = at_tok_nextint(&line,(int *)&sim_type);
if (ret < 0)
- AT_TOK_ERROR(line);
- }
+ AT_TOK_ERROR(line);
+ }
else
{
sim_type = SIM_TYPE_UNKNOWN;
dbg("resp sim type[%d]", sim_type);
ReleaseResponse();
-
+
co_sim = tcore_pending_ref_core_object(p);
tcore_sim_set_type(co_sim, sim_type);
sp = tcore_sim_ref_userdata(co_sim);
- _sim_status_update(co_sim, sp->first_recv_status);
+ _sim_status_update(co_sim, sp->first_recv_status);
}
static void _response_get_file_info(TcorePending *p, int data_len, const void *data, void *user_data)
int sw2 = 0;
//char *hexData;
//char *recordData;
-
+
co_sim = tcore_pending_ref_core_object(p);
if(!co_sim){
dbg("error - core object is null");
unsigned char file_type_tag = 0x07;
unsigned char *ptr_data;
- char *hexData;
+ char *hexData;
char *recordData;
ret = at_tok_nextstr(&line,&hexData);
if (ret < 0)
AT_TOK_ERROR(line);
-
+
recordData = util_hexStringToBytes(hexData);
util_hex_dump(" ", strlen(hexData)/2, recordData);
-
+
ptr_data = (unsigned char *)recordData;
if (tcore_sim_get_type(co_sim) == SIM_TYPE_USIM) {
/*
} else {
dbg("INVALID FCP received - DEbug!");
free(recordData);
- ReleaseResponse();
+ ReleaseResponse();
return;
}
} else {
dbg("INVALID FCP received[0x%x] - DEbug!", *ptr_data);
free(recordData);
- ReleaseResponse();
+ ReleaseResponse();
return;
}
dbg(" not handled file type");
break;
}
- }
- else
+ }
+ else
{
dbg(" Card Type - UNKNOWN [%d]", tcore_sim_get_type(co_sim));
}
rt = SIM_ACCESS_SUCCESS;
free(recordData);
}
- else
+ else
{
/*2. SIM access fail case*/
dbg("error to get ef[0x%x]", file_meta->file_id);
ReleaseResponse();
- ur = tcore_user_request_dup(ur);
+ ur = tcore_user_request_ref(ur);
_next_from_get_file_info(co_sim, ur, file_meta->file_id, rt);
}
else
dbg("error to get ef[0x%x]", file_meta->file_id);
rt = SIM_ACCESS_FAILED;;
- ur = tcore_user_request_dup(ur);
- _next_from_get_file_info(co_sim, ur, file_meta->file_id, rt);
+ ur = tcore_user_request_ref(ur);
+ _next_from_get_file_info(co_sim, ur, file_meta->file_id, rt);
}
}
file_meta = (struct s_sim_property*)tcore_user_request_ref_metainfo(ur, NULL);
if(sp_response->success > 0)
- {
+ {
line = sp_response->p_intermediates->line;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
ret = at_tok_nextstr(&line,&hexStr);
if (ret < 0)
AT_TOK_ERROR(line);
-
+
fileData = util_hexStringToBytes(hexStr);
util_hex_dump(" ", strlen(hexStr)/2, fileData);
rt = SIM_ACCESS_SUCCESS;
file_meta->files.result = rt;
- switch (file_meta->file_id)
+ switch (file_meta->file_id)
{
case SIM_EF_IMSI:
dr = tcore_sim_decode_imsi(&imsi, (unsigned char *)fileData, strlen(fileData));
break;
case SIM_EF_CPHS_OPERATOR_NAME_STRING:
- dr = tcore_sim_decode_ons(&file_meta->files.data.cphs_f_name, (unsigned char *)fileData, strlen(fileData));
+ dr = tcore_sim_decode_ons((unsigned char*)&file_meta->files.data.cphs_net.full_name, (unsigned char *)fileData, strlen(fileData));
break;
case SIM_EF_CPHS_DYNAMICFLAGS:
break;
case SIM_EF_CPHS_DYNAMIC2FLAG:
-/* dr = tcore_sim_decode_dynamic2_flag(&po->p_cphs->d2flagsinfo, fileData, strlen(fileData));*/
+/* dr = tcore_sim_decode_dynamic2_flag(&po->p_cphs->d2flagsinfo, fileData, strlen(fileData));*/
break;
case SIM_EF_CPHS_CPHS_INFO:
break;
case SIM_EF_CPHS_OPERATOR_NAME_SHORT_FORM_STRING:
- dr = tcore_sim_decode_short_ons(&file_meta->files.data.cphs_s_name, (unsigned char *)fileData, strlen(fileData));
+ dr = tcore_sim_decode_short_ons((unsigned char*)&file_meta->files.data.cphs_net.short_name, (unsigned char *)fileData, strlen(fileData));
break;
case SIM_EF_CPHS_INFORMATION_NUMBERS:
}
free(fileData);
- }
+ }
else
{
rt = _decode_status_word(sw1, sw2);
{
ReleaseResponse();
rt = SIM_ACCESS_FAILED;;
- file_meta->files.result = rt;
+ file_meta->files.result = rt;
}
- ur = tcore_user_request_dup(ur);
+ ur = tcore_user_request_ref(ur);
_next_from_get_file_data(tcore_pending_ref_core_object(p), ur, rt, dr);
}
return FALSE;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = SINGLELINE;
info_len = sizeof(struct ATReqMetaInfo);
ur = tcore_user_request_new(NULL, NULL);
-
+
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
-
+
// AT+CPIN=<pin>[,<newpin>]
cmd_str = g_strdup("AT%SCCT\r");
-
+
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
tcore_pending_set_timeout(pending, 0);
tcore_pending_set_response_callback(pending, _response_get_sim_type, NULL);
tcore_pending_link_user_request(pending, ur);
-
+
tcore_pending_set_send_callback(pending, on_confirmation_sim_message_send, NULL);
-
+
tcore_hal_send_request(h, pending);
free(cmd_str);
return TCORE_RETURN_EINVAL;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
file_meta.file_id = ef;
file_meta.metainfo.type = SINGLELINE;
info_len = sizeof(struct s_sim_property);
tcore_user_request_set_command(ur, TREQ_CUSTOM);
-
+
trt = tcore_user_request_set_metainfo(ur, sizeof(struct s_sim_property), &file_meta);
dbg("trt[%d]",trt);
-
+
// AT+CRSM=<command>,<fildid>,<p1>,<p2+C29,<p3>
cmd_str = g_strdup_printf("AT+CRSM=192, %d%s", ef, "\r");
dbg("new pending(IPC_SEC_RSIM_ACCESS GET - READ BIN)");
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
-// offset for reading the TRANSPARENT data
+// offset for reading the TRANSPARENT data
p1 = (unsigned char)(offset & 0xFF00) >> 8;
p2 = (unsigned char)offset & 0x00FF; //offset low
p3 = (unsigned char)length;
// AT+CRSM=<command>,<fildid>,<p1>,<p2+C29,<p3>
cmd_str = g_strdup_printf("AT+CRSM=176, %d%s", ef, "\r");
-
+
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
tcore_pending_set_timeout(pending, 0);
tcore_pending_set_send_callback(pending, on_confirmation_sim_message_send, NULL);
- tcore_hal_send_request(h, pending);
+ tcore_hal_send_request(h, pending);
free(cmd_str);
return TRUE;
}
return TRUE;
}
-static void on_event_pin_status(CoreObject *o, const void *event_info, void *user_data)
+static gboolean on_event_pin_status(CoreObject *o, const void *event_info, void *user_data)
{
UserRequest *ur;
char *line = (char *) event_info;
case SEC_PB_INIT_COMPLETED:
dbg("[SIM DATA] MODEM SIM PB INIT COMPLETED. not handled here! s_phonebook should handle!");
- return;
+ return TRUE;
break;
default:
break;
}
+ return TRUE;
}
static void on_response_verify_pins(TcorePending *p, int data_len, const void *data, void *user_data)
char* line=NULL;
int ret;
- int error;
+ int error;
co_sim = tcore_pending_ref_core_object(p);
sp = tcore_sim_ref_userdata(co_sim);
if(sp_response->success > 0)
{
ReleaseResponse();
-
+
resp.result = SIM_PIN_OPERATION_SUCCESS;
resp.pin_type = _sim_get_current_pin_facility(sp);
- tcore_user_request_send_response(ur, TRESP_SIM_VERIFY_PINS, sizeof(struct tresp_sim_verify_pins), &resp);
+ tcore_user_request_send_response(ur, TRESP_SIM_VERIFY_PINS, sizeof(struct tresp_sim_verify_pins), &resp);
}
else
{
//failure case - consider this later
line = sp_response->finalResponse;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
ret = at_tok_nextint(&line,&error);
if (ret < 0)
- AT_TOK_ERROR(line);
+ AT_TOK_ERROR(line);
ReleaseResponse();
// ur = user_request_dup(ur);
// _get_retry_count(co_sim, ur);
-
+
resp.result = SIM_INCORRECT_PASSWORD;
resp.pin_type = _sim_get_current_pin_facility(sp);
resp.retry_count = 3;
- tcore_user_request_send_response(ur, TRESP_SIM_VERIFY_PINS, sizeof(struct tresp_sim_verify_pins), &resp);
-
- }
+ tcore_user_request_send_response(ur, TRESP_SIM_VERIFY_PINS, sizeof(struct tresp_sim_verify_pins), &resp);
+
+ }
}
static void on_response_verify_puks(TcorePending *p, int data_len, const void *data, void *user_data)
char* line=NULL;
int ret;
- int error;
+ int error;
co_sim = tcore_pending_ref_core_object(p);
sp = tcore_sim_ref_userdata(co_sim);
if(sp_response->success > 0)
{
ReleaseResponse();
-
+
resp.result = SIM_PIN_OPERATION_SUCCESS;
resp.pin_type = _sim_get_current_pin_facility(sp);
- tcore_user_request_send_response(ur, TRESP_SIM_VERIFY_PINS, sizeof(struct tresp_sim_verify_pins), &resp);
+ tcore_user_request_send_response(ur, TRESP_SIM_VERIFY_PINS, sizeof(struct tresp_sim_verify_pins), &resp);
}
else
{
//failure case - consider this later
line = sp_response->finalResponse;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
ret = at_tok_nextint(&line,&error);
if (ret < 0)
- AT_TOK_ERROR(line);
+ AT_TOK_ERROR(line);
ReleaseResponse();
// ur = user_request_dup(ur);
// _get_retry_count(co_sim, ur);
-
+
resp.result = SIM_INCORRECT_PASSWORD;
resp.pin_type = _sim_get_current_pin_facility(sp);
- tcore_user_request_send_response(ur, TRESP_SIM_VERIFY_PUKS, sizeof(struct tresp_sim_verify_puks), &resp);
-
- }
+ tcore_user_request_send_response(ur, TRESP_SIM_VERIFY_PUKS, sizeof(struct tresp_sim_verify_puks), &resp);
+
+ }
}
static void on_response_change_pins(TcorePending *p, int data_len, const void *data, void *user_data)
char* line=NULL;
int ret;
- int error;
+ int error;
co_sim = tcore_pending_ref_core_object(p);
sp = tcore_sim_ref_userdata(co_sim);
if(sp_response->success > 0)
{
ReleaseResponse();
-
+
resp.result = SIM_PIN_OPERATION_SUCCESS;
resp.pin_type = _sim_get_current_pin_facility(sp);
- tcore_user_request_send_response(ur, TRESP_SIM_VERIFY_PINS, sizeof(struct tresp_sim_verify_pins), &resp);
+ tcore_user_request_send_response(ur, TRESP_SIM_VERIFY_PINS, sizeof(struct tresp_sim_verify_pins), &resp);
}
else
{
//failure case - consider this later
line = sp_response->finalResponse;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
ret = at_tok_nextint(&line,&error);
if (ret < 0)
- AT_TOK_ERROR(line);
+ AT_TOK_ERROR(line);
ReleaseResponse();
// ur = user_request_dup(ur);
// _get_retry_count(co_sim, ur);
-
+
resp.result = SIM_INCORRECT_PASSWORD;
resp.pin_type = _sim_get_current_pin_facility(sp);
- tcore_user_request_send_response(ur, TRESP_SIM_CHANGE_PINS, sizeof(struct tresp_sim_change_pins), &resp);
+ tcore_user_request_send_response(ur, TRESP_SIM_CHANGE_PINS, sizeof(struct tresp_sim_change_pins), &resp);
}
}
if(sp_response->success > 0)
{
line = sp_response->p_intermediates->line;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
ret = at_tok_nextint(&line,(int *)&resp.b_enable);
if (ret < 0)
- AT_TOK_ERROR(line);
+ AT_TOK_ERROR(line);
}
else
{
if (ur) {
tcore_user_request_send_response(ur, TRESP_SIM_GET_FACILITY_STATUS,
- sizeof(struct tresp_sim_get_facility_status), &resp);
+ sizeof(struct tresp_sim_get_facility_status), &resp);
}
}
if(sp_response->success > 0)
{
line = sp_response->p_intermediates->line;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
ret = at_tok_nextint(&line,(int *)&resp.result);
if (ret < 0)
- AT_TOK_ERROR(line);
+ AT_TOK_ERROR(line);
}
else
{
if(sp_response->success > 0)
{
line = sp_response->p_intermediates->line;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
ret = at_tok_nextint(&line,(int *)&resp.result);
if (ret < 0)
- AT_TOK_ERROR(line);
+ AT_TOK_ERROR(line);
}
else
{
return TCORE_RETURN_EINVAL;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
req_data = tcore_user_request_ref_data(ur, NULL);
sp = tcore_sim_ref_userdata(o);
metainfo.type = NO_RESULT;
metainfo.responsePrefix[0] ='\0';
info_len = sizeof(struct ATReqMetaInfo);
-
+
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
-
+
// AT+CPIN=<pin>[,<newpin>]
cmd_str = g_strdup_printf("AT+CPIN=\"%s\"%s", req_data->pin, "\r");
dbg("new pending(verify - pins), %s", cmd_str);
-
+
pending = tcore_pending_new(o,ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
tcore_pending_set_timeout(pending, 0);
tcore_hal_send_request(h, pending);
free(cmd_str);
-
+
return TCORE_RETURN_SUCCESS;
}
return TCORE_RETURN_EINVAL;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
req_data = tcore_user_request_ref_data(ur, NULL);
sp = tcore_sim_ref_userdata(o);
metainfo.type = NO_RESULT;
metainfo.responsePrefix[0] ='\0';
info_len = sizeof(struct ATReqMetaInfo);
-
+
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
-
+
// AT+CPIN=<pin>[,<newpin>]
cmd_str = g_strdup_printf("AT+CPIN=\"%s\", \"%s\"%s", req_data->puk, req_data->pin, "\r");
-
+
dbg("new pending(IPC_SEC_PIN_STATUS SET - verify puks)");
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
tcore_pending_link_user_request(pending, ur);
tcore_pending_set_send_callback(pending, on_confirmation_sim_message_send, NULL);
-
+
tcore_hal_send_request(h, pending);
free(cmd_str);
-
+
return TCORE_RETURN_SUCCESS;
}
return TCORE_RETURN_EINVAL;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
req_data = tcore_user_request_ref_data(ur, NULL);
sp = tcore_sim_ref_userdata(o);
metainfo.type = NO_RESULT;
metainfo.responsePrefix[0] ='\0';
info_len = sizeof(struct ATReqMetaInfo);
-
+
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
-
+
// AT+CPIN=<pin>[,<newpin>]
cmd_str = g_strdup_printf("AT+CPIN=\"%s\", \"%s\"%s", req_data->old_pin, req_data->new_pin, "\r");
-
+
dbg("new pending(IPC_SEC_CHANGE_LOCKING_PW SET)");
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
tcore_pending_link_user_request(pending, ur);
tcore_pending_set_send_callback(pending, on_confirmation_sim_message_send, NULL);
-
+
tcore_hal_send_request(h, pending);
free(cmd_str);
-
+
return TCORE_RETURN_SUCCESS;
}
return TCORE_RETURN_EINVAL;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
req_data = tcore_user_request_ref_data(ur, NULL);
if(req_data->type == SIM_FACILITY_PS)
tcore_user_request_set_command(ur, TREQ_CUSTOM);
trt = tcore_user_request_set_metainfo(ur, sizeof(struct s_sim_property), &sec_meta);
dbg("trt[%d]",trt);
-
+
// AT+CLCK=<fac>,<mode>,<password>
cmd_str = g_strdup_printf("AT+CLCK=\"%s\", %d%s", fac, mode, "\r");
tcore_pending_link_user_request(pending, ur);
tcore_pending_set_send_callback(pending, on_confirmation_sim_message_send, NULL);
-
+
tcore_hal_send_request(h, pending);
free(cmd_str);
char *cmd_str = NULL;
// struct ATReqMetaInfo metainfo;
int info_len =0;
-
+
if (!o || !ur)
return TCORE_RETURN_EINVAL;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
req_data = tcore_user_request_ref_data(ur, NULL);
sp = tcore_sim_ref_userdata(o);
return TCORE_RETURN_EINVAL;
sp->current_sec_op = SEC_SIM_ENABLE;
-
+
sec_meta.current_sec_op = req_data->type;
sec_meta.metainfo.type = SINGLELINE;
memcpy(sec_meta.metainfo.responsePrefix,"+CLCK:",strlen("+CLCK:"));
// AT+CLCK=<fac>,<mode>,<password>
cmd_str = g_strdup_printf("AT+CLCK=\"%s\", %d, %s%s", fac, mode, req_data->password,"\r");
dbg("new pending(enable_facility), %s", cmd_str);
-
+
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
tcore_pending_set_timeout(pending, 0);
tcore_pending_link_user_request(pending, ur);
tcore_pending_set_send_callback(pending, on_confirmation_sim_message_send, NULL);
-
+
tcore_hal_send_request(h, pending);
free(cmd_str);
int mode = 0; // 2:query, 0: unlock, 1:lock
char *cmd_str = NULL;
-// struct ATReqMetaInfo metainfo;
+ // struct ATReqMetaInfo metainfo;
int info_len =0;
-
+
if (!o || !ur)
return TCORE_RETURN_EINVAL;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
req_data = tcore_user_request_ref_data(ur, NULL);
sp = tcore_sim_ref_userdata(o);
return TCORE_RETURN_EINVAL;
sp->current_sec_op = SEC_SIM_ENABLE;
-
+
sec_meta.current_sec_op = req_data->type;
sec_meta.metainfo.type = SINGLELINE;
memcpy(sec_meta.metainfo.responsePrefix,"+CLCK:",strlen("+CLCK:"));
// AT+CLCK=<fac>,<mode>,<password>
cmd_str = g_strdup_printf("AT+CLCK=\"%s\", %d, %s%s", fac, mode, req_data->password,"\r");
dbg("new pending(enable_facility), %s", cmd_str);
-
+
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
tcore_pending_set_timeout(pending, 0);
tcore_pending_link_user_request(pending, ur);
tcore_pending_set_send_callback(pending, on_confirmation_sim_message_send, NULL);
-
+
tcore_hal_send_request(h, pending);
free(cmd_str);
api_ret = _get_file_info(o, ur, SIM_EF_PNN);
break;
- case TREQ_SIM_GET_CPHS_SHORTNETNAME:
- if(tcore_sim_get_cphs_status(o))
- api_ret = _get_file_info(o, ur, SIM_EF_CPHS_OPERATOR_NAME_SHORT_FORM_STRING);
- else
- api_ret = TCORE_RETURN_ENOSYS;
- break;
-
- case TREQ_SIM_GET_CPHS_FULLNETNAME:
- if(tcore_sim_get_cphs_status(o))
- api_ret = _get_file_info(o, ur, SIM_EF_CPHS_OPERATOR_NAME_STRING);
- else
- api_ret = TCORE_RETURN_ENOSYS;
+ case TREQ_SIM_GET_CPHS_NETNAME:
+ api_ret = TCORE_RETURN_ENOSYS;
break;
case TREQ_SIM_GET_OPLMNWACT:
.req_authentication = s_req_authentication
};
-gboolean s_sim_init(TcorePlugin *p)
+gboolean s_sim_init(TcorePlugin *p, TcoreHal *h)
{
CoreObject *o;
struct s_sim_property *sp = NULL;
- o = tcore_sim_new(p, "sim", &sim_ops);
+ o = tcore_sim_new(p, "sim", &sim_ops, h);
if (!o)
return FALSE;
case 302: //Operation not allowed;
case 303: //Operation not supported;
returnStatus = SMS_OPERATION_NOT_SUPPORTED;
- break;
+ break;
case 304: //Invalid PDU mode parameter;
case 305: //Invalid text mode parameter;
returnStatus = SMS_INVALID_PARAMETER_FORMAT;
- break;
+ break;
case 320: //memory failure;
case 321: //invalid memory index;
case 322: //memory full;
returnStatus = SMS_MEMORY_FAILURE;
- break;
+ break;
case 330: //SCA unknown;
case 500: //Unknown error;
default:
returnStatus = SMS_UNKNOWN;
- break;
- }
+ break;
+ }
return returnStatus;
}
/************************ Events Cb *************************/
/************************************************************/
-static void on_event_sms_incom_msg(CoreObject *o, const void *event_info, void *user_data)
+static gboolean on_event_sms_incom_msg(CoreObject *o, const void *event_info, void *user_data)
{
struct smsDeliveryPDU *smsPdu = (struct smsDeliveryPDU *)event_info;
struct property_sms_info *property;
property = tcore_plugin_ref_property(tcore_object_ref_plugin(o), "SMS");
if(!property) {
dbg("property is NULL");
- return;
+ return TRUE;
}
memcpy(gsmMsgInfo.msgInfo.sca, &smsPdu->pdu[0], (ScLength+1));
{
dbg("Invalid Message Length");
}
-
- return;
+
+ return TRUE;
}
-static void on_event_sms_device_ready(CoreObject *o, const void *event_info, void *user_data)
+static gboolean on_event_sms_device_ready(CoreObject *o, const void *event_info, void *user_data)
{
- struct tnoti_sms_device_ready_status deviceStatusInfo = {0,};
- struct property_sms_info *property = NULL;
-
+ struct tnoti_sms_ready_status readyStatusInfo = {0,};
int rtn = -1;
dbg(" Func Entrance");
+ readyStatusInfo.status = TRUE;
+ tcore_sms_set_ready_status(o, readyStatusInfo.status);
- property = tcore_plugin_ref_property(tcore_object_ref_plugin(o), "SMS");
- if(!property) {
- dbg("property is NULL");
- return;
- }
-
- property->bDevice_Ready = 1; // TRUE
- deviceStatusInfo.status = 1;
-
- dbg("bDevice_Ready = [0x%02x]", property->bDevice_Ready);
+ dbg("SMS Ready status = [%s]", readyStatusInfo.status ? "TRUE" : "FALSE");
- rtn = tcore_server_send_notification(tcore_plugin_ref_server(tcore_object_ref_plugin(o)), o, TNOTI_SMS_DEVICE_READY, sizeof(struct tnoti_sms_device_ready_status), &deviceStatusInfo);
+ rtn = tcore_server_send_notification(tcore_plugin_ref_server(tcore_object_ref_plugin(o)), o, TNOTI_SMS_DEVICE_READY, sizeof(struct tnoti_sms_ready_status), &readyStatusInfo);
dbg(" Return value [%d]",rtn);
- return;
+ return TRUE;
}
/*************************************************************/
if((metainfo->type == SINGLELINE)||
(metainfo->type == MULTILINE))
{
- //cp rsp prefix
+ //cp rsp prefix
s_responsePrefix = strdup(metainfo->responsePrefix);
- dbg("duplicating responsePrefix : %s\n", s_responsePrefix);
+ dbg("duplicating responsePrefix : %s\n", s_responsePrefix);
}
else
{
}
printResponse();
-
+
if(sp_response->success == TRUE)
{
ReleaseResponse();
- ur = tcore_user_request_dup(ur);
+ ur = tcore_user_request_ref(ur);
ret = (int) Send_SmsSubmitTpdu(tcore_pending_ref_core_object(p), ur);
if(ret != (int)TCORE_RETURN_SUCCESS)
{
respSendMsg.result = SMS_INVALID_PARAMETER;
tcore_user_request_send_response(ur, TRESP_SMS_SEND_UMTS_MSG, sizeof(struct tresp_sms_send_umts_msg), &respSendMsg);
- }
+ }
}
else
{
//failure case - consider this later
line = sp_response->finalResponse;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
int mr;
int error;
char *hexData;
-
+
char cSCA = '\0';
printResponse();
-
+
if(sp_response->success > 0)
{
line = sp_response->p_intermediates->line;
-
+
memset(&respUmtsInfo, 0 , sizeof(struct tresp_sms_send_umts_msg));
// +CMGS: <mr>[, <ackpdu>]
// SMS_SMDATA_SIZE_MAX + 1
ret = at_tok_start(&line);
- if (ret < 0)
- AT_NOTI_TOK_ERROR(line);
+ if (ret < 0)
+ AT_TOK_ERROR(line);
ret = at_tok_nextint(&line, &mr);
- if (ret < 0)
+ if (ret < 0)
return;
ret = at_tok_nextstr(&line, &hexData);
- if (ret < 0)
+ if (ret < 0)
{
dbg(" ackpdu is NULL ");
+ ackpdu = NULL;
+ } else {
+ ackpdu = util_hexStringToBytes(hexData);
+ util_hex_dump(" ", strlen(hexData)/2, ackpdu);
}
- ackpdu = util_hexStringToBytes(hexData);
- util_hex_dump(" ", strlen(hexData)/2, ackpdu);
-
dbg(" Func Entrance ");
ur = tcore_pending_ref_user_request(p);
{
memcpy(respUmtsInfo.dataInfo.sca, &cSCA, sizeof(char));
- respUmtsInfo.dataInfo.msgLength = strlen(ackpdu);
+ if (ackpdu) {
+ respUmtsInfo.dataInfo.msgLength = strlen(ackpdu);
+ } else {
+ respUmtsInfo.dataInfo.msgLength = 0;
+ }
if ( (respUmtsInfo.dataInfo.msgLength >= 0) && (0xff >= respUmtsInfo.dataInfo.msgLength))
{
{
//failure case - consider this later
line = sp_response->finalResponse;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
ret = at_tok_nextint(&line,&error);
if (ret < 0)
AT_TOK_ERROR(line);
-
+
//5. release sp_response & s_responsePrefix - before sending user callback, because user callback can request additional request
// and if queue is empty, that req can be directly sent to mdm - can cause sp_response, s_responsePrefix dangling
ReleaseResponse();
-
+
ur = tcore_pending_ref_user_request(p);
if (ur) {
struct tresp_sms_send_umts_msg respSendMsg;
memset(&respSendMsg, 0, sizeof(struct tresp_sms_send_umts_msg));
respSendMsg.result = SMS_INVALID_MANDATORY_INFO;
-
+
respSendMsg.result = util_sms_ipcError2SmsError(error);
-
+
tcore_user_request_send_response(ur, TRESP_SMS_SEND_UMTS_MSG, sizeof(struct tresp_sms_send_umts_msg), &respSendMsg);
}
else {
}
printResponse();
-
+
if(sp_response->success > 0)
{
//failure case - consider this later
line = sp_response->p_intermediates->line;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
AT_TOK_ERROR(line);
ret = at_tok_nextint(&line,&totalCount);
if (ret < 0)
- AT_TOK_ERROR(line)
+ AT_TOK_ERROR(line);
respStoredMsgCnt.storedMsgCnt.totalCount = totalCount;
respStoredMsgCnt.storedMsgCnt.usedCount = usedCount;
{
//failure case - consider this later
line = sp_response->finalResponse;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
ReleaseResponse();
-
+
tcore_user_request_send_response(ur, TRESP_SMS_GET_STORED_MSG_COUNT, sizeof(struct tresp_sms_get_storedMsgCnt), &respStoredMsgCnt);
return;
if(sp_response->success > 0)
{
respGetSca.result = SMS_SUCCESS;
-
+
line = sp_response->p_intermediates->line;
ret = at_tok_start(&line);
if (ret < 0)
respGetSca.scaAddress.dialNumLen = strlen(scaStr);
if(scaType == 145)
- respGetSca.scaAddress.typeOfNum = SIM_TON_INTERNATIONAL;
+ respGetSca.scaAddress.typeOfNum = SIM_TON_INTERNATIONAL;
else respGetSca.scaAddress.typeOfNum = SIM_TON_NATIONAL;
respGetSca.scaAddress.numPlanId = 0;
-
+
memcpy(respGetSca.scaAddress.diallingNum, scaStr, strlen(scaStr));
}
{
//failure case - consider this later
line = sp_response->finalResponse;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
AT_TOK_ERROR(line);
respGetSca.result = util_sms_ipcError2SmsError(error);
-
+
}
-
+
ReleaseResponse();
tcore_user_request_send_response(ur, TRESP_SMS_GET_SCA, sizeof(struct tresp_sms_get_sca), &respGetSca);
dbg("no user_request");
return;
}
-
+
printResponse();
-
+
if(sp_response->success > 0)
{
respSetSca.result = SMS_SUCCESS;
{
//failure case - consider this later
line = sp_response->finalResponse;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
}
ReleaseResponse();
-
+
tcore_user_request_send_response(ur, TRESP_SMS_SET_SCA, sizeof(struct tresp_sms_get_sca), &respSetSca);
-
+
return;
}
}
printResponse();
-
+
if(sp_response->success > 0)
{
respSetDeliveryReport.result = SMS_SUCCESS;
{
//failure case - consider this later
line = sp_response->finalResponse;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
ReleaseResponse();
-
+
tcore_user_request_send_response(ur, TRESP_SMS_SET_DELIVERY_REPORT, sizeof(struct tresp_sms_set_delivery_report), &respSetDeliveryReport);
return;
UserRequest *ur;
struct tresp_sms_get_params respGetSmsParams;
struct property_sms_info *property = NULL;
-
+
char *line = NULL;
int error;
int ret = 0;
dbg("no user_request");
return;
}
-
+
if(sp_response->success > 0)
- {
+ {
line = sp_response->p_intermediates->line;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
if (ret < 0)
AT_TOK_ERROR(line);
- if(sw1 != 144 || sw2 != 0)
+ if(sw1 != 144 || sw2 != 0)
respGetSmsParams.result = SMS_UNKNOWN;
else
{
char *hexData;
-
+
ret = at_tok_nextstr(&line,&hexData);
if (ret < 0)
AT_TOK_ERROR(line);
-
+
recordData = util_hexStringToBytes(hexData);
util_hex_dump(" ", strlen(hexData)/2, recordData);
-
+
// respGetSmsParams.paramsInfo.recordIndex = 0;
respGetSmsParams.paramsInfo.recordLen = strlen(hexData)/2;
respGetSmsParams.result = SMS_UNKNOWN;
//failure case - consider this later
line = sp_response->finalResponse;
-
+
ret = at_tok_start(&line);
if (ret < 0)
AT_TOK_ERROR(line);
if (ret < 0)
AT_TOK_ERROR(line);
- respGetSmsParams.result = util_sms_ipcError2SmsError(error);
+ respGetSmsParams.result = util_sms_ipcError2SmsError(error);
}
- ReleaseResponse();
-
+ ReleaseResponse();
+
tcore_user_request_send_response(ur, TRESP_SMS_GET_PARAMS, sizeof(struct tresp_sms_get_params), &respGetSmsParams);
return;
unsigned char file_type_tag = 0x07;
unsigned char *ptr_data;
- char *hexData;
+ char *hexData;
char *recordData;
ret = at_tok_nextstr(&line,&hexData);
if (ret < 0)
AT_TOK_ERROR(line);
-
+
recordData = util_hexStringToBytes(hexData);
util_hex_dump(" ", strlen(hexData)/2, recordData);
-
+
ptr_data = (unsigned char *)recordData;
co_sim = tcore_plugin_ref_core_object(tcore_pending_ref_plugin(p), "sim");
dbg("Getting FileType: [Transparent file type]");
/* increment to next byte */
ptr_data++;
- file_type = 0x01; //SIM_FTYPE_TRANSPARENT
+ file_type = 0x01; //SIM_FTYPE_TRANSPARENT
/* data coding byte - value 21 */
ptr_data++;
break;
} else {
dbg("INVALID FCP received - DEbug!");
free(recordData);
- ReleaseResponse();
+ ReleaseResponse();
return;
}
} else {
dbg("INVALID FCP received[0x%x] - DEbug!", *ptr_data);
free(recordData);
- ReleaseResponse();
+ ReleaseResponse();
return;
}
return;
}
}
- else if (tcore_sim_get_type(co_sim) == SIM_TYPE_GSM)
+ else if (tcore_sim_get_type(co_sim) == SIM_TYPE_GSM)
{
unsigned char gsm_specific_file_data_len = 0;
/* ignore RFU byte1 and byte2 */
dbg(" not handled file type");
break;
}
- }
- else
+ }
+ else
{
dbg(" Card Type - UNKNOWN [%d]", tcore_sim_get_type(co_sim));
}
respGetParamCnt.recordCount = num_of_records;
respGetParamCnt.result = SMS_SUCCESS;
-
+
free(recordData);
}
- else
+ else
{
/*2. SIM access fail case*/
dbg("SIM access fail");
TcoreHal *h = NULL;
TcorePending *pending = NULL;
const struct treq_sms_send_umts_msg *sendUmtsMsg = NULL;
- GQueue *queue = NULL;
char *cmd_str = NULL;
struct ATReqMetaInfo metainfo;
int info_len =0;
sendUmtsMsg = tcore_user_request_ref_data(ur, NULL);
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
if (!sendUmtsMsg || !h)
return TCORE_RETURN_ENOSYS;
metainfo.type = NO_RESULT;
metainfo.responsePrefix[0] ='\0';
info_len = sizeof(struct ATReqMetaInfo);
-
+
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
// AT+CMMS=<mode>
cmd_str = g_strdup_printf("AT+CMMS=%d%s", sendUmtsMsg->more, "\r");
dbg("[tcore_SMS] *************************MsgLen[%d]", sendUmtsMsg->msgDataPackage.msgLength);
- queue = tcore_object_ref_user_data(o);
- if (queue)
- util_add_waiting_job(queue, ID_RESERVED_AT, ur);
-
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
tcore_pending_set_timeout(pending, 0);
tcore_pending_set_send_callback(pending, on_confirmation_sms_message_send, NULL);
free(cmd_str);
-
- return tcore_hal_send_request(h, pending);
+
+ return tcore_hal_send_request(h, pending);
}
static TReturn Send_SmsSubmitTpdu(CoreObject *o, UserRequest *ur)
TcoreHal *h = NULL;
TcorePending *pending = NULL;
const struct treq_sms_send_umts_msg *sendUmtsMsg = NULL;
- GQueue *queue = NULL;
char *cmd_str = NULL;
struct ATReqMetaInfo metainfo;
int info_len =0;
sendUmtsMsg = tcore_user_request_ref_data(ur, NULL);
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
if (!sendUmtsMsg || !h)
return TCORE_RETURN_ENOSYS;
if (sendUmtsMsg->msgDataPackage.msgLength < SMS_SMDATA_SIZE_MAX)
{
memset(tpdu, 0, sizeof(MAX_GSM_SMS_TPDU_SIZE));
-
+
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = SINGLELINE;
memcpy(metainfo.responsePrefix,"+CMGS:",strlen("+CMGS:"));
info_len = sizeof(struct ATReqMetaInfo);
-
+
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
ScLength = sendUmtsMsg->msgDataPackage.sca[0];
tpduDataLen = sendUmtsMsg->msgDataPackage.msgLength + (ScLength + 2);
hexString = calloc(tpduDataLen*2, 1);;
- for( i=0; i<tpduDataLen*2; i+=2)
+ for( i=0; i<tpduDataLen*2; i+=2)
{
char value = 0;
else hexString[i+1] = (tpdu[i/2] & 0x0f ) + 'A' -10;
}
-
+
// AT+CMGS=<length><CR>pdu_is_given<ctrl-z/ESC>
cmd_str = g_strdup_printf("AT+CMGS=%d%s%s%x%s", sendUmtsMsg->msgDataPackage.msgLength, "\r", hexString, 0x1A,"\r");
dbg("cmd_str is %s", cmd_str);
- queue = tcore_object_ref_user_data(o);
- if (queue)
- util_add_waiting_job(queue, ID_RESERVED_AT, ur);
-
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
tcore_pending_set_timeout(pending, 0);
tcore_pending_link_user_request(pending, ur);
tcore_pending_set_send_callback(pending, on_confirmation_sms_message_send, NULL);
-
- api_err = tcore_hal_send_request(h, pending);
+
+ api_err = tcore_hal_send_request(h, pending);
free(cmd_str);
free(hexString);
dbg("[tcore_SMS] Invalid Data Length");
api_err = TCORE_RETURN_SMS_INVALID_DATA_LEN;
}
-
+
return api_err;
}
TcorePending *pending = NULL;
const struct treq_sms_get_msg_count *getStoredMsgCnt = NULL;
- char *cmd_str = NULL;
+ char *cmd_str = NULL;
struct ATReqMetaInfo metainfo;
- int info_len =0;
+ int info_len =0;
dbg("new pending(IPC_SMS_GET_STORED_MSG_COUNT)");
getStoredMsgCnt = tcore_user_request_ref_data(ur, NULL);
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
if (!h)
{
- dbg("[ERR] tcore_plugin_ref_hal() pointer is NULL");
+ dbg("[ERR] tcore_object_get_hal() pointer is NULL");
return TCORE_RETURN_ENOSYS;
}
metainfo.type = SINGLELINE;
memcpy(metainfo.responsePrefix,"+CPMS:",strlen("+CPMS:"));
info_len = sizeof(struct ATReqMetaInfo);
-
+
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
-
+
// AT+CPMS=<mem1>[,<mem2>[,<mem3>]]
- // Possible response(s) : +CPMS: <used1>,<total1>,<used2>,<total2>,<used3>,<total3>
+ // Possible response(s) : +CPMS: <used1>,<total1>,<used2>,<total2>,<used3>,<total3>
cmd_str = g_strdup_printf("AT+CPMS=\"SM\"%s", "\r");
pending = tcore_pending_new(o, ID_RESERVED_AT);
TcoreHal *h = NULL;
TcorePending *pending = NULL;
const struct treq_sms_get_sca *getSca = NULL;
- char *cmd_str = NULL;
+ char *cmd_str = NULL;
struct ATReqMetaInfo metainfo;
int info_len =0;
getSca = tcore_user_request_ref_data(ur, NULL);
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
if (!getSca || !h)
return TCORE_RETURN_ENOSYS;
metainfo.type = SINGLELINE;
memcpy(metainfo.responsePrefix,"+CSCA:",strlen("+CSCA:"));
info_len = sizeof(struct ATReqMetaInfo);
-
+
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
-
+
// AT +CSCA?
- // Possible response(s) : +CSCA: <sca number>,<sca type>
+ // Possible response(s) : +CSCA: <sca number>,<sca type>
cmd_str = g_strdup_printf("AT +CSCA?%s", "\r");
-
+
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
tcore_pending_set_timeout(pending, 0);
tcore_pending_link_user_request(pending, ur);
tcore_pending_set_send_callback(pending, on_confirmation_sms_message_send, NULL);
-
+
free(cmd_str);
return tcore_hal_send_request(h, pending);
}
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
if (!setSca || !h)
return TCORE_RETURN_ENOSYS;
metainfo.type = NO_RESULT;
metainfo.responsePrefix[0] ='\0';
info_len = sizeof(struct ATReqMetaInfo);
-
+
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
-
- // AT +CSCA=<sca number>[,<sca type>]
- // 129:Unknown numbering plan, national/international number unknown, 145:international number
+
+ // AT +CSCA=<sca number>[,<sca type>]
+ // 129:Unknown numbering plan, national/international number unknown, 145:international number
cmd_str = g_strdup_printf("AT+CSCA=\"%s\", %d%s", setSca->scaInfo.diallingNum, scaType, "\r");
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_link_user_request(pending, ur);
tcore_pending_set_send_callback(pending, on_confirmation_sms_message_send, NULL);
-
+
free(cmd_str);
return tcore_hal_send_request(h, pending);
deliveryReport = tcore_user_request_ref_data(ur, NULL);
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
if (!deliveryReport || !h)
return TCORE_RETURN_ENOSYS;
metainfo.type = NO_RESULT;
metainfo.responsePrefix[0] ='\0';
info_len = sizeof(struct ATReqMetaInfo);
-
+
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
-
+
// AT+CNMA
if(deliveryReport->rspType == SMS_SENDSMS_SUCCESS)
cmd_str = g_strdup_printf("AT+CNMA=0%s", "\r");
tcore_pending_link_user_request(pending, ur);
tcore_pending_set_send_callback(pending, on_confirmation_sms_message_send, NULL);
-
+
free(cmd_str);
return tcore_hal_send_request(h, pending);
getSmsParams = tcore_user_request_ref_data(ur, NULL);
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
if (!getSmsParams || !h)
{
metainfo.type = SINGLELINE;
memcpy(metainfo.responsePrefix,"+CRSM:",strlen("+CRSM:"));
info_len = sizeof(struct ATReqMetaInfo);
-
+
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
- // AT+CRSM=<command>,<fildid>,<p1>,<p2+C29,<p3>
+ // AT+CRSM=<command>,<fildid>,<p1>,<p2+C29,<p3>
cmd_str = g_strdup_printf("AT+CRSM=%d, %d, %d, 4, 40%s", 178, 0x6F42, getSmsParams->index + 1, "\r");
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_link_user_request(pending, ur);
tcore_pending_set_send_callback(pending, on_confirmation_sms_message_send, NULL);
-
+
free(cmd_str);
-
+
return tcore_hal_send_request(h, pending);
}
getParamCnt = tcore_user_request_ref_data(ur, NULL);
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
if (!h) // request data is NULL, so do not NULL check for getParamCnt
{
metainfo.type = SINGLELINE;
memcpy(metainfo.responsePrefix,"+CRSM:",strlen("+CRSM:"));
info_len = sizeof(struct ATReqMetaInfo);
-
+
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
-
- // AT+CRSM=<command>,<fildid>,<p1>,<p2+C29,<p3>, EFsmsp: 0x6F42
+
+ // AT+CRSM=<command>,<fildid>,<p1>,<p2+C29,<p3>, EFsmsp: 0x6F42
cmd_str = g_strdup_printf("AT+CRSM=192, %d%s", 0x6F42, "\r");
-
+
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, strlen(cmd_str), cmd_str);
tcore_pending_set_timeout(pending, 0);
tcore_pending_link_user_request(pending, ur);
tcore_pending_set_send_callback(pending, on_confirmation_sms_message_send, NULL);
-
+
free(cmd_str);
-
+
return tcore_hal_send_request(h, pending);
}
.send_cdma_msg = send_cdma_msg,
};
-gboolean s_sms_init(TcorePlugin *p)
+gboolean s_sms_init(TcorePlugin *p, TcoreHal *h)
{
CoreObject *o;
struct property_sms_info *data;
GQueue *work_queue;
- o = tcore_sms_new(p, "umts_sms", &sms_ops);
+ o = tcore_sms_new(p, "umts_sms", &sms_ops, h);
if (!o)
return FALSE;
int data_len;
};
- #define TIZEN_NUM_TYPE_INTERNATIONAL 0x01
- #define TIZEN_NUM_PLAN_ISDN 0x01
+#define TIZEN_NUM_TYPE_INTERNATIONAL 0x01
+#define TIZEN_NUM_PLAN_ISDN 0x01
-static gboolean _ss_request_message( CoreObject *o,
+static gboolean _ss_request_message( CoreObject *o,
UserRequest *ur,
- char *cmd,
- unsigned int cmd_len,
- void* on_resp,
+ char *cmd,
+ unsigned int cmd_len,
+ void* on_resp,
void* user_data );
#if 0
static TReturn _ss_general_response_result(const int result);
#endif
-static TReturn _ss_barring_get( CoreObject *o,
- UserRequest *ur,
- enum telephony_ss_class class,
- enum telephony_ss_barring_mode type,
+static TReturn _ss_barring_get( CoreObject *o,
+ UserRequest *ur,
+ enum telephony_ss_class class,
+ enum telephony_ss_barring_mode type,
enum tcore_response_command resp );
-static TReturn _ss_forwarding_get( CoreObject *o,
- UserRequest *ur,
- enum telephony_ss_class class,
- enum telephony_ss_forwarding_mode type,
+static TReturn _ss_forwarding_get( CoreObject *o,
+ UserRequest *ur,
+ enum telephony_ss_class class,
+ enum telephony_ss_forwarding_mode type,
enum tcore_response_command resp );
-static TReturn _ss_waiting_get( CoreObject *o,
- UserRequest *ur,
- enum telephony_ss_class class,
+static TReturn _ss_waiting_get( CoreObject *o,
+ UserRequest *ur,
+ enum telephony_ss_class class,
enum tcore_response_command resp );
static void on_confirmation_ss_message_send( TcorePending *p, gboolean result, void *user_data );
-static void on_notification_ss_info( CoreObject *o, const void *data, void *user_data );
+static gboolean on_notification_ss_info( CoreObject *o, const void *data, void *user_data );
static void _ss_ussd_response( UserRequest *ur, const char* ussd_str, enum telephony_ss_ussd_type type, enum telephony_ss_ussd_status status );
static void _ss_ussd_notification( TcorePlugin *p, const char* ussd_str, enum telephony_ss_ussd_status status );
-static void on_notification_ss_ussd( CoreObject *o, const void *data, void *user_data );
+static gboolean on_notification_ss_ussd( CoreObject *o, const void *data, void *user_data );
-static gboolean _ss_request_message( CoreObject *o,
+static gboolean _ss_request_message( CoreObject *o,
UserRequest *ur,
- char *cmd,
- unsigned int cmd_len,
- void* on_resp,
+ char *cmd,
+ unsigned int cmd_len,
+ void* on_resp,
void* user_data )
{
TcorePending *pending = 0;
TcoreHal *h = 0;
UserRequest *ur2 = 0;
- ur2 = tcore_user_request_dup( ur );
+ ur2 = tcore_user_request_ref( ur );
pending = tcore_pending_new(o, ID_RESERVED_AT);
tcore_pending_set_request_data(pending, cmd_len, cmd);
}
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
tcore_hal_send_request(h, pending);
return TRUE;
}
#endif
-static void _ss_ussd_response( UserRequest *ur, const char* ussd_str, enum telephony_ss_ussd_type type, enum telephony_ss_ussd_status status )
+static void _ss_ussd_response( UserRequest *ur, const char* ussd_str, enum telephony_ss_ussd_type type, enum telephony_ss_ussd_status status )
{
struct tresp_ss_ussd resp;
resp.err = FALSE;
if ( ussd_str ) {
-
+
int len = strlen( ussd_str );
if ( len < MAX_SS_USSD_LEN ) {
}
-static void on_notification_ss_ussd( CoreObject *o, const void *data, void *user_data )
+static gboolean on_notification_ss_ussd( CoreObject *o, const void *data, void *user_data )
{
enum telephony_ss_ussd_status status;
UssdSession *ussd_session = 0;
switch(m){
case 0:
status = SS_USSD_NO_ACTION_REQUIRE;
- break;
+ break;
case 1:
status = SS_USSD_ACTION_REQUIRE;
- break;
+ break;
case 2:
status = SS_USSD_TERMINATED_BY_NET;
- break;
+ break;
case 3:
status = SS_USSD_OTHER_CLIENT;
- break;
+ break;
case 4:
status = SS_USSD_NOT_SUPPORT;
- break;
+ break;
case 5:
status = SS_USSD_TIME_OUT;
- break;
+ break;
default:
dbg("unsupported m : %d", m);
status = SS_USSD_MAX;
- break;
+ break;
}
if(at_tok_hasmore(&cmd))
{
- err = at_tok_nextstr(&cmd, &tmp_str);
+ err = at_tok_nextstr(&cmd, &tmp_str);
err = at_tok_nextint(&cmd, &dcs);
dbg("ussdstr: %s, dcs :%d", tmp_str, dcs);
-
}
switch ( tcore_util_get_cbs_coding_scheme(dcs) ) {
case TCORE_DCS_TYPE_7_BIT:
case TCORE_DCS_TYPE_UNSPECIFIED: {
- ussd_str = tcore_util_unpack_gsm7bit(tmp_str, strlen(tmp_str));
+ ussd_str = (char *)tcore_util_unpack_gsm7bit((const unsigned char *)tmp_str, strlen(tmp_str));
} break;
case TCORE_DCS_TYPE_UCS2:
memcpy( ussd_str,tmp_str, strlen(tmp_str) );
ussd_str[ strlen(tmp_str) ] = '\0';
}
- } break;
+ } break;
default: {
dbg("[ error ] unknown dcs type. ussd_session : %x", ussd_session);
if ( ussd_session ) {
tcore_ss_ussd_get_session_data( ussd_session, (void**)&ur );
if ( !ur ) {
dbg("[ error ] ur : (0)");
- return;
+ return TRUE;
}
type = (enum telephony_ss_ussd_type)tcore_ss_ussd_get_session_type( ussd_session );
_ss_ussd_response( ur, ussd_str, type, status );
- }
- return;
+ }
+ return TRUE;
}
}
switch ( status ) {
- case SS_USSD_NO_ACTION_REQUIRE:
+ case SS_USSD_NO_ACTION_REQUIRE:
case SS_USSD_ACTION_REQUIRE:
case SS_USSD_OTHER_CLIENT:
case SS_USSD_NOT_SUPPORT:
tcore_ss_ussd_get_session_data( ussd_session, (void**)&ur );
if ( !ur ) {
dbg("[ error ] ur : (0)");
- return;
+ return TRUE;
}
type = (enum telephony_ss_ussd_type)tcore_ss_ussd_get_session_type( ussd_session );
g_free( ussd_str );
}
- } break;
+ } break;
case SS_USSD_TERMINATED_BY_NET: {
if ( ussd_session ) {
tcore_ss_ussd_get_session_data( ussd_session, (void**)&ur );
if ( ur )
- tcore_user_request_free( ur );
+ tcore_user_request_unref( ur );
tcore_ss_ussd_destroy_session( ussd_session );
}
- } break;
+ } break;
default:
break;
}
+ return TRUE;
}
-static void on_notification_ss_info( CoreObject *o, const void *data, void *user_data )
+static gboolean on_notification_ss_info( CoreObject *o, const void *data, void *user_data )
{
TcorePlugin *p = 0;
CoreObject *co = 0;
co = tcore_plugin_ref_core_object( p, "call" );
if (!co) {
dbg("[ error ] plugin_ref_core_object : call");
- return ;
+ return TRUE;
}
cmd = (char*)data;
err = at_tok_nextint(&cmd, &index); //cug index - skip
if(at_tok_hasmore(&cmd)){
err = at_tok_nextstr(&cmd, &number);
- dbg("number : %s",number);
+ dbg("number : %s",number);
err = at_tok_nextint(&cmd, &ton);
}
switch(code2){
case 0: //this is a forwarded call (MT call setup)
tcore_call_information_mt_forwarded_call( co, number );
- break;
+ break;
case 2: //call has been put on hold (during a voice call)
tcore_call_information_held( co, number );
- break;
+ break;
case 3: //call has been retrieved (during a voice call)
tcore_call_information_active( co, number );
- break;
+ break;
case 4: //multiparty call entered (during a voice call)
tcore_call_information_joined( co, number );
- break;
+ break;
case 5: //call on hold has been released
tcore_call_information_released_on_hold( co, number );
- break;
+ break;
case 6: //forward check SS message received (can be received whenever)
tcore_call_information_cf_check_ss_message( co, number );
- break;
+ break;
- case 7: //call is being connected (alerting) with the remote party in alerting state in explicit call transfer operation (during a voice call)
+ case 7: //call is being connected (alerting) with the remote party in alerting state in explicit call transfer operation (during a voice call)
tcore_call_information_transfer_alert( co, number );
- break;
+ break;
case 8: //call has been connected with the other remote party in explicit call transfer operation (also number and subaddress parameters may be present) (during a voice call or MT call setup)
tcore_call_information_transfered( co, number );
- break;
+ break;
case 9: //this is a deflected call (MT call setup):
tcore_call_information_mt_deflected_call( co, number );
- break;
+ break;
default:
- dbg("unsupported cmd2 : %d",code2);
- break;
+ dbg("unsupported cmd2 : %d",code2);
+ break;
}
+
+ return TRUE;
}
static void on_confirmation_ss_message_send( TcorePending *p, gboolean result, void *user_data )
if((metainfo->type == SINGLELINE)||
(metainfo->type == MULTILINE))
{
- //cp rsp prefix
+ //cp rsp prefix
s_responsePrefix = strdup(metainfo->responsePrefix);
- dbg("duplicating responsePrefix : %s\n", s_responsePrefix);
+ dbg("duplicating responsePrefix : %s\n", s_responsePrefix);
}
else
{
//set atcmd type into s_type
s_type = metainfo->type;
}
-
+
static void on_confirmation_call_control_ss_message_send( TcorePending *p, gboolean result, void *user_data )
{
UserRequest* ur = NULL;
metainfo = (struct ATReqMetaInfo*)tcore_user_request_ref_metainfo(ur,&info_len);
if((metainfo->type == SINGLELINE)||
- (metainfo->type == MULTILINE))
+ (metainfo->type == MULTILINE))
{
- //cp rsp prefix
+ //cp rsp prefix
s_responsePrefix = strdup(metainfo->responsePrefix);
- dbg("duplicating responsePrefix : %s\n", s_responsePrefix);
+ dbg("duplicating responsePrefix : %s\n", s_responsePrefix);
}
else
{
s_responsePrefix = NULL;
}
-//set atcmd type into s_type
+ //set atcmd type into s_type
s_type = metainfo->type;
}
-static void on_response_ss_barring_set( TcorePending *p, int data_len, const void *data, void *user_data )
+static void on_response_ss_barring_set( TcorePending *p, int data_len, const void *data, void *user_data )
{
struct ss_confirm_info *info = 0;
enum telephony_ss_class class;
-
+
CoreObject* o = 0;
UserRequest *ur;
struct tresp_ss_general resp;
UserRequest *ur_dup=0;
-
+
o = tcore_pending_ref_core_object(p);
ur = tcore_pending_ref_user_request(p);
- printResponse();
+ printResponse();
info = (struct ss_confirm_info*)user_data;
class = info->class;
{
ReleaseResponse();
- if ( info->class == SS_CLASS_VOICE )
+ if ( info->class == SS_CLASS_VOICE )
class = SS_CLASS_ALL_TELE_BEARER;
- ur_dup = tcore_user_request_dup(ur);
+ ur_dup = tcore_user_request_ref(ur);
- if ( info->flavor_type == SS_BARR_MODE_AB ||
+ if ( info->flavor_type == SS_BARR_MODE_AB ||
info->flavor_type == SS_BARR_MODE_AOB )
_ss_barring_get( o, ur_dup, class, SS_BARR_MODE_BAOC, info->resp );
else if ( info->flavor_type == SS_BARR_MODE_AIB )
if ( ur )
tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_general), &resp);
- else
+ else
dbg("[ error ] ur is 0");
}
}
-static void on_response_ss_barring_change_pwd( TcorePending *p, int data_len, const void *data, void *user_data )
+
+static void on_response_ss_barring_change_pwd( TcorePending *p, int data_len, const void *data, void *user_data )
{
struct ss_confirm_info *info = 0;
UserRequest *ur;
struct tresp_ss_general resp;
ur = tcore_pending_ref_user_request(p);
-
+
info = (struct ss_confirm_info*)user_data;
printResponse();
if ( ur )
tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_general), &resp);
- else
+ else
dbg("[ error ] ur is 0");
g_free(user_data);
-
}
-static void on_response_ss_barring_get( TcorePending *p, int data_len, const void *data, void *user_data )
+static void on_response_ss_barring_get( TcorePending *p, int data_len, const void *data, void *user_data )
{
CoreObject* o = 0;
UserRequest* ur = 0;
- struct ATLine *p_cur;
+ struct ATLine *p_cur;
int status=0, classx =0, err=0;
-
+
struct ss_confirm_info* info = 0;
struct tresp_ss_barring resp;
int countRecords=0, countValidRecords =0;
o = tcore_pending_ref_core_object(p);
ur = tcore_pending_ref_user_request(p);
- printResponse();
+ printResponse();
info = (struct ss_confirm_info*)user_data;
/* count the calls */
for (countRecords = 0, p_cur = sp_response->p_intermediates
- ; p_cur != NULL
- ; p_cur = p_cur->p_next
- ) {
- countRecords++;
+ ; p_cur != NULL
+ ; p_cur = p_cur->p_next
+ ) {
+ countRecords++;
}
- dbg("total records : %d",countRecords);
+ dbg("total records : %d",countRecords);
resp.record_num = countRecords;
resp.record = g_new0( struct barring_info, resp.record_num );
for (countValidRecords = 0, p_cur = sp_response->p_intermediates
- ; p_cur != NULL
- ; p_cur = p_cur->p_next)
+ ; p_cur != NULL
+ ; p_cur = p_cur->p_next)
{
err = at_tok_start(&(p_cur->line));
if (err < 0){
- dbg("start line error. skip this line");
- goto error;
+ dbg("start line error. skip this line");
+ goto error;
}
err = at_tok_nextint(&(p_cur->line), &status);// status
if (err < 0) {
- dbg("status error. skip this line");
- goto error;
- }
-
+ dbg("status error. skip this line");
+ goto error;
+ }
+
if(status == 1){
resp.record[countValidRecords].status = SS_STATUS_ACTIVATE;
}
if (err < 0) {
dbg("class error. classx not exist - set to requested one : %d", info->class);
switch(info->class){
- case SS_CLASS_ALL_TELE:
- classx =7;
- break;
- case SS_CLASS_VOICE:
- classx =1;
- break;
- case SS_CLASS_ALL_DATA_TELE:
- classx =2;
- break;
- case SS_CLASS_FAX:
- classx =4;
- break;
- case SS_CLASS_SMS:
- classx = 8;
- break;
- case SS_CLASS_ALL_CS_SYNC:
- classx = 16;
- break;
-
- default:
- classx =7;
- dbg("unsupported class %d. set to default : 7", info->class);
- break;
+ case SS_CLASS_ALL_TELE:
+ classx =7;
+ break;
+ case SS_CLASS_VOICE:
+ classx =1;
+ break;
+ case SS_CLASS_ALL_DATA_TELE:
+ classx =2;
+ break;
+ case SS_CLASS_FAX:
+ classx =4;
+ break;
+ case SS_CLASS_SMS:
+ classx = 8;
+ break;
+ case SS_CLASS_ALL_CS_SYNC:
+ classx = 16;
+ break;
+
+ default:
+ classx =7;
+ dbg("unsupported class %d. set to default : 7", info->class);
+ break;
}
- }
+ }
switch(classx){
case 1:
resp.record[countValidRecords].class = SS_CLASS_VOICE;
- break;
+ break;
case 2:
resp.record[countValidRecords].class = SS_CLASS_ALL_DATA_TELE;
- break;
+ break;
case 4:
resp.record[countValidRecords].class = SS_CLASS_FAX;
- break;
+ break;
case 7:
resp.record[countValidRecords].class = SS_CLASS_ALL_TELE;
- break;
+ break;
case 8:
resp.record[countValidRecords].class = SS_CLASS_SMS;
- break;
+ break;
case 16:
resp.record[countValidRecords].class = SS_CLASS_ALL_CS_SYNC;
- break;
+ break;
case 32:
resp.record[countValidRecords].class = SS_CLASS_ALL_CS_ASYNC;
- break;
+ break;
default:
- dbg("unspoorted class : [%d]\n", classx );
+ dbg("unspoorted class : [%d]\n", classx );
goto error;
- break;
+ break;
}
resp.record[countValidRecords].mode = (enum telephony_ss_barring_mode)(info->flavor_type);
dbg("valid count :%d",countValidRecords);
resp.record_num = countValidRecords;
resp.err = TCORE_RETURN_SUCCESS;
-
+
}
else
{
dbg("no active status - return to user")
+ }
+
+ if(sp_response->success > 0){
+ resp.err = TCORE_RETURN_SUCCESS;
+ }
+ else{
resp.err = TCORE_RETURN_FAILURE;
}
+
dbg("on_response_ss_barring_get- rsp.err : %d, ur : %x", resp.err, ur);
ReleaseResponse();
if ( ur )
tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_barring), &resp);
- else
+ else
dbg("[ error ] ur is 0");
g_free( user_data );
-
+
}
-static void on_response_ss_forwarding_set( TcorePending *p, int data_len, const void *data, void *user_data )
+static void on_response_ss_forwarding_set( TcorePending *p, int data_len, const void *data, void *user_data )
{
CoreObject* o = 0;
UserRequest* ur = 0, *dup_ur=0;
struct tresp_ss_general resp;
o = tcore_pending_ref_core_object(p);
- ur = tcore_pending_ref_user_request(p);
+ ur = tcore_pending_ref_user_request(p);
info = (struct ss_confirm_info*)user_data;
ReleaseResponse();
- if ( info->flavor_type == SS_CF_MODE_CF_ALL ||
+ if ( info->flavor_type == SS_CF_MODE_CF_ALL ||
info->flavor_type == SS_CF_MODE_CFC ) {
if ( ur )
tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_general), &resp);
- else
+ else
dbg("[ error ] ur is 0");
} else {
- dup_ur = tcore_user_request_dup(ur);
+ dup_ur = tcore_user_request_ref(ur);
_ss_forwarding_get( o, dup_ur, info->class, info->flavor_type, info->resp );
}
if ( ur )
tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_general), &resp);
- else
+ else
dbg("[ error ] ur is 0");
}
g_free(user_data);
}
-static void on_response_ss_forwarding_get( TcorePending *p, int data_len, const void *data, void *user_data )
+static void on_response_ss_forwarding_get( TcorePending *p, int data_len, const void *data, void *user_data )
{
CoreObject* o = 0;
UserRequest* ur = 0;
- struct ATLine *p_cur;
+ struct ATLine *p_cur;
int status=0, classx =0, err=0, ton =0, time=0;
char* num, *subaddr;
-
+
struct ss_confirm_info* info = 0;
struct tresp_ss_forwarding resp;
int countRecords=0, countValidRecords =0;
o = tcore_pending_ref_core_object(p);
ur = tcore_pending_ref_user_request(p);
- printResponse();
+ printResponse();
info = (struct ss_confirm_info*)user_data;
/* count the calls */
for (countRecords = 0, p_cur = sp_response->p_intermediates
- ; p_cur != NULL
- ; p_cur = p_cur->p_next
- ) {
- countRecords++;
+ ; p_cur != NULL
+ ; p_cur = p_cur->p_next
+ ) {
+ countRecords++;
}
- dbg("total records : %d",countRecords);
+ dbg("total records : %d",countRecords);
resp.record_num = countRecords;
if ( resp.record_num > 0 ) {
-// int i = 0;
+ // int i = 0;
resp.record = g_new0( struct forwarding_info, resp.record_num );
for (countValidRecords = 0, p_cur = sp_response->p_intermediates
- ; p_cur != NULL
- ; p_cur = p_cur->p_next)
+ ; p_cur != NULL
+ ; p_cur = p_cur->p_next)
{
err = at_tok_start(&(p_cur->line));
if (err < 0){
- dbg("start line error. skip this line");
- goto error;
+ dbg("start line error. skip this line");
+ goto error;
}
err = at_tok_nextint(&(p_cur->line), &status);// status
if (err < 0) {
- dbg("status error. skip this line");
- goto error;
- }
-
+ dbg("status error. skip this line");
+ goto error;
+ }
+
if(status == 1){
resp.record[countValidRecords].status = SS_STATUS_ACTIVATE;
}
err = at_tok_nextint(&(p_cur->line), &classx); //class
if (err < 0) {
- dbg("class error. skip this line");
- goto error;
- }
+ dbg("class error. skip this line");
+ goto error;
+ }
switch(classx){
case 1:
resp.record[countValidRecords].class = SS_CLASS_VOICE;
- break;
+ break;
case 2:
resp.record[countValidRecords].class = SS_CLASS_ALL_DATA_TELE;
- break;
+ break;
case 4:
resp.record[countValidRecords].class = SS_CLASS_FAX;
- break;
+ break;
case 7:
resp.record[countValidRecords].class = SS_CLASS_ALL_TELE;
- break;
+ break;
case 8:
resp.record[countValidRecords].class = SS_CLASS_SMS;
- break;
+ break;
case 16:
resp.record[countValidRecords].class = SS_CLASS_ALL_CS_SYNC;
- break;
+ break;
case 32:
resp.record[countValidRecords].class = SS_CLASS_ALL_CS_ASYNC;
- break;
+ break;
default:
- dbg("unspoorted class : [%d]\n", classx );
+ dbg("unspoorted class : [%d]\n", classx );
goto error;
- break;
+ break;
}
- if(at_tok_hasmore(&(p_cur->line)) ==1){ //more data present
+ if(at_tok_hasmore(&(p_cur->line)) ==1){ //more data present
err = at_tok_nextstr(&(p_cur->line), &num); //number
memcpy((resp.record[countValidRecords].number), num, strlen(num));
resp.record[countValidRecords].number_present = TRUE;
-
+
err = at_tok_nextint(&(p_cur->line), &ton); // type of number - skip
resp.record[countValidRecords].number_type = ton;
}
}
-
+
}
resp.record[countValidRecords].mode = (enum telephony_ss_barring_mode)(info->flavor_type);
else
{
dbg("no active status - return to user")
+ }
+
+ if(sp_response->success > 0){
+ resp.err = TCORE_RETURN_SUCCESS;
+ }
+ else{
resp.err = TCORE_RETURN_FAILURE;
}
if ( ur )
tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_forwarding), &resp);
- else
+ else
dbg("[ error ] ur is 0");
g_free( user_data );
-
+
}
-static void on_response_ss_waiting_set( TcorePending *p, int data_len, const void *data, void *user_data )
+static void on_response_ss_waiting_set( TcorePending *p, int data_len, const void *data, void *user_data )
{
CoreObject* o = 0;
UserRequest* ur = 0;
if ( ur )
tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_general), &resp);
- else
+ else
dbg("[ error ] ur is 0");
}
g_free( user_data );
}
-static void on_response_ss_waiting_get( TcorePending *p, int data_len, const void *data, void *user_data )
+static void on_response_ss_waiting_get( TcorePending *p, int data_len, const void *data, void *user_data )
{
CoreObject* o = 0;
UserRequest* ur = 0;
- struct ATLine *p_cur;
+ struct ATLine *p_cur;
int status=0, classx =0, err=0;
-
+
struct ss_confirm_info* info = 0;
struct tresp_ss_waiting resp;
int countRecords=0, countValidRecords =0;
o = tcore_pending_ref_core_object(p);
ur = tcore_pending_ref_user_request(p);
- printResponse();
+ printResponse();
info = (struct ss_confirm_info*)user_data;
/* count the calls */
for (countRecords = 0, p_cur = sp_response->p_intermediates
- ; p_cur != NULL
- ; p_cur = p_cur->p_next
- ) {
- countRecords++;
+ ; p_cur != NULL
+ ; p_cur = p_cur->p_next
+ ) {
+ countRecords++;
}
- dbg("total records : %d",countRecords);
+ dbg("total records : %d",countRecords);
resp.record_num = countRecords;
if ( resp.record_num > 0 ) {
-// int i = 0;
+ // int i = 0;
resp.record = g_new0( struct waiting_info, resp.record_num );
for (countValidRecords = 0, p_cur = sp_response->p_intermediates
- ; p_cur != NULL
- ; p_cur = p_cur->p_next)
+ ; p_cur != NULL
+ ; p_cur = p_cur->p_next)
{
err = at_tok_start(&(p_cur->line));
if (err < 0){
- dbg("start line error. skip this line");
- goto error;
+ dbg("start line error. skip this line");
+ goto error;
}
-
+
err = at_tok_nextint(&(p_cur->line), &status);// status
if (err < 0) {
- dbg("status error. skip this line");
- goto error;
- }
-
+ dbg("status error. skip this line");
+ goto error;
+ }
+
if(status == 1){
resp.record[countValidRecords].status = SS_STATUS_ACTIVATE;
}
err = at_tok_nextint(&(p_cur->line), &classx); //class
if (err < 0) {
- dbg("class error. skip this line");
- goto error;
- }
+ dbg("class error. skip this line");
+ goto error;
+ }
switch(classx){
case 1:
resp.record[countValidRecords].class = SS_CLASS_VOICE;
- break;
+ break;
case 2:
resp.record[countValidRecords].class = SS_CLASS_ALL_DATA_TELE;
- break;
+ break;
case 4:
resp.record[countValidRecords].class = SS_CLASS_FAX;
- break;
+ break;
case 7:
resp.record[countValidRecords].class = SS_CLASS_ALL_TELE;
- break;
+ break;
case 8:
resp.record[countValidRecords].class = SS_CLASS_SMS;
- break;
+ break;
case 16:
resp.record[countValidRecords].class = SS_CLASS_ALL_CS_SYNC;
- break;
+ break;
case 32:
resp.record[countValidRecords].class = SS_CLASS_ALL_CS_ASYNC;
- break;
+ break;
default:
- dbg("unspoorted class : [%d]\n", classx );
+ dbg("unspoorted class : [%d]\n", classx );
goto error;
- break;
+ break;
}
countValidRecords++;
else
{
dbg("no active status - return to user")
+ }
+
+ if(sp_response->success > 0){
+ resp.err = TCORE_RETURN_SUCCESS;
+ }
+ else{
resp.err = TCORE_RETURN_FAILURE;
}
+
dbg("on_response_ss_waiting_get - rsp.err : %d, ur : %x", resp.err, ur);
ReleaseResponse();
if ( ur )
tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_waiting), &resp);
- else
+ else
dbg("[ error ] ur is 0");
g_free( user_data );
-
+
}
static void on_confirmation_ss_ussd( TcorePending *p, int data_len, const void *data, void *user_data )
ur = tcore_pending_ref_user_request(p);
- printResponse();
-
+ printResponse();
+
info = (struct ss_confirm_info*)user_data;
-
+
if(sp_response->success > 0){
resp.err = TCORE_RETURN_SUCCESS;
- }
+ }
else{
resp.err = TCORE_RETURN_FAILURE;
}
dbg("on_confirmation_ss_ussd - rsp.err : %d, ur : %x", resp.err, ur);
- if ( resp.err ) {
+ if (sp_response->success > 0) {
UssdSession *ussd_s = 0;
enum tcore_ss_ussd_type type = 0;
tcore_ss_ussd_get_session_data( ussd_s, (void**)&ur2 );
if ( ur2 )
- tcore_user_request_free( ur2 );
+ tcore_user_request_unref( ur2 );
tcore_ss_ussd_destroy_session( ussd_s );
}
ReleaseResponse();
}
+
+ g_free( user_data );
+
}
int opco;
int classx;
char* facility = NULL;
-
+
barring = (struct treq_ss_barring*)tcore_user_request_ref_data( ur, 0 );
p = tcore_object_ref_plugin( o );
case SS_CLASS_ALL_CS_SYNC:
classx = 16;
break;
-
+
default:
classx =7;
dbg("unsupported class %d. set to default : 7", barring->class);
passwd[MAX_SS_BARRING_PASSWORD_LEN]='\0';
- cmd_str = g_strdup_printf("AT+CLCK=\"%s\",%d,\"%s\",%d%s", facility, opco, passwd, classx,"\r");
+ cmd_str = g_strdup_printf("AT+CLCK=\"%s\",%d,\"%s\",%d%s", facility, opco, passwd, classx,"\r");
dbg("request command : %s", cmd_str);
-
-
user_data = g_new0( struct ss_confirm_info, 1 );
return TCORE_RETURN_SUCCESS;
}
-static TReturn _ss_barring_get( CoreObject *o,
- UserRequest *ur,
- enum telephony_ss_class class,
- enum telephony_ss_barring_mode mode,
+static TReturn _ss_barring_get( CoreObject *o,
+ UserRequest *ur,
+ enum telephony_ss_class class,
+ enum telephony_ss_barring_mode mode,
enum tcore_response_command resp )
{
TcorePlugin *p = 0;
char* cmd_str = NULL;
int opco, classx;
char* facility = NULL;
-
+
p = tcore_object_ref_plugin( o );
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
- //query status - opco is fixed to 2
+ //query status - opco is fixed to 2
opco = 2;
//barring mode
case SS_CLASS_ALL_CS_SYNC:
classx = 16;
break;
-
+
default:
classx =7;
dbg("unsupported class %d. set to default : 7", class);
break;
case SS_CF_MODE_CFC:
reason = 5;
- break;
-
+ break;
+
default:
dbg("unsupported reason : %d");
break;
}
-
+
switch(op){
case TIZEN_SS_OPCO_DEACTIVATE:
mode = 0;
case SS_CLASS_ALL_CS_SYNC:
classx = 16;
break;
-
+
default:
classx =7;
dbg("unsupported class %d. set to default : 7", forwarding->class);
break;
}
-//number
+//number
len = strlen(forwarding->number);
if ( len > 0 ){
valid_num = TRUE;
else// other opcode does not need num field
tmp_str = g_strdup_printf("AT+CCFC=%d,%d,,,%d", reason, mode, classx);
-
if(forwarding->mode == SS_CF_MODE_CFNRy){
//add time info to 'no reply' case
time = (int)(forwarding->time);
- cmd_str = g_strdup_printf("%s,,,%d%s", tmp_str,time,"\r");
+ cmd_str = g_strdup_printf("%s,,,%d%s", tmp_str,time,"\r");
}
else {
- cmd_str = g_strdup_printf("%s%s", tmp_str,"\r");
+ cmd_str = g_strdup_printf("%s%s", tmp_str,"\r");
}
dbg("request command : %s", cmd_str);
-
-
user_data->flavor_type = forwarding->mode;
user_data->class = forwarding->class;
return TCORE_RETURN_SUCCESS;
}
-static TReturn _ss_forwarding_get( CoreObject *o,
- UserRequest *ur,
- enum telephony_ss_class class,
- enum telephony_ss_forwarding_mode type,
+static TReturn _ss_forwarding_get( CoreObject *o,
+ UserRequest *ur,
+ enum telephony_ss_class class,
+ enum telephony_ss_forwarding_mode type,
enum tcore_response_command resp )
{
TcorePlugin *p = 0;
break;
case SS_CF_MODE_CFC:
reason = 5;
- break;
-
+ break;
+
default:
dbg("unsupported reason : %d");
break;
classx =7;
dbg("unsupported class %d. set to default : 7", class);
break;
- }
+ }
//query status - mode set to 2
mode =2;
int mode=0, classx=0;
char* cmd_str;
struct ATReqMetaInfo metainfo;
-
+
//set metainfo
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = NO_RESULT;
metainfo.responsePrefix[0] ='\0';
tcore_user_request_set_metainfo(ur, sizeof(struct ATReqMetaInfo), &metainfo);
-
+
p = tcore_object_ref_plugin( o );
waiting = (struct treq_ss_waiting*) tcore_user_request_ref_data( ur, 0 );
if ( opco == TIZEN_SS_OPCO_ACTIVATE ){
user_data->resp = TRESP_SS_WAITING_ACTIVATE;
mode = 1;//enable
- }
+ }
else if ( opco == TIZEN_SS_OPCO_DEACTIVATE ){
user_data->resp = TRESP_SS_WAITING_DEACTIVATE;
mode =0; //diable
else
dbg("[ error ] unknown ss mode (0x%x)", opco);
-switch(waiting->class)
+ switch(waiting->class)
{
case SS_CLASS_ALL_TELE:
classx =7;
- break;
+ break;
case SS_CLASS_VOICE:
classx =1;
- break;
+ break;
case SS_CLASS_ALL_DATA_TELE:
classx =2;
- break;
+ break;
case SS_CLASS_FAX:
classx =4;
- break;
+ break;
case SS_CLASS_SMS:
classx = 8;
- break;
-
+ break;
+
default:
classx =7;
dbg("unsupported class %d. set to default : 7", waiting->class);
- break;
- }
-
+ break;
+ }
- user_data->class = waiting->class;
+
+user_data->class = waiting->class;
user_data->flavor_type = (int)opco;
cmd_str = g_strdup_printf("AT+CCWA=1,%d,%d%s", mode, classx,"\r"); //always enable +CCWA: unsolicited cmd
return TCORE_RETURN_SUCCESS;
}
-static TReturn _ss_waiting_get( CoreObject *o,
- UserRequest *ur,
- enum telephony_ss_class class,
+static TReturn _ss_waiting_get( CoreObject *o,
+ UserRequest *ur,
+ enum telephony_ss_class class,
enum tcore_response_command resp )
{
TcorePlugin *p = 0;
info_len = sizeof(struct ATReqMetaInfo);
tcore_user_request_set_metainfo(ur, sizeof(struct ATReqMetaInfo), &metainfo);
-
+
p = tcore_object_ref_plugin( o );
switch(class)
classx =7;
dbg("unsupported class %d. set to default : 7", class);
break;
- }
+ }
dbg("allocating user data");
user_data = g_new0( struct ss_confirm_info, 1 );
static TReturn s_ss_cli_get_status( CoreObject *o, UserRequest *ur )
{
+ TcorePlugin *p = 0;
+
+ struct treq_ss_cli *cli = 0;
+ gboolean ret = FALSE;
+ char *cmd_prefix = NULL, *rsp_prefix = NULL, *cmd_str = NULL;
+ struct ATReqMetaInfo metainfo;
+ enum telephony_ss_cli_type *user_data = 0;
+
+ int info_len =0;
+
+ p = tcore_object_ref_plugin(o);
+
+ cli = (struct treq_ss_cli*)tcore_user_request_ref_data( ur, 0 );
+
+ switch(cli->type){
+ case SS_CLI_TYPE_CLIP:
+ cmd_prefix = "+CLIP";
+ rsp_prefix = "+CLIP:";
+ break;
+
+ case SS_CLI_TYPE_CLIR:
+ cmd_prefix = "+CLIR";
+ rsp_prefix = "+CLIR:";
+ break;
+
+ case SS_CLI_TYPE_COLP:
+ cmd_prefix = "+COLP";
+ rsp_prefix = "+COLP:";
+ break;
+
+ case SS_CLI_TYPE_CDIP:
+ cmd_prefix = "+CDIP";
+ rsp_prefix = "+CDIP:";
+ break;
+
+ default:
+ dbg("unsupported cli_type : %d", cli->type);
+ return TCORE_RETURN_FAILURE;
+ break;
+ }
+
+ dbg("cmd_prefix : %s",cmd_prefix);
+
+//set metaInfo
+ memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
+ metainfo.type = SINGLELINE;
+ memcpy(metainfo.responsePrefix,rsp_prefix,strlen(rsp_prefix));
+ info_len = sizeof(struct ATReqMetaInfo);
+
+ tcore_user_request_set_metainfo(ur, sizeof(struct ATReqMetaInfo), &metainfo);
+
+ //make cmd string
+
+ cmd_str = g_strdup_printf("AT%s?%s", cmd_prefix, "\r");
+ dbg("request cmd : %s", cmd_str);
+
+ // make userinfo for callback
+ user_data = g_new0( enum telephony_ss_cli_type, 1 );
+ *user_data = cli->type;
+
+ ret = _ss_request_message( o, ur, cmd_str, strlen(cmd_str), on_response_ss_waiting_get, user_data );
+
+ g_free(cmd_str);
+
+ if ( !ret )
+ return TCORE_RETURN_FAILURE;
+
return TCORE_RETURN_SUCCESS;
}
struct treq_ss_ussd *ussd = 0;
struct ss_confirm_info *user_data = 0;
-
+
gboolean ret = FALSE;
char* cmd_str;
struct ATReqMetaInfo metainfo;
-
-//set metainfo
+
+ //set metainfo
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = NO_RESULT;
metainfo.responsePrefix[0] ='\0';
tcore_user_request_set_metainfo(ur, sizeof(struct ATReqMetaInfo), &metainfo);
-
+
p = tcore_object_ref_plugin(o);
ussd = (struct treq_ss_ussd*)tcore_user_request_ref_data( ur, 0 );
ussd_s = tcore_ss_ussd_get_session( o );
if ( !ussd_s ) {
- tcore_ss_ussd_create_session( o, (enum tcore_ss_ussd_type)ussd->type, (void*)tcore_user_request_dup(ur), 0 );
+ tcore_ss_ussd_create_session( o, (enum tcore_ss_ussd_type)ussd->type, (void*)tcore_user_request_ref(ur), 0 );
} else {
if ( ussd->type == SS_USSD_TYPE_USER_INITIATED ) {
int info_len =0;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = NO_RESULT;
int info_len =0;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = NO_RESULT;
int info_len =0;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = NO_RESULT;
int info_len =0;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = NO_RESULT;
int info_len =0;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = NO_RESULT;
TcorePlugin *p = NULL;
TcoreHal *h = NULL;
TcorePending *pending = NULL;
- char* cmd_str = NULL;
+ char* cmd_str = NULL;
struct ATReqMetaInfo metainfo;
- int info_len =0;
+ int info_len =0;
GSList *l = 0;
CallObject *co = 0;
dbg("active call id : [ %d ]");
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = NO_RESULT;
int info_len =0;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = NO_RESULT;
cmd_str = g_strdup_printf("%s%s", "AT+CHLD=4", "\r");
-
+
dbg("cmd : %s, prefix(if any) : %s, cmd_len : %d",cmd_str, "N/A", strlen(cmd_str));
pending = tcore_pending_new(o, ID_RESERVED_AT);
int info_len =0;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = NO_RESULT;
cmd_str = g_strdup_printf("%s%s%s", "AT+CHLD=4", number,"\r");
-
+
dbg("cmd : %s, prefix(if any) : %s, cmd_len : %d",cmd_str, "N/A", strlen(cmd_str));
pending = tcore_pending_new(o, ID_RESERVED_AT);
int info_len =0;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = NO_RESULT;
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
- cmd_str = g_strdup_printf("%s%s", "AT+CHLD=5", "\r");
+ cmd_str = g_strdup_printf("%s%s", "AT+CHLD=5", "\r");
dbg("cmd : %s, prefix(if any) : %s, cmd_len : %d",cmd_str, "N/A", strlen(cmd_str));
int info_len =0;
p = tcore_object_ref_plugin(o);
- h = tcore_plugin_ref_hal(p);
+ h = tcore_object_get_hal(o);
memset(&metainfo, 0, sizeof(struct ATReqMetaInfo));
metainfo.type = NO_RESULT;
tcore_user_request_set_metainfo(ur, info_len, &metainfo);
- cmd_str= g_strdup_printf("%s%s", "AT+CHLD=6", "\r");
+ cmd_str= g_strdup_printf("%s%s", "AT+CHLD=6", "\r");
dbg("cmd : %s, prefix(if any) : %s, cmd_len : %d",cmd_str, "N/A", strlen(cmd_str));
#endif
-gboolean s_ss_init( TcorePlugin *p )
+gboolean s_ss_init(TcorePlugin *p, TcoreHal *h)
{
CoreObject *so = 0, *co = 0;
struct property_call_info *data = 0;
dbg("s_ss_init()");
- so = tcore_ss_new( p, "ss", &ss_ops );
+ so = tcore_ss_new(p, "ss", &ss_ops, h);
if (!so) {
dbg("[ error ] ss_new()");
return FALSE;
--- /dev/null
+<manifest>
+ <request>
+ <domain name="telephony_framework"/>
+ </request>
+ <assign>
+ <filesystem path="/usr/lib/telephony/plugins/atmodem-plugin.so" label="telephony_framework"/>
+ </assign>
+ <request>
+ <domain name="telephony_framework"/>
+ </request>
+</manifest>