[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnokii/common/phones nk6100.c,1.157,1.158
From: |
BORBELY Zoltan <address@hidden> |
Subject: |
gnokii/common/phones nk6100.c,1.157,1.158 |
Date: |
Sun, 30 Nov 2003 19:38:09 +0000 |
Update of /cvsroot/gnokii/gnokii/common/phones
In directory subversions:/tmp/cvs-serv8105/common/phones
Modified Files:
nk6100.c
Log Message:
call status implemented in the 6110 series
Index: nk6100.c
===================================================================
RCS file: /cvsroot/gnokii/gnokii/common/phones/nk6100.c,v
retrieving revision 1.157
retrieving revision 1.158
diff -C2 -d -r1.157 -r1.158
*** nk6100.c 3 Nov 2003 23:01:14 -0000 1.157
--- nk6100.c 30 Nov 2003 19:38:06 -0000 1.158
***************
*** 101,108 ****
--- 101,110 ----
static gn_error SetSMSCenter(gn_data *data, struct gn_statemachine *state);
static gn_error SetCellBroadcast(gn_data *data, struct gn_statemachine
*state);
+ static gn_error GetActiveCalls1(gn_data *data, struct gn_statemachine *state);
static gn_error MakeCall1(gn_data *data, struct gn_statemachine *state);
static gn_error AnswerCall1(gn_data *data, struct gn_statemachine *state);
static gn_error CancelCall1(gn_data *data, struct gn_statemachine *state);
static gn_error SetCallNotification(gn_data *data, struct gn_statemachine
*state);
+ static gn_error GetActiveCalls(gn_data *data, struct gn_statemachine *state);
static gn_error MakeCall(gn_data *data, struct gn_statemachine *state);
static gn_error AnswerCall(gn_data *data, struct gn_statemachine *state);
***************
*** 317,320 ****
--- 319,324 ----
case GN_OP_NetMonitor:
return pnok_netmonitor(data, state);
+ case GN_OP_GetActiveCalls:
+ return GetActiveCalls(data, state);
case GN_OP_MakeCall:
return MakeCall(data, state);
***************
*** 2992,2995 ****
--- 2996,3009 ----
}
+ static gn_error GetActiveCalls1(gn_data *data, struct gn_statemachine *state)
+ {
+ char req[] = {FBUS_FRAME_HEADER, 0x20};
+
+ if (!data->call_active) return GN_ERR_INTERNALERROR;
+
+ if (sm_message_send(4, 0x01, req, state)) return GN_ERR_NOTREADY;
+ return sm_block(0x01, data, state);
+ }
+
static gn_error MakeCall1(gn_data *data, struct gn_statemachine *state)
{
***************
*** 3136,3139 ****
--- 3150,3161 ----
}
+ static gn_error GetActiveCalls(gn_data *data, struct gn_statemachine *state)
+ {
+ if (DRVINSTANCE(state)->capabilities & NK6100_CAP_OLD_CALL_API)
+ return GN_ERR_NOTSUPPORTED;
+ else
+ return GetActiveCalls1(data, state);
+ }
+
static gn_error MakeCall(gn_data *data, struct gn_statemachine *state)
{
***************
*** 3180,3184 ****
--- 3202,3208 ----
{
gn_call_info cinfo;
+ gn_call_active *ca;
unsigned char *pos;
+ int i;
switch (message[3]) {
***************
*** 3248,3251 ****
--- 3272,3310 ----
return GN_ERR_UNSOLICITED;
+ /* call status */
+ case 0x21:
+ if (!data->call_active) return GN_ERR_INTERNALERROR;
+ pos = message + 5;
+ ca = data->call_active;
+ memset(ca, 0x00, 2 * sizeof(gn_call_active));
+ for (i = 0; i < message[4]; i++) {
+ if (pos[0] != 0x64) return GN_ERR_UNHANDLEDFRAME;
+ ca[i].call_id = pos[2];
+ ca[i].channel = pos[3];
+ switch (pos[4]) {
+ case 0x00: ca[i].state = GN_CALL_Idle; break;
+ case 0x02: ca[i].state = GN_CALL_Dialing; break;
+ case 0x03: ca[i].state = GN_CALL_Ringing; break;
+ case 0x04: ca[i].state = GN_CALL_Incoming; break;
+ case 0x05: ca[i].state = GN_CALL_Established; break;
+ case 0x06: ca[i].state = GN_CALL_Held; break;
+ case 0x07: ca[i].state = GN_CALL_RemoteHangup; break;
+ default: return GN_ERR_UNHANDLEDFRAME;
+ }
+ switch (pos[5]) {
+ case 0x00: ca[i].prev_state = GN_CALL_Idle; break;
+ case 0x02: ca[i].prev_state = GN_CALL_Dialing; break;
+ case 0x03: ca[i].prev_state = GN_CALL_Ringing; break;
+ case 0x04: ca[i].prev_state = GN_CALL_Incoming; break;
+ case 0x05: ca[i].prev_state = GN_CALL_Established;
break;
+ case 0x06: ca[i].prev_state = GN_CALL_Held; break;
+ case 0x07: ca[i].prev_state = GN_CALL_RemoteHangup;
break;
+ default: return GN_ERR_UNHANDLEDFRAME;
+ }
+ pnok_string_decode(ca[i].name, sizeof(ca[i].name), pos
+ 11, pos[10]);
+ pos += pos[1] + 2;
+ }
+ break;
+
/* call held */
case 0x23:
***************
*** 3262,3265 ****
--- 3321,3328 ----
if (DRVINSTANCE(state)->call_notification)
DRVINSTANCE(state)->call_notification(GN_CALL_Resumed,
&cinfo, state);
+ return GN_ERR_UNSOLICITED;
+
+ /* call switch */
+ case 0x27:
return GN_ERR_UNSOLICITED;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnokii/common/phones nk6100.c,1.157,1.158,
BORBELY Zoltan <address@hidden> <=