📄 filedef.h
字号:
#define BUSPHONE 0
#define PUBPHONE 1
#define PHONETYPE BUSPHONE
#if PHONETYPE == BUSPHONE
#define FEETBLLEN 1
#define RATETBLLEN 1
#define PHONEBOOKLEN 100
#define SMTBLLEN 20
#define CALLRECORD 10
#elif PHONETYPE == PUBPHONE
#define FEETBLLEN 100
#define RATETBLLEN 150
#define SMTBLLEN 1
#define PHONEBOOKLEN 1
#define CALLRECORD 1
#endif
#define SM_RX 0
#define SM_TX 1
/*******************************************************************************************************/
/* Basic structures definations */
/*******************************************************************************************************/
typedef struct PDU_Head_Struct{
unsigned char PDUHeadLen; //PDU head length
unsigned char PDUHead[32]; //PDU head content
}PDU_HEAD;
//defination of wireless module General Control Block (former GSM Control Block)
typedef rom struct GCB_Struct
{
unsigned char chrNCCModemNum[12]; //NMC Modem number
unsigned char chrPINCode[6]; //PIN code
unsigned char ForbidVoiceCallIn; //voice call in enable
unsigned char ForbidDataCallIn; //data call in enable
PDU_HEAD PDU_Head;
}WIC_GCB;
/*******************************************************************************************************/
//Time structure in NM structures
typedef rom struct Time_Struct{ /*All the domains are compressed BCD code */
unsigned char chrYear;
unsigned char chrMonth;
unsigned char chrDate;
unsigned char chrHour;
unsigned char chrMinute;
unsigned char chrSecond;
}NM_TIME;
/*******************************************************************************************************/
//domain 1,2,3,4
typedef rom struct _IP{
unsigned char chrNum[6];
}IP_NUM;
/*******************************************************************************************************/
// H-code table structure
typedef rom struct HCode_Struct{
unsigned char chrNet; /*0~9, the network number, for example, "09" means "139" */
unsigned char chrLen; /*Number of the items in this network*/
unsigned int intItem[40];
}HCODE_TABLE;
/*******************************************************************************************************/
typedef rom struct RateTableItem_Struct{
unsigned char chrNum[9];
unsigned int intRate1;
unsigned int chrChgTimUnit1;
unsigned int intDuration1;
unsigned int intRate2;
unsigned int chrChgTimUnit2;
unsigned int intDuration2;
}RATE_TABLE_ITEM;
typedef rom struct RateTable_Struct{
NM_TIME StartTime; //What time shall this rate come into power, 0 means never
RATE_TABLE_ITEM RoamingRate;
RATE_TABLE_ITEM CallInRate;
unsigned int intLen;
RATE_TABLE_ITEM Item[RATETBLLEN];
}RATE_TABLE;
/*******************************************************************************************************/
typedef rom struct FeeTableItem_Struct{
unsigned char chrOtherSideNum[12]; /*The number of the other side in this session*/
unsigned char chrLocalNum[6]; /*The number of the local phone(BCD code)*/
unsigned char chrMethod; /*Feature of the call*/
NM_TIME StartTime; /*The start time of the call*/
unsigned int Duration; /*The duration of the call(Binary,second as unit)*/
unsigned int Fee; /*The fee of the call(Binary,fen as unit)*/
}FEE_TABLE_ITEM;
/*******************************************************************************************************/
typedef rom struct SMTableItem_Struct{
unsigned char chrOtherSideNum[8]; //The number of the other side in this session, if first byte ==
// 0xff, the item is empty
unsigned char chrProperty; //2-ASCII 4-Unicode
NM_TIME Time; /*The time SM received */
unsigned char SMLength; /*The length of SM in bytes*/
unsigned char SMContent[140]; /*The content of the SM*/
unsigned char Front;
unsigned char Next;
}SM_TABLE_ITEM;
// the last received or write SM may be saved in any empty position
/*******************************************************************************************************/
typedef rom struct PhoneBookItem_Struct{
unsigned int Name[10]; //unicode
unsigned char Group;
unsigned char Number[12]; //compressed BCD code
unsigned char Front;
unsigned char Next;
}PHONE_BOOK_ITEM;
//The phone is stored in a chain-table-like structure. The indexes form a chain table Chain[] and Root point
//to the first item in Chain[].
typedef rom struct PhoneBook_Struct{
unsigned char Root;
PHONE_BOOK_ITEM Item[PHONEBOOKLEN];
}PHONE_BOOK;
typedef rom struct CallRecord_Struct{
unsigned char Head;
unsigned char Len;
unsigned char Number[CALLRECORD][12]; //10 numbers which haven't been accepted
NM_TIME Time[CALLRECORD];
}CALL_RECORD;
/*******************************************************************************************************/
/* Final structures definations */
/*******************************************************************************************************/
#define DOMAIN0 unsigned int intCtlWord //Control words
#define sizeof_DOMAIN0 sizeof(int)
#define DOMAIN1 unsigned char chrIP1Num[6] //IP1 number
#define sizeof_DOMAIN1 sizeof(char)*6
#define DOMAIN2 unsigned char chrIP2Num[6] //IP2 number
#define sizeof_DOMAIN2 sizeof(char)*6
#define DOMAIN3 unsigned char chrDefaultIP[6] //Default IP number
#define sizeof_DOMAIN3 sizeof(char)*6
#define DOMAIN4 unsigned char chrReserveIP[6] //Reserved IP number
#define sizeof_DOMAIN4 sizeof(char)*6
#define DOMAIN5 unsigned char chrPINCode[3] //PIN code
#define sizeof_DOMAIN5 sizeof(char)*3
#define DOMAIN6 unsigned char chrLimitSP //Limited service provider
#define sizeof_DOMAIN6 sizeof(char)
#define DOMAIN7 unsigned char LimitTbl[5][6] //Limited dial number
#define sizeof_DOMAIN7 sizeof(char)*6*5
//DOMAIN8~9 are not applied
#define sizeof_DOMAIN8 0
#define sizeof_DOMAIN9 0
#define DOMAIN10 unsigned int intLACCode1[43] //LAC code table 1
#define sizeof_DOMAIN10 sizeof(int)*43
#define DOMAIN11 unsigned int intLACCode2[43] //LAC code table 2
#define sizeof_DOMAIN11 sizeof(int)*43
#define DOMAIN12 unsigned int intLACCode3[43] //LAC code table 3
#define sizeof_DOMAIN12 sizeof(int)*43
#define DOMAIN13 unsigned int intLACCode4[43] //LAC code table 4
#define sizeof_DOMAIN13 sizeof(int)*43
#define DOMAIN14 unsigned int intLACCode5[43] //LAC code table 5
#define sizeof_DOMAIN14 sizeof(int)*43
#define DOMAIN15 unsigned int intLACCode6[41] //LAC code table 6
#define sizeof_DOMAIN15 sizeof(int)*41
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -