⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filedefb.h

📁 本人编写的无线电话程序,给予PIC18C801设计,包括了uCOS的移植以及菜单,自己设计的拼音注入法,完整地一级汉字库,希望对大家有所帮助
💻 H
字号:
/*******************************************************************************************************/
/*                                   Basic structures definations                                      */
/*******************************************************************************************************/
//defination of wireless module General Control Block (former GSM Control Block)
/*struct PDU_Struct{
	unsigned char PDUHeadLen;			//PDU head length
	unsigned char PDUHead[32];			//PDU head content
};
struct Universal_Struct{
	unsigned char US[33];
};
union Union_0{
	struct PDU_Struct 		PDUForm;
	struct Universal_Struct UniForm;
};*/

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
	union 			Union_0;
	unsigned char PDUHeadLen;			//PDU head length
	unsigned char PDUHead[32];			//PDU head content
}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
	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*/
}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
}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;
	unsigned char		Chain[PHONEBOOKLEN];
	PHONE_BOOK_ITEM	  	Item[PHONEBOOKLEN];
}PHONE_BOOK;
/*******************************************************************************************************/
/*                                   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
#define DOMAIN16	    unsigned int  intLimitLAC1                                  //Location limitation
#define sizeof_DOMAIN16	sizeof(int)
#define DOMAIN17		unsigned int  intLimitLAC2                                  //Location limitation
#define sizeof_DOMAIN17	sizeof(int)
#define DOMAIN18		unsigned int  intLimitLAC3                            		//Location limitation
#define sizeof_DOMAIN18	sizeof(int)
#define DOMAIN19		unsigned int  intLimitLAC4		                            //Location limitation
#define sizeof_DOMAIN19	sizeof(int)
#define DOMAIN20		unsigned int  intLimitLAC5		                            //Location limitation
#define sizeof_DOMAIN20	sizeof(int)
#define DOMAIN21		unsigned int  intLimitLAC6		                            //Location limitation
#define sizeof_DOMAIN21	sizeof(int)
#define DOMAIN22		HCODE_TABLE   HCodeTbl1                                 	     //H code table 1
#define sizeof_DOMAIN22	sizeof(HCODE_TABLE)
#define DOMAIN23		HCODE_TABLE   HCodeTbl2		                                 	 //H code table 2
#define sizeof_DOMAIN23	sizeof(HCODE_TABLE)
#define DOMAIN24		HCODE_TABLE   HCodeTbl3                                 		 //H code table 3
#define sizeof_DOMAIN24	sizeof(HCODE_TABLE)
#define DOMAIN25		HCODE_TABLE   HCodeTbl4                                 		 //H code table 4
#define sizeof_DOMAIN25	sizeof(HCODE_TABLE)
#define DOMAIN26		HCODE_TABLE   HCodeTbl5                                 		 //H code table 5
#define sizeof_DOMAIN26	sizeof(HCODE_TABLE)
#define DOMAIN27		HCODE_TABLE   HCodeTbl6                                 		 //H code table 6
#define sizeof_DOMAIN27	sizeof(HCODE_TABLE)
#define DOMAIN28		HCODE_TABLE   HCodeTbl7			                                 //H code table 7
#define sizeof_DOMAIN28	sizeof(HCODE_TABLE)
#define DOMAIN29		HCODE_TABLE   HCodeTbl8                                          //H code table 8
#define sizeof_DOMAIN29	sizeof(HCODE_TABLE)
#define DOMAIN30		HCODE_TABLE   HCodeTbl9                                          //H code table 9
#define sizeof_DOMAIN30	sizeof(HCODE_TABLE)
#define DOMAIN31		HCODE_TABLE   HCodeTbl10                                        //H code table 10
#define sizeof_DOMAIN31	sizeof(HCODE_TABLE)
#define DOMAIN32		unsigned char chrLocSecNum[3]                      	  //Local section area number
#define sizeof_DOMAIN32	sizeof(char)*3
#define DOMAIN33		unsigned char chrIPAreNum1[10][3]             //Special IP section number table 1
#define sizeof_DOMAIN33	sizeof(char)*3*10
#define DOMAIN34		unsigned char chrIPAreNum2[10][3]			  //Special IP section number table 2
#define sizeof_DOMAIN34	sizeof(char)*3*10
#define DOMAIN35		RATE_TABLE    RateTbl0                                              //Rate table0                
#define sizeof_DOMAIN35	sizeof(RATE_TABLE)
#define DOMAIN36		RATE_TABLE    RateTbl1                             		            //Rate table1
#define sizeof_DOMAIN36	sizeof(RATE_TABLE)
#define DOMAIN37		unsigned char chrAlarmInfo                                     //Alarm infomation
#define sizeof_DOMAIN37	sizeof(char)
#define DOMAIN38		unsigned int  intCurLAC                                      //Current cell's LAC
#define sizeof_DOMAIN38	sizeof(int)
#define DOMAIN39	 	FEE_TABLE_ITEM FeeTblItem[FEETBLLEN]                          //Current Fee table
#define sizeof_DOMAIN39	sizeof(FEE_TABLE_ITEM)*FEETBLLEN
#define DOMAIN40		unsigned char chrDeviceNum[9]                    //The device number of the phone
#define sizeof_DOMAIN40	sizeof(char)*9
#define DOMAIN41		unsigned char chrFeeUpLoadTime[2]           //Time quantum of Fee table uploading
#define sizeof_DOMAIN41	sizeof(char)*2
#define DOMAIN42		unsigned char chrNCCModemNum[6]                       //The number of NCC's MODEM
#define sizeof_DOMAIN42	sizeof(char)*6
#define DOMAIN43		unsigned char chrNCCID[6]                  //The ID of the network control center
#define sizeof_DOMAIN43	sizeof(char)*6
#define DOMAIN44		unsigned int  intLimitLAC[14]				      //The extra location limitation
#define sizeof_DOMAIN44	sizeof(char)*14
//DOMAIN45~61 are not applied
#define sizeof_DOMAIN45	0
#define sizeof_DOMAIN46	0
#define sizeof_DOMAIN47	0
#define sizeof_DOMAIN48	0
#define sizeof_DOMAIN49	0
#define sizeof_DOMAIN50	0
#define sizeof_DOMAIN51	0
#define sizeof_DOMAIN52	0
#define sizeof_DOMAIN53	0
#define sizeof_DOMAIN54	0
#define sizeof_DOMAIN55	0
#define sizeof_DOMAIN56	0
#define sizeof_DOMAIN57 0
#define sizeof_DOMAIN58	0
#define sizeof_DOMAIN59	0
#define sizeof_DOMAIN60	0
#define sizeof_DOMAIN61	0
#define DOMAIN62		unsigned char chrTC[6] 					   				//The time adjusted value
#define sizeof_DOMAIN62	sizeof(char)*6
#define DOMAIN63		unsigned char chrQueryDomain		 	 //The number of the domain which queried
#define sizeof_DOMAIN63	sizeof(char)

/*******************************************************************************************************/
//File structure defination of MCNM file
typedef rom struct MCNMFile_Struct{
    DOMAIN0;    DOMAIN1;    DOMAIN2;    DOMAIN3;    DOMAIN4;    DOMAIN5;    DOMAIN6;    DOMAIN7;
    						DOMAIN10;   DOMAIN11;   DOMAIN12;   DOMAIN13;   DOMAIN14;   DOMAIN15;
	DOMAIN16;	DOMAIN17;	DOMAIN18;	DOMAIN19;	DOMAIN20;	DOMAIN21;	DOMAIN22;	DOMAIN23;
	DOMAIN24;	DOMAIN25;	DOMAIN26;   DOMAIN27;	DOMAIN28;	DOMAIN29;	DOMAIN30;	DOMAIN31;
	DOMAIN32;	DOMAIN33;	DOMAIN34;	DOMAIN35;	DOMAIN36;	DOMAIN37;	DOMAIN38;
	DOMAIN40;	DOMAIN41;	DOMAIN42;	DOMAIN43;	DOMAIN44;
									//.....
																			DOMAIN62;	DOMAIN63;
	unsigned char chrCurRateTbl;
	WIC_GCB		  WIC_Gcb;
	unsigned char chrSelfNumber;	       //Number of the phone itself, compressed BCD, 0xff as terminal
	//Some statistical information
	unsigned short SMErrCount;											  /*GSM module SM error counter*/
	unsigned short DataDialErrCount;							/*GSM module data dialing error counter*/
	unsigned short VoiceDialErrCount;						   /*GSM module voice dialing error counter*/
}MCNM_FILE;
/*******************************************************************************************************/
//File structure defination of DVS file
typedef rom struct DVSFile_Struct{
	DOMAIN39;
	unsigned int Head;
	unsigned int Tail;
	unsigned char UACHead;
	unsigned char UACTail;
	unsigned char UnacceptCall[12][10];				             //10 numbers which haven't been accepted
	unsigned char RRCHead;
	unsigned char RRCTail;
	unsigned char RecentReceivedCall[12][10];                            //10 number of recently received
	unsigned char RDOHead;
	unsigned char RDOTail;
	unsigned char RecentDialOut[12][10];                                //10 numbers of recently dial out
}DVS_FILE;
/*******************************************************************************************************/
typedef rom struct MenuFile_Struct{
	SM_TABLE_ITEM 		SMTbl[SMTBLLEN];                                               		 /*SM table*/
	PHONE_BOOK			PhoneBook;
	unsigned char 		RingType;	                                             //the type of ring sound
	unsigned char		PhoneLockPassWord[4];   //the pass word to unlock the phone, if the first byte is
	                                            //0xff, the phone lock function is not open
	unsigned char 		BackGroundLED;		   //the property of background led. it may be never light or
	                                            //light only when press key or call
}MENU_FILE;



/*******************************************************************************************************/
typedef rom struct PromData_Struct{
	SYS_FILE	SysFile;
	MCNM_FILE	MCNMFile;
	DVS_FILE	DVSFile;
	MENU_FILE	MenuFile;
};
/*******************************************************************************************************/
//The length of this part is permanent and shall be load to terminal to determine the basic fonction of it
typedef rom struct SysFile_Struct{
	INT16U		VER;
	INT16U		DomainLen[64];	//The length of each domain
	INT8U		DomainAuth[64];	//The access level of each domain
	INT8U		CheckSum1;
	INT8U		CheckSum2;
}SYS_FILE;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -