return -1;
}
- /* ±âÁ¸ ³»¿ë »èÁ¦ */
-
+ /* clear old contents */
ftruncate(fd, 0);
memset(buf, 0, sizeof(buf));
sprintf(buf, "%d", (int)getpid());
BYTE packet[TAPI_NETTEXT_MSG_SIZE_MAX];
- BYTE SCA[TAPI_NETTEXT_SCADDRESS_LEN_MAX]; //send SMS ÇÒ¶§ »ç¿ëÇÏ´Â ½ÇÁ¦ SCA°ª
+ BYTE SCA[TAPI_NETTEXT_SCADDRESS_LEN_MAX]; // real SCA value for sending SMS
//BYTE ScaAddr[TAPI_NETTEXT_SCADDRESS_LEN_MAX]; // in
SmsAddressInfo szSCAddr;
BYTE decodeScaAddr[TAPI_NETTEXT_SCADDRESS_LEN_MAX];
/************SCA ADDRESS GET START**************/
//TO DO
- //SCA°ª ä¿ì±â
+ //fill the SCA value
//TapiGetServiceCenterAddress(&szSCAddr);
strcpy( SCA, "820199111" );
/*
if ( ton != SIM_TON_ALPHA_NUMERIC )
{
- // Origination/Destination address Çʵ忡¼ÀÇ length´Â ½ÇÁ¦ address length
- // origination/destination address ÇʵåÀÎ °æ¿ì length°¡ 0 ÀÏ ¶§¶óµµ number type/plan Çʵå´Â 0xFF °ªÀ» °®´Â´Ù.
+ // Origination/Destination address field's length is the real address length.
+ // The number type/plan field is '0xFF' even the origination/destination address field's length is zero.
//dialnumLen = pAddrField[index++];
length = pAddrField[index];
- // º¸³»Áö ¾ÊÀº ¸Þ½ÃÁöÀÇ °æ¿ì¿¡´Â service center address°¡ ¾øÀ» ¼öµµ ÀÖ´Ù.
- // ÀÌ °æ¿ì¿¡ length °¡ 0 À̸é number type, plan µµ ¾ø´Â °æ¿ì
- // length °¡ 1 À̸é type, plan ¸¸ ÀÖ´Â °æ¿ì
+ // the service center address could be null when the message doesn't be sent.
+ // In this case,
+ // when the length is 0, there is no number type and plan,
+ // when the length is 1, there are the only type and plan.
if ( length > 1 )
{
- dialnumLen = ( pAddrField[index++] - 1 ) * 2; // -1Àº TON/API Çʵå
+ dialnumLen = ( pAddrField[index++] - 1 ) * 2; // -1 is for TON/API field.
}
}
else
dialnumLen = ( ( ( pAddrField[index++] + 1 ) / 2 ) * 8 ) / 7;
}
-
-
-
- // SIM_SMSP_ADDRESS_LEN º¸´Ù address length °¡ Å©¸é SIM_SMSP_ADDRESS_LEN ¸¸Å¸¸ º¯È¯À» ÇÑ´Ù.
-
if ( dialnumLen > SIM_SMSP_ADDRESS_LEN )
{
dialnumLen = SIM_SMSP_ADDRESS_LEN;
if ( ton != SIM_TON_ALPHA_NUMERIC )
{
- // Origination/Destination address Çʵ忡¼ÀÇ length´Â ½ÇÁ¦ address length
- // origination/destination address ÇʵåÀÎ °æ¿ì length°¡ 0 ÀÏ ¶§¶óµµ number type/plan Çʵå´Â 0xFF °ªÀ» °®´Â´Ù.
dialnumLen = pAddrField[index++];
-
}
else
{
dialnumLen = ( ( ( pAddrField[index++] + 1 ) / 2 ) * 8 ) / 7;
}
-
-
-
- // SIM_SMSP_ADDRESS_LEN º¸´Ù address length °¡ Å©¸é SIM_SMSP_ADDRESS_LEN ¸¸Å¸¸ º¯È¯À» ÇÑ´Ù.
-
if ( dialnumLen > SIM_SMSP_ADDRESS_LEN )
{
dialnumLen = SIM_SMSP_ADDRESS_LEN;
if ( ton != SIM_TON_ALPHA_NUMERIC )
{
- // Origination/Destination address Çʵ忡¼ÀÇ length´Â ½ÇÁ¦ address length
pAddrField[index++] = (unsigned char)dialnumLen;
//printf(" addr len packet: %d\n", pAddrField[index]);
}
{
pAddrField[index] = (unsigned char) ( ( ( dialnumLen * 7 + 7 ) / 8 ) * 2 );
- // ¸¶Áö¸· ¹ÙÀÌÆ®¿¡¼ »óÀ§ 4ºñÆ®°¡ »ç¿ëµÇÁö ¾ÊÀ¸¸é length Çʵ尪À» -1À» ÇÑ´Ù.
+ // On last byte, if the high 4 bit doesn't be used, then do -1 to the length field.
if ( ( ( dialnumLen * 7 ) % 8 ) <= 4 )
pAddrField[index]--;
}
SET_TON_NPI( pAddrField[index], ton, npi );
-
- index++; // SET_TON_NPI °¡ MACRO À̹ǷΠ³»ºÎ¿¡¼ Áõ°¡½ÃÅ°¸é ¹ö±×
+ index++; // SET_TON_NPI is a MACRO, so we couldn't use like 'pAddrField[index++]'.
if ( ton != SIM_TON_ALPHA_NUMERIC )
{
if ( ton != SIM_TON_ALPHA_NUMERIC )
{
- // Origination/Destination address Çʵ忡¼ÀÇ length´Â ½ÇÁ¦ address length
pAddrField[index++] = (unsigned char)dialnumLen;
//printf(" addr len packet: %d\n", pAddrField[index]);
}
{
pAddrField[index] = (unsigned char) ( ( ( dialnumLen * 7 + 7 ) / 8 ) * 2 );
- // ¸¶Áö¸· ¹ÙÀÌÆ®¿¡¼ »óÀ§ 4ºñÆ®°¡ »ç¿ëµÇÁö ¾ÊÀ¸¸é length Çʵ尪À» -1À» ÇÑ´Ù.
if ( ( ( dialnumLen * 7 ) % 8 ) <= 4 )
pAddrField[index]--;
}
SET_TON_NPI( pAddrField[index], ton, npi );
-
- index++; // SET_TON_NPI °¡ MACRO À̹ǷΠ³»ºÎ¿¡¼ Áõ°¡½ÃÅ°¸é ¹ö±×
+ index++;
if ( ton != SIM_TON_ALPHA_NUMERIC )
{
return 0;
}
- // Service Center address Çʵ忡¼ÀÇ length´Â µÚ¿¡ ³ª¿À´Â byteÀÇ ¼ö
- // -> ½ÇÁ¦ address ±æÀÌ´Â TON/API ¹ÙÀÌÆ®¸¦ Á¦¿ÜÇÏ°í ³ª¸ÓÁö ¹ÙÀÌÆ®ÀÇ 2¹è or 2¹è - 1(½ÇÁ¦ ±æÀÌ°¡ Ȧ¼öÀΰæ¿ì)
length = pAddrField[index];
- // º¸³»Áö ¾ÊÀº ¸Þ½ÃÁöÀÇ °æ¿ì¿¡´Â service center address°¡ ¾øÀ» ¼öµµ ÀÖ´Ù.
- // ÀÌ °æ¿ì¿¡ length °¡ 0 À̸é number type, plan µµ ¾ø´Â °æ¿ì
- // length °¡ 1 À̸é type, plan ¸¸ ÀÖ´Â °æ¿ì
+
if ( length > 1 )
{
- pSmsAddrField->dialnumLen = ( pAddrField[index++] - 1 ) * 2; // -1Àº TON/API Çʵå
+ pSmsAddrField->dialnumLen = ( pAddrField[index++] - 1 ) * 2; // -1Àis for TON/API field
- // SIM_SMSP_ADDRESS_LEN º¸´Ù address length °¡ Å©¸é SIM_SMSP_ADDRESS_LEN ¸¸Å¸¸ º¯È¯À» ÇÑ´Ù.
if ( pSmsAddrField->dialnumLen > SIM_SMSP_ADDRESS_LEN )
{
pSmsAddrField->dialnumLen = SIM_SMSP_ADDRESS_LEN;
if ( pSmsAddrField == NULL || pAddrField == NULL )
return -1;
- // Service Center address Çʵ忡¼ÀÇ length´Â µÚ¿¡ ³ª¿À´Â byteÀÇ ¼ö
- // -> ½ÇÁ¦ address ±æÀÌ´Â TON/API ¹ÙÀÌÆ®¸¦ Á¦¿ÜÇÏ°í ³ª¸ÓÁö ¹ÙÀÌÆ®ÀÇ 2¹è or 2¹è - 1(½ÇÁ¦ ±æÀÌ°¡ Ȧ¼öÀΰæ¿ì)
if ( pSmsAddrField->dialnumLen % 2 )
{
- pAddrField[index++] = pSmsAddrField->dialnumLen / 2 + 1 + 1; // +1 Àº TON/NPI Çʵå, Ȧ¼ö°³ÀÎ °æ¿ì´Â °³¼ö¸¦ ¸ÂÃß±â À§ÇØ Çѹø ´õ +1
+ pAddrField[index++] = pSmsAddrField->dialnumLen / 2 + 1 + 1; // +1 is for TON/NPI field, and if it's odd then +1 again.
}
else
{
- pAddrField[index++] = pSmsAddrField->dialnumLen / 2 + 1; // +1 Àº TON/NPI Çʵå
+ pAddrField[index++] = pSmsAddrField->dialnumLen / 2 + 1; // +1 is for TON/NPI field
}
SET_TON_NPI( pAddrField[index], pSmsAddrField->ton, pSmsAddrField->npi );
-
- index++; // SET_TON_NPI °¡ MACRO À̹ǷΠ³»ºÎ¿¡¼ Áõ°¡½ÃÅ°¸é ¹ö±×¹ß»ý
+ index++;
SmsUtilConvertDigit2BCD( (char*) &pAddrField[index], (char*) pSmsAddrField->diallingNum, pSmsAddrField->dialnumLen );
#ifndef _vgsm_call_h
#define _vgsm_call_h
-#define MAX_GSM_CALL_LIST_NUMBER 6 // ±âÁ¸¿¡´Â 6.
-#define MAX_GSM_DIALED_DIGITS_NUMBER 32 //±âÁ¸¿¡´Â 32.
+#define MAX_GSM_CALL_LIST_NUMBER 6
+#define MAX_GSM_DIALED_DIGITS_NUMBER 32
#define MAX_BUF_LEN 256
/* DIRECTION field */
#define _vgsm_error_h_
/*
- * ¾Æ·¡ÀÇ ¿¡·¯ÄÚµåÁß ¾îÇø®ÄÉÀ̼Ç(Æù¾îÇø®ÄÉÀ̼Ç)¿¡¼ üũÇÏ´Â °ÍÀº
- * AT command result°¡ OK°¡ ¾Æ´Ñ ´ÙÀ½ÀÇ °æ¿ì
- * ERR_CME
- * ERR_CMS
- * ERR_UNKNOWN
- * ERR_UNKNOWNRESPONSE
- * ÀÌ·¸°Ô ³× °³ÀÇ °æ¿ì¸¸ È®ÀÎÇÑ´Ù.
+ * The phone app checks,
+ * when the AT command result is not OK,
+ * ERR_CME
+ * ERR_CMS
+ * ERR_UNKNOWN
+ * ERR_UNKNOWNRESPONSE
+ * only this four cases.
*/
typedef enum {
ERR_NONE=1,
ERR_CME,
ERR_CMS,
ERR_UNKNOWN,
- ERR_UNKNOWNRESPONSE, // Á¤ÀǵÇÁö ¾ÊÀº response
- ERR_DEVICEOPENERROR, // device open ¿¡·¯
- ERR_DEVICELOCKED, // device lock ¿¡·¯
+ ERR_UNKNOWNRESPONSE,
+ ERR_DEVICEOPENERROR,
+ ERR_DEVICELOCKED,
ERR_DEVICENOTEXIST,
ERR_DEVICEBUSY,
ERR_DEVICENOPERMISSION,
ERR_DEVICEWRITEERROR,
ERR_DEVICEREADERROR,
ERR_DEVICEPARITYERROR,
- ERR_TIMEOUT, // at command timeout ¿¡·¯
+ ERR_TIMEOUT,
ERR_FRAMENOTREQUESTED,
- ERR_UNKNOWNFRAME, // À§ÀÇ °æ¿ì¿Í À¯»ç
+ ERR_UNKNOWNFRAME,
ERR_UNKNOWNCONNECTIONTYPESTRING,
ERR_UNKNOWNMODELSTRING,
ERR_SOURCENOTAVAILABLE,
}gsm_net_identity_data_coding_scheme;
typedef struct {
gsm_net_plmn_status_e_type status;
- char plmn[6]; /* PLMN: MCC(3byte)+MNC(3byte) MNC°¡ 2ÀÚ¸®ÀÎ °æ¿ì ¸¶Áö¸· ºóÀÚ¸®¿¡ '#'À» ä¿ö 6ÀÚ¸®·Î ¸¸µé¾î ÁÜ */
+ char plmn[6]; /* PLMN: MCC(3byte)+MNC(3byte). if the MNC is 2 digit, make it 6 digit by filling '#' in last blank.*/
gsm_net_act_e_type act;
} gsm_network_plmn_record_t;// GSM_NetPLMNRecord;
#define _vgsm_phone_h_
/*
- * I858 TAPI ºÎ°¡ ¼³¸í
+ * additional explanation of I858 TAPI
*
- * I858 TAPI API´Â I519/I819¿Í Å©°Ô ´Ù¸£Áö ¾Ê´Ù. ¶ÇÇÑ
- * 1. ÇÁ·ÎÁ§Æ®ÀÇ µ¿½Ã ÁøÇàÀ¸·Î ÀÎÇÑ ±¸ºÐ ÇÊ¿ä.
- * 2. GSM Only Mode¸¸¿¡¼¸¸ ÇÊ¿äÇÑ ³»¿ëµéÀ» À§ÇÑ ½Å±Ô ³»¿ë
- * À» À§Çؼ µð·ºÅ丮´Â ºÐ¸®ÇÏ¿´½¿.
+ * I858 TAPI API is not much different from I519/I819. Also
+ * Also we devide the directory for
+ * 1. separation for parallel project going
+ * 2. the only new feature of GSM Only Mode
*
- * - TAPI
- * Dialer, PhoneBookµîÀÇ phone client¿Í phone server¿ÍÀÇ µ¥ÀÌŸ ±³È¿¡
- * ÇÊ¿äÇÑ ÆÐŶÀÇ ±âº» ±¸Á¶´Â µ¿ÀÏÇÏ¸ç °¢°¢¿¡ ´ëÇÑ ³»¿ëÀº ¾Æ·¡ÀÇ ÁÖ¼®À»
- * Âü°í ¹Ù¶÷.
*
- * - TAPI packet ±âº» ±¸Á¶. TAPI packetÀÇ RX, TX´Â ¾Æ·¡¿Í °°ÀÌ µ¿ÀÏÇÑ ÇüÅÂ
+ * - the basic structure of TAPI packet. RX, TX is same as below.
* +--------+--------+-------------+---------------------------------------+
* |MAIN CMD|SUB CMD | Data Length | DATA |
* | 1byte | 1byte | 2bytes | Data Length's Byte(s) |
* +--------+--------+-------------+---------------------------------------+
*
- * Data Length´Â DATAÀÇ ±æÀ̸¸À» ÀǹÌÇÑ´Ù. Áï µ¥ÀÌŸ°¡ ¾ø´Â °æ¿ì¿¡´Â Length´Â
- * 0ÀÌ µÈ´Ù.
+ * Data Length is only for DATA, that is, the Length will be 0 when the DATA is null.
*
*/
--------------------------------------------------------------------------*/
/*
- * Length : Caller ID ±æÀÌ(VAR)
+ * Length : Caller ID length (VAR)
* Data :
* - Caller ID
*/
/*
* Length : VAR
* Data :
- * - GSM_MPTY_OPERATION : 1byte (mzgsmcall.h ÂüÁ¶)
+ * - GSM_MPTY_OPERATION : 1byte (see mzgsmcall.h)
* - GSM_MPTY_PARAM_ID : 1byte
* - parameter length : 1byte
* - param : VAR
#define GSM_CALL_LIST_CFRM 0x2B
/*
- * Length : Caller ID ±æÀÌ (VAR)
+ * Length : Caller ID length (VAR)
* Data :
* - Caller ID
*/
* - Call ID Length(1byte)
* - Call ID (VAR)
*
- * ÁÖÀÇ : CLIR_CAUSE´Â »èÁ¦
+ * CAUTION : CLIR_CAUSE is deleted.
*/
#define GSM_CALL_INCOMING_NOTI 0x21
* Data :
* - Call ID (1byte)
* - Forwared (1byte)
- * - Status (1byte) mzgsmcall.h ¿¡ ÀÖ´Â °ª°ú ¼³¸íÀ» ÂüÁ¶
- * ÁÖÀÇ : CAUSE, NUM_CALLS_IN_USE´Â »èÁ¦
+ * - Status (1byte) // see the value and comment on mzgsmcall.h
+ *
+ * CAUTION : CAUSE, NUM_CALLS_IN_USE are deleted
*/
#define GSM_CALL_STATUS_NOTI 0x22
/*
*
* - Call Count (1byte)
*
- * ÀÌÇÏ 5¹ÙÀÌÆ®´Â Call Count ¸¸Å ¹Ýº¹.
+ * the 5 byte below is repeated as Call Counts.
* - Call ID (1byte)
- * - GSM_Call_Dir (1byte) mzgsmcall.h ÂüÁ¶
- * - GSM_Call_Stat (1byte) mzgsmcall.h ÂüÁ¶
- * - GSM_Call_Mode (1byte) mzgsmcall.h ÂüÁ¶(Voice¸¸ Ãë±ÞÇÒ°Í)
+ * - GSM_Call_Dir (1byte) see mzgsmcall.h
+ * - GSM_Call_Stat (1byte) see mzgsmcall.h
+ * - GSM_Call_Mode (1byte) see mzgsmcall.h (only about Voice..)
* - MPTY (1byte) 0x01 mpty, 0x00 single
*/
#define GSM_CALL_LIST_RES 0x23
* (Call Count) + VAR(Call Count * 1)
* DATA :
* - result (1byte)
- * - GSM_MPTY_OPERATION (1byte) mzgsmcall.h ÂüÁ¶
- * - GSM_MPTY_PARAM_ID (1byte) mzgsmcall.h ÂüÁ¶
+ * - GSM_MPTY_OPERATION (1byte) see mzgsmcall.h
+ * - GSM_MPTY_PARAM_ID (1byte) see mzgsmcall.h
* - active call count (1byte)
* - active call list (VAR)
*/
/*
* Length : 1 + 1 + VAR(Network Name)
- * - State (1byte) mzgsmnet.h ¿¡ ÀÖ´Â °ª°ú ¼³¸íÀ» ÂüÁ¶
+ * - State (1byte) see mzgsmnet.h
* - Length (1byte) Network Name Length
* - Network Name (VAR)
*/
* - String VAR
*
*/
-// CAUTION : ÇâÈÄ ¹®ÀÚ¿ÀÌ ¾Æ´Ñ À妽º°ª¸¸ Àü´ÞµÇ´Â °ÍÀ¸·Î ¼öÁ¤
+// CAUTION : This will be fixed to send the only index, not string.
#define GSM_NETWORK_SMNT_NOTI 0x32
/*
GSM_SUPS : Sups Service TX function
--------------------------------------------------------------------------*/
/*
- * Length : MMI String ±æÀÌ(VAR)
+ * Length : MMI String length
* Data :
* - MMI String
*/
/*
* Length : 1(fac value) + 1(class)
* Data :
- * - fac value (1byte) mzgsmsups.h ÂüÁ¶
- * - class (1byte) mzgsmmisc.h ÂüÁ¶
+ * - fac value (1byte) see mzgsmsups.h
+ * - class (1byte) see mzgsmmisc.h
*/
#define GSM_SUPS_GET_FAC_LOCK_STATUS_REQ 0x42
/*
* Length : 1(fac value) + 1(class) + 1(mode) + 1(pw length) + VAR(passwd)
* Data :
- * - fac value (1byte) mzgsmsups.h ÂüÁ¶
- * - class (1byte) mzgsmmisc.h ÂüÁ¶
- * - mode (1byte) mzgsmsups.h ÂüÁ¶
+ * - fac value (1byte) see mzgsmsups.h
+ * - class (1byte) see mzgsmmisc.h
+ * - mode (1byte) see mzgsmsups.h
* - pw length (1byte)
* - passwd (pw length bytes)
*/
/*
* Length : 1(the reason)
* Data :
- * - GSM_CF_Reason (1byte) mzgsmsups.h ÂüÁ¶
+ * - GSM_CF_Reason (1byte) see mzgsmsups.h
*/
#define GSM_SUPS_GET_CCFC_REQ 0x44
/*
* Length : sizeof (struct GSM_CF_Data)
* Data :
- * - GSM_CF_Data (1byte) mzgsmsups.h ÂüÁ¶
+ * - GSM_CF_Data (1byte) see mzgsmsups.h
*/
#define GSM_SUPS_SET_CCFC_REQ 0x45
#define GSM_SUPS_AOC_SET_PPU_REQ 0x4D
/*
- * Length : USSD String ±æÀÌ(VAR)
+ * Length : USSD String length
* Data :
* - USSD String
*/
* Length : 1(status) + 1(fac value) + 1(class)
* Data :
* - status (1byte) 0x00 : not active, 0x01 : active
- * - fac value (1byte) mzgsmsups.h ÂüÁ¶
- * - class value (1byte) mzgsmsups.h ÂüÁ¶
+ * - fac value (1byte) see mzgsmsups.h
+ * - class value (1byte) see mzgsmsups.h
*/
#define GSM_SUPS_GET_FAC_LOCK_STATUS_RES 0x41
* Length : 1(fac value) + 1(class) + 1(mode)
* Data :
* - result (1byte)
- * - fac (1byte) mzgsmsups.h ÂüÁ¶
+ * - fac (1byte) see mzgsmsups.h
* - remain (1byte)
*/
#define GSM_SUPS_SET_FAC_LOCK_STATUS_RES 0x42
* Length : 1(status) + 1(class) + 1(number_length) + VAR(number) +
* 1(time)
* Data :
- * - GSM_CF_Status (1byte) mzgsmsups.h ÂüÁ¶
+ * - GSM_CF_Status (1byte) see mzgsmsups.h
* - GSM_ClassX (1byte)
* - length (1byte)
* - DN (VAR)
/*
* Length : 1(Activation Status) + 1(Network Provisioning Status)
* Data :
- * - CLIR_Activation_Status (1byte) mzgsmsups.h ÂüÁ¶
- * - CLIR_Provision_Status (1byte) mzgsmsups.h ÂüÁ¶
+ * - CLIR_Activation_Status (1byte) see mzgsmsups.h
+ * - CLIR_Provision_Status (1byte) see mzgsmsups.h
*/
#define GSM_SUPS_GET_CLIR_RES 0x44
/*
* Length : 4
* - CMD ID (2bytes) Debug command ID
- * - param1 (1byte) H/W ¼³Á¤À» À§ÇÑ parameter1
- * - param2 (1byte) H/W ¼³Á¤À» À§ÇÑ parameter2
+ * - param1 (1byte) parameter1 for H/W setting
+ * - param2 (1byte) parameter2 for H/W setting
*/
#define GSM_MISC_DEBUG_HW_REQ 0x62
/*
* Length : 1
- * - RAMDUMP Trace (1byte) RAMDUMP¸¦ acceptÇÒ°ÍÀÎÁöÀÇ ¿©ºÎ
+ * - RAMDUMP Trace (1byte) The flag of RAMDUMP acceptance.
*/
#define GSM_MISC_RAMDUMP_REQ 0x63
/*
* Length : 0
- * - IMEI Á¶È¸
+ * - request IMEI
*/
#define GSM_MISC_IMEI_REQ 0x64
/*
* Length : 0
- * - IMSI Á¶È¸
+ * - request IMSI
*/
#define GSM_MISC_IMSI_REQ 0x65
/*
* Length : 0
- * - Phone Version Á¶È¸
+ * - request the Phone Version
*/
#define GSM_MISC_VERSION_INFO_REQ 0x66
/*
* Length : 0
- * - SIMÀÇ »óÅÂ¿Í ¸Á»óŸ¦ Á¶È¸ÇÑ´Ù.
+ * - request SIM and network status.
*/
#define GSM_MISC_INTERNAL_MODE_REQ 0x67
/*
* Length : (1) + (2)
- * - Error type : (1byte) mzgsmerror.h ÂüÁ¶
- * - CME or CMS : (2bytes)CME ȤÀº CMS ¿¡·¯ÄÚµå
+ * - Error type : (1byte) see mzgsmerror.h
+ * - CME or CMS : (2bytes) error code for CME or CMS
*/
#define GSM_MISC_ERROR_RESPONSE 0x63
/*
* Length : 2bytes
* Data :
- * - Indicator (1byte) mzgsmmisc.h¿¡ ÀÖ´Â °ª°ú ¼³¸íÀ» ÂüÁ¶
+ * - Indicator (1byte) see mzgsmmisc.h
* - Value (1byte)
*/
#define GSM_DISPLAY_INDICATOR_NOTI 0x71
--------------------------------------------------------------------------*/
/*
* Length : 1
- * - State (1byte) mzgsmnet.h¿¡ ÀÖ´Â °ª°ú ¼³¸íÀ» ÂüÁ¶
- * GPRS state¿Í Network Registration state´Â À¯»çÇϹǷΠ°°ÀÌ »ç¿ëÇÑ´Ù.
+ * - State (1byte) see mzgsmnet.h
+ * GPRS state and Network Registration state are similar.
*/
#define GSM_DATA_GPRS_REG_NOTI 0xA1
/*
* Length : 1
- * dummy 1 byte (»ç¿ëÇÏÁö ¾ÊÀ½)
+ * dummy 1 byte (doesn't be used)
*/
#define GSM_DATA_CSD_CONNECT_NOTI 0xA4
#define GSM_DATA_GPRS_INIT_REQ 0xAF
/* --------------------------------------------------------------------------
- GSM_EXT : °øÁ¤ ¸ðµå
+ GSM_EXT : Gong Jung mode
--------------------------------------------------------------------------*/
/*
- * Length : IMEI ±æÀÌ (VAR)
+ * Length : IMEI length
* Data :
* - IMEI Value
*/
#define GSM_EXT_SET_IMEI_REQ 0xB1
/*
- * Length : BTMAC ±æÀÌ (VAR)
+ * Length : BTMAC length
* Data :
* - BTMAC Value
*/
--------------------------------------------------------------------------*/
/*
- * Length : HDLC ±æÀÌ
+ * Length : HDLC length
* Data : HDLC
* - Caller ID
*/
g_ATpHead = g_ATpTail = NULL;
}
-/* ++ 2008-09-29.
- ++ Name : PushHDLCMultiFrameInfo
- ++ Args : HDLCFrame_t const* pframe
- ++ Multi frame ÀÏ ¶§, ID¸¦ check ÇÏ´Â ºÎºÐÀÌ ¾ø´Ù.
- ++ ID ºñ±³Çؼ ÀÌ°ÍÀÌ single messageÀÎÁö multiple messageÀÎÁö ÆÇ´ÜÇÏ´Â ºÎºÐÀÌ ÇÊ¿äÇÏ´Ù.
-*/
void ATPushHDLCMultiFrameInfo(HDLCFrame_t const* pframe)
{
TRACE(MSGL_VGSM_INFO, "\n");
/*
-¿©·¯°³ÀÇ entry¸¦ get ÇÏ°Ô´Â ¾ÈÇÏ°í ÇϳªÀÇ entry¸¸ get ÇÏ°Ô.. Áö±Ý ÇöÀç ¸ðµ© Äڵ尡 ±×·¡¼..
-Phonebookµµ 2G feature ·Î ±¸Çö.. Áö±Ý ÇöÀç ¸ðµ© Äڵ尡 ±×·¡¼..
+The only one entry could get on one time, in these times vmodem code,
+so Phonebook is implemented to 2G feature.
*/
int at_rx_sim_pb_access(char* atmsg)
{
log_msg(MSGL_VGSM_INFO,"vgsm_ss_sqlite_init: sqlite3_exec: %s\n",mesg);
sqlite3_free(mesg);
}
- //goto Done; //Á¸Àç ÇÑ´Ù¸é, ±× ÀÌÈÄ tableÀº ¸ø¸¸µç´Ù. ÀÌ ºÎºÐ »èÁ¦°ËÅä.
+ //goto Done; // if it exist, next tables could be generated. so comment out.
}
// create the call barring table
return (call_barring_entry_t *)&g_cb_entry;
}
-//class¿Í type°ªÀº ´Ù½Ã ¸®ÅÏÇØÁÙ ÇÊ¿ä°¡ ¾ø´Ù. -> status¸¸ ¾Ë·ÁÁÖ¸é µÊ
+//We don't have to return class and type again. notify 'status' only.
call_barring_entry_t g_cb_entry_tmp;
status = SS_MODE_DEACT;
}
}
- // À̺κРȮÀÎÇÏÀÚ. db¿¡ ¾ø´Â°ÍÀ» µ¥ÀÌŸ¸¦ ¾î\89F°Ô ÁÙÁö »ý°¢....
entry = &g_cb_entry_tmp ;
memset(entry, 0, sizeof(call_barring_entry_t));
}
log_msg(MSGL_VGSM_INFO,"entry is not found !!! \n");
- // À̺κРȮÀÎÇÏÀÚ. db¿¡ ¾ø´Â°ÍÀ» µ¥ÀÌŸ¸¦ ¾î\89F°Ô ÁÙÁö »ý°¢....
//entry = (call_forwarding_entry_t *)malloc(sizeof(call_forwarding_entry_t));
entry = &g_cf_entry_tmp;
#endif
/* ---------------------------------------------------------------------------
- PPP Gateway : Dial up NetworkingÀ» À§ÇÑ ppp gateway¿ÍÀÇ Åë½ÅÀ» À§ÇÔ
+ PPP Gateway : comunicate with ppp gateway for Dial up Networking
---------------------------------------------------------------------------*/
typedef struct
{
} PPP_GATEWAY;
/* ---------------------------------------------------------------------------
- dpram : dpram handle GSM InitConnection¿¡¼ »ý¼ºµÈ fd¸¦ ±×´ë·Î »ç¿ë
+ dpram : use the 'fd' which is generate by dpram handle GSM InitConnection
---------------------------------------------------------------------------*/
typedef struct
{
} DPRAM;
/* ---------------------------------------------------------------------------
- dpram event : ppp, SIM cover»óŵîÀÇ phone event¸¦ Àü´ÞÇÏ´Â fd
+ dpram event : 'fd' for phone event like ppp, SIM cover.
---------------------------------------------------------------------------*/
typedef struct
{
} DPRAM_EVENT;
/* ---------------------------------------------------------------------------
- dpram error : phone binary critical message ó¸®
+ dpram error : for the phone binary critical message
---------------------------------------------------------------------------*/
typedef struct
{
} DPRAM_ERROR;
/* ---------------------------------------------------------------------------
- socket server : client ¿¬°áÀ» À§ÇÑ socket server
- ´ëºÎºÐÀÇ ÄÚµå´Â TClientInfoÀÇ CallBack¿¡ µé¾îÀÖ´Ù.
+ socket server : socket server for client connecting
+ almost codes are in CallBack of TClientInfo.
---------------------------------------------------------------------------*/
typedef struct
{
int GSMDataRequest;
} PhoneServerData;
/* ---------------------------------------------------------------------------
- main ±¸Á¶Ã¼
+ main structure
---------------------------------------------------------------------------*/
typedef struct {
void (*SetInternalState) (PhoneServer * ps, LXT_PHONE_STATE state);
*********************************************************************/
/* ------------------------------------------------------------------------
- ¶óÀ̺귯¸®ÀÇ ±¸Á¶¸¦ ÀÌÇØÇϴµ¥ °¡Àå Áß¿äÇÑ Çì´õÆÄÀÏ.
- ±¸Á¶Ã¼ _GSM_StateMachineÀÇ ÀνºÅϽº Çϳª·Î ¿òÁ÷ÀÌ´Â ÇüÅÂÀÓ
- µû¶ó¼ ÀÌ ±¸Á¶Ã¼ÀÇ ¸â¹öµéÀ» °ËÅäÇϸé ÀüüÀûÀÎ ±¸Á¶¸¦ ÆľÇÇÒ¼ö ÀÖ½¿.
+ This is the most important header file for understanding the library architecture.
+ This goes like an instance of the structure, _GSM_StateMachine.
+ So, you can figure out the whole architecture by analyzing this structure members.
- È帧Àº ¾Æ·¡¿Í °°´Ù.
+ The flow is as below.
+----------------------------------------------------------------+
| Phone Layer (AT command generate) | (AT command reply) |
+----------------------------------------------------------------+
/* --------------------------------------------------------------------------
Device layer
- dpram read, write, settingÀÇ functionÀ» Æ÷ÇÔ
- device fd°°Àº µ¥ÀÌŸ°¡ ÀÖ½¿. Ưº°È÷ ½Å°æ¾µ ºÎºÐÀº ¾ø½¿.
+ include the dpram read, write, setting functions
+ nothing special.
--------------------------------------------------------------------------*/
/**
- * ÄÚµå ³»¿ëÀº I519/I819ÀÇ Äڵ带 ±×´ë·Î »ç¿ëÇÏ¿´À¸¸ç ÇüÅ´ ¶óÀ̺귯¸®
- * ÀÇ ±¸Á¶¿¡ ¸Â°Ô function pointer·Î ¼±¾ðÇÏ¿´´Ù.
+ * I used the I519/I819 original codes as it is,
+ * Àand this is defined as function pointer.
*/
typedef struct {
GSM_Error (*OpenDevice) (GSM_StateMachine *s);
#define GSM_MAX_NUMBER_LENGTH 50
/*
* Phone Data :
- * PhoneServer¿¡¼ ÂüÁ¶ÇØ¾ß ÇÒ ¸ðµç µ¥ÀÌŸ¸¦ ¿©±â¿¡ ¸ð¾ÆµÎ¸é µÈ´Ù.
+ * gather all datas in here that the PhoneServer would refer to.
*
- * ¾Æ·¡ÀÇ ±¸Á¶Ã¼ ¸â¹ö¿¡ Æ÷ÇÔµÈ º¯¼ö´Â Àü¿ª º¯¼ö »ç¿ëÇϵíÀÌ »ç¿ëÇÏ´Â °ÍÀÌ
- * ¸ñÀûÀÌ´Ù. I519/I819¿¡¼ PhoneServer°¡ °¡Áö°í ÀÖ´ø µ¥ÀÌŸ¸¦ ¾Æ·¡ÀÇ ±¸Á¶Ã¼¿¡
- * ¸ô¾Æ¼ »ç¿ëÇÏ¸é ¿ëÀÌÇÏ´Ù.
+ * These structure members are used as global variables.
*/
typedef struct {
double VerNum;
// phone function
/*
-// »ç¿ëÀÚ ¿¹¾à ¿µ¿ª
+// user reserved area
typedef struct {
GSM_Error (*SetIncomingCall) (GSM_StateMachine *s, bool enable);
} GSM_AT_Functions_User;
-// °¡Àå »óÀ§ÀÇ ±¸Á¶Ã¼
+// The hightest structure
struct _GSM_StateMachine {
bool opened; //
- int ReplyNum; // AT command¸¦ È£ÃâÇÒ¶§ÀÇ È½¼ö. Åë»ó 1ȸÀÌ´Ù. »èÁ¦ °ËÅä
+ int ReplyNum; // The count of calling the AT command. normally this is 1.
GSM_Device Device;
GSM_Phone Phone;
};
// error = SSFunc->SetSSNotification(&GlobalS, true, true);
// error = CallFunc->SetCallExtendedFormat(&GlobalS, false);
// /*
-// * ¾Æ·¡ÀÇ Ãʱ⠸í·É¾î´Â ÀÌ¹Ì Phone power on½Ã¿¡ ¹Ý¿µÀÌ µÇ¾î ÀÖÀ¸¹Ç·Î
-// * »ý·«ÇÑ´Ù.
// error = SendInitCommand();
// if (error != ERR_NONE)
// return error;
if( rc != 4 )
TRACE(MSGL_VGSM_ERR, "server_send_to_client1 : write error : rc = %d\n", rc);
- // FIXME : Broken PIPE ¿À·ù ¼öÁ¤ÇÒ°Í.
+ // FIXME : Broken PIPE error
if (datasize > 0)
{
rc = WriteBytes(handle, packet->data, datasize);
server->inet_fd = -1;
server->current_ci = NULL;
- // Ŭ¶óÀ̾ðÆ® Á¢¼ÓÀüÀÇ ¸Þ¼¼Áö¸¦ ´ã¾ÆµÎ±â À§ÇØ ÇÊ¿äÇÔ.
+ // This is needed for save the message which arrive before the client connecting.
for (ii = 0; ii < MAX_MISSED_MESSAGE; ii ++)
{
server->mmsg.mmsg_info[ii].klass = LXT_ID_CLIENT_RESERVED;
return 1;
}
-int server_rx_call_release_exec(void) // ÀÌ°ÍÀº all call releae ÀÎ °æ¿ìÀÌ´Ù. Çϳª release ´Â SS MANAGE CALL msg·Î ¼ö½ÅµÈ´Ù.
+int server_rx_call_release_exec(void) // for all call release case. one call release would be received by SS MANAGE CALL msg.
{
int call_gen_resp_err;
p[19] = server_sec_get_sec_status();
- //ÇØ´ç lock_type ÀÇ remain count ¸¦ °¨¼Ò½ÃÅ´.
+ // decrease the remain count of relevant lock_type
server_sec_status_mgr(lock_type);
p[20] = server_sec_get_remain_cnt(p[19]);
password[length_p] = '\0';
}
- // ¿Ö ÇÊ¿ä?? -> óÀ½ ºÎÆÃÇÒ ½ÃÁ¡¿¡¼ current_status°ªÀ» ±âÁØÀ¸·Î pda·Î pin_status_noti¸¦ º¸³»¹Ç·Î
- // pda¿¡¼ set pin status¸¦ º¸³¾ ½ÃÁ¡Àº Ç×»ó current status¿¡ ÇØ´çÇÏ´Â °ªÀ» º¸³½´Ù.
+ // On first booting period, this sends the pin_status_noti(this is based on current_status) to pda.
current_status = server_sec_get_sec2_status();
/* PIN check enable case from here */
if(entry)
free(entry);
- //eventinjector¿¡°Ô data send -> ui update
+ // send data to eventinjector -> ui update
call_forwarding_entry_t * resp_entry = get_call_forwarding_entry();
//for debug
VGSM_DEBUG("CallBarring Passwd changed\n");
FuncServer->Cast(&GlobalPS, LXT_ID_CLIENT_EVENT_INJECTOR, &packet);
- /* EI¿¡¼´Â ÀÌ·¯ÇÑ event¸¦ ¼ö½ÅÇϸé,
+ /* EI receives this event then,
* popup(callbarring password changed!!) --> callbarring password : new_passwd
*/
}
-int server_tx_call_incoming_noti( LXT_MESSAGE * packet ) //¸ÁÀÔÀå¿¡¼± outgoing call.
+int server_tx_call_incoming_noti( LXT_MESSAGE * packet ) // on network side, this is outgoing call.
{
int num_len = 0, ret = 0, tmp = 0;
char number[MAX_GSM_DIALED_DIGITS_NUMBER];
gsm_call_list_t list;
gsm_call_status_e_type call_status = GSM_CALL_STATUS_INCOMING;
char clir = GSM_CALL_CLIR_STATUS_NOT_CHANGED; //gsm_clir_status_e_type
- int call_exist = 0; // ÇöÀç call list¿¡, callÀÌ ¾ø´Ù¸é incoming noti Àü¼ÛÇÑ´Ù.
+ int call_exist = 0; // If there is no call in call list then send the incoming noti.
unsigned short call_type;
int i;
call_status = GSM_CALL_STATUS_WAITING;
// sub_cmd = GSM_CALL_WAITING;
- call_exist = 1; // call list¿¡ call ÀÌ Á¸ÀçÇϸé, incoming noti ´ë½Å¿¡ waiting noti¸¦ Àü¼ÛÇÑ´Ù.
+ call_exist = 1; // If there are any call in call list, then send the waiting noti instead the incoming noti.
}
assert(packet->length >= 8);
if(clir == GSM_CALL_CLIR_STATUS_INVOCATION)
{
log_msg(MSGL_VGSM_INFO," GSM_CALL_CLIR_STATUS_INVOCATION -> no num \n");
- num_len = 0; // È®ÀÎÇÏÀÚ. num_len °¡ MAX_GSM_DIALED_DIGITS_NUMBER µÇ¾î¾ßÇÏ´ÂÁö check...
+ num_len = 0; // check that 'num_len' should be MAX_GSM_DIALED_DIGITS_NUMBER or not.
memset(number, 0, MAX_GSM_DIALED_DIGITS_NUMBER);
ss_present_indi = p[5];
ss_no_cli_cause = p[6];
TRACE(MSGL_VGSM_INFO, "\n");
- set_call_id( call_id ); // ³ªÁß¿¡ server_tx_call_status() º¸³»´Â °æ¿ì¿¡, g_call_id¸¦ °¡Á®¿À¹Ç·Î ¿©±â¼ set ÇؾßÇÑ´Ù.
+ set_call_id( call_id ); // We should set here because the server_tx_call_status() may need the g_call_id.
TAPIMessageInit(&packet);
#include "phoneserver.h"
/*
-* phonebook access¿¡ ´ëÇÑ °á°ú¸¦ EI¿Í simulator ¾ç¹æÇâÀ¸·Î º¸³½´Ù. => EI·Î¸¸ º¸³½!!!!
-* flag : 0 -> EI UI + simulator
+* flag : 0 -> EI UI + emulator
* 1,2 -> EI UI
*/
{
case STATE_SIM_READY :
{
- /* lock disableÀÏ °æ¿ì modem(vgsm)ÀÌ simulator·Î º¸³»Áà¾ß ÇÒ NOTI
+ /* The noti that modem(vgsm) should send to emulator when the lock disabled.
1) GSM_SEC_LOCK_TYPE_READY
2) GSM_SEC_SIM_INIT_COMPLETED
- 3) GSM_SEC_PB_INIT_COMPLETED - ÇöÀç phonebookÀÌ ¹Ì±¸Çö »óÅÂ¶ó º¸³»Áö ¾ÊÀ½.
+ 3) GSM_SEC_PB_INIT_COMPLETED - doesn't send this because the phonebook isn't implemented.
*/
pdata[0] = GSM_SEC_LOCK_TYPE_READY;
pdata[1] = GSM_SEC_LOCK_KEY_UNLOCKED;