📄 bs_common.h
字号:
/******************************************************************************\
Copyright (c) 2007, UTStarcom,Inc. (ShenZhen R&D Center)
All Rights Reserved.
Subsystem : WIMAX
Group : GW/AnchorDP/...
File : bs_common.h
Version :
Build :
Author : RCT
Maintained by : RCT
Create Date : 2007-01-22
Last Modify :
Description : BS SIM Common
\******************************************************************************/
/*
-----------------------------------------------------------
Software Develop CodeName :
Module Reference :
-----------------------------------------------------------
Change History:
07-01.22 RCT create file.
*/
#ifndef _BS_COMM_H_
#define _BS_COMM_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <vxWorks.h>
#include "R64_message.h"
#include "R64_message_ie.h"
#include "global.h"
#include "xTimer.h"
//#define BSSIM_BINDED_2_GW
#define BS_MAX_MS_NUM 1024
/* Max message len and max message num definition for message queue */
#define BS_CP_MAX_MSG_LEN 8000
#define BS_CP_MAX_MSG_NUM 1000
/* SAP definition */
#define GW_UDP_SAP 0x10
#define BS_UDP_SAP 0x20
#define BS_TIMER_SAP 0x21
#define BS_ACTION_SAP 0x22
#define BS_UDP_DHCP_SAP 0x40
#define _BS_DEBUG_
#define _BS_USING_PRIV_DEBUG_
#define BS_SYS_CUR_TICKING ((unsigned int)tickGet())
#ifdef _BS_DEBUG_
#define BS_TRACE_ALL 3
#define BS_TRACE_DETAIL 4
#define BS_TRACE_NORMAL 5
#define BS_TRACE_WARNING 6
#define BS_TRACE_ERROR 7
#define BS_TRACE_FATAL 10
#define BS_TRACE_ALARM 20
#define BS_TRACE_INFO 30
#define BS_DUMP_ALL 3
#define BS_DUMP_DETAIL 4
#define BS_DUMP_NORMAL 5
#define BS_DUMP_WARNING 6
#define BS_DUMP_ERROR 7
#define BS_DUMP_FATAL 10
#define BS_DUMP_ALARM 20
#define BS_DUMP_INFO 30
#ifdef _BS_USING_PRIV_DEBUG_
extern unsigned int gBsTraceLevel;
extern unsigned int gBsDumpLevel;
#define BS_TRACE(level,args...) do { \
if(level >= gBsTraceLevel) { \
printf("[T:%u][%8s][%10s:%4u][BS]",BS_SYS_CUR_TICKING,__FILE__,__FUNCTION__, __LINE__); \
printf(##args); \
} \
}while (0)
#define BS_DUMP(level,buffer,length) do { \
unsigned int i; \
unsigned char temp[3]; \
unsigned char display[256]; \
unsigned char *pBuffer = (unsigned char *)buffer; \
if(level>= gBsDumpLevel){ \
display[0] = 0; \
for(i=0; i < length; i++) { \
sprintf(temp, (i%8 == 7 && i != length-1 && i%16 != 15) ? "%02x-" : "%02x ", *pBuffer++);\
strcat(display, temp); \
if(i%16 == 15) { \
printf("%s\n", display); \
display[0] = 0; \
} \
} \
if(display[0] !=0) \
printf("%s\n", display); \
} \
}while(0)
#ifdef TRACE0
#undef TRACE0
#define TRACE0(args...) BS_TRACE(BS_TRACE_ALL,##args)
#endif
#ifdef TRACE1
#undef TRACE1
#define TRACE1(args...) BS_TRACE(BS_TRACE_DETAIL,##args)
#endif
#ifdef TRACE2
#undef TRACE2
#define TRACE2(args...) BS_TRACE(BS_TRACE_NORMAL,##args)
#endif
#ifdef TRACE3
#undef TRACE3
#define TRACE3(args...) BS_TRACE(BS_TRACE_ERROR,##args)
#endif
#ifdef TRACE
#undef TRACE
#define TRACE(args...) BS_TRACE(BS_TRACE_INFO,##args)
#endif
#ifdef DUMP0
#undef DUMP0
#define DUMP0(buffer,length) BS_DUMP(BS_DUMP_ALL,buffer,length)
#endif
#ifdef DUMP1
#undef DUMP1
#define DUMP1(buffer,length) BS_DUMP(BS_DUMP_DETAIL,buffer,length)
#endif
#ifdef DUMP2
#undef DUMP2
#define DUMP2(buffer,length) BS_DUMP(BS_DUMP_NORMAL,buffer,length)
#endif
#ifdef DUMP3
#undef DUMP3
#define DUMP3(buffer,length) BS_DUMP(BS_DUMP_ERROR,buffer,length)
#endif
#ifdef DUMP
#undef DUMP
#define DUMP(buffer,length) BS_DUMP(BS_DUMP_INFO,buffer,length)
#endif
#else
#endif /* _BS_USING_PRIV_DEBUG_ */
#endif /* _BS_DEBUG_ */
typedef XTIMER_ID BS_TMR_ID;
typedef XTIMERIDFUNC BS_TMR_FUNC;
typedef struct _bs_tmr_msg_s{
ENVELOP st_env;
DWORD dw_data;
}St_BsTmrMsg;
typedef struct bs_stat
{
/* R6 sig stat */
/* timer stat */
unsigned int tmrCreateErr;
unsigned int tmrCreateOk;
unsigned int tmrDestroy;
unsigned int tmrStart;
unsigned int tmrRestart;
unsigned int tmrStopErr;
unsigned int tmrStopOk;
}St_BsStat;
/* for bs simulator*/
typedef struct _BS_ACTION_MSG
{
ENVELOP env;
unsigned char data[1024];
}BS_ACTION_MSG_S;
typedef struct _BS_ACTION
{
BYTE purpose;
union
{
struct
{
DWORD gSourceIp;
DWORD gDestinationIp;
DWORD gHostIp;
}initConfig;
unsigned int msNum;
unsigned short ueId;
}u;
}BS_ACTION_S;
typedef enum _BS_ACTION_PURPOSE
{
BS_SIM_CONFIG = 0,
BS_CALL_INIT,
BS_MS_DEREG
}BS_ACTION_PURPOSE_E;
#ifdef __cplusplus
}
#endif
#endif /* _BS_COMM_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -