Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1765e65e49 | |||
| bdc50a96a3 |
+70
-15
@@ -4,7 +4,6 @@
|
||||
*/
|
||||
#include "APP_API.h"
|
||||
#include "MSCP_APP_API.h"
|
||||
#include "MSCP_APP_Interface.h"
|
||||
#include "2oo2InterfaceDataManage.h"
|
||||
#include "2oo2DataTransferManage.h"
|
||||
#include "commonQueryStruDef.h"
|
||||
@@ -239,14 +238,16 @@ void APP_API_Data_Init()
|
||||
.M_InnetSafe_Enable = 0x55, /**< 内网安全通信功能开关 */
|
||||
.M_InnetRaw_Enable = 0xAA, /**< 内网透传通信功能开关 */
|
||||
.M_OutnetSafe_Enable = 0x55,/**< 外网安全通信功能开关 */
|
||||
.M_OutnetRaw_Enable = 0x55, /**< 外网透传通信功能开关 */
|
||||
.M_CpuUsageGet_Enable = 0xAA,/**< 获取cpu使用率功能开关 */
|
||||
.M_OutnetRaw_Enable = 0xAA, /**< 外网透传通信功能开关 */
|
||||
.M_CpuUsageGet_Enable = 0x55,/**< 获取cpu使用率功能开关 */
|
||||
.M_RemoteUpdate_Enable = 0x55,/**< 远程部署内网安全通信功能开关 */
|
||||
.ID_Maintenance = DEVICE_TYPE_AIM,
|
||||
.Start_Path = "/emmc1", /**< 程序启动路径 */
|
||||
.reboot_replycount = 10, /**< 重启确认报文回复次数 */
|
||||
.M_AutoReboot_Count = 3, /**< 自动重启次数 */
|
||||
.M_AutoClear_Days = 1, /**< 连续运行多久清空宕机次数的天数 */
|
||||
|
||||
#if 1
|
||||
.CPU[0].IP_2oo2 = "192.168.0.11", /**< 2oo2通信IP */
|
||||
.CPU[0].IP_2x2 = "192.168.1.62", /**< 2x2通信IP */
|
||||
.CPU[0].IP_Out = "192.168.1.62", /**< 外网通信IP */
|
||||
@@ -286,10 +287,66 @@ void APP_API_Data_Init()
|
||||
.CPU[3].IP_Com_Extend = "192.168.2.64",/**< 通用通信扩展IP */
|
||||
.CPU[3].Logger_PortBase = 55022, /**< 明文日志记录发送端口 */
|
||||
.CPU[3].Logger_PortCiphertext = 55002, /**< 暗文日志记录发送端口 */
|
||||
|
||||
#else
|
||||
.M_Area_Enable = 0xAA, /**< CI/RC标识 0x55为CI 0xAA为RC */
|
||||
.CPU[0].IP_2oo2 = "192.168.0.31", /**< 2oo2通信IP */
|
||||
.CPU[0].IP_2x2 = "192.168.1.63", /**< 2x2通信IP */
|
||||
.CPU[0].IP_Out = "192.168.1.63", /**< 外网通信IP */
|
||||
.CPU[0].IP_Maintain = "192.168.146.105", /**< 维护通信IP */
|
||||
/*适用透传通道-选配*/
|
||||
.CPU[0].IP_Com = "192.168.1.63", /**< 通用通信IP */
|
||||
.CPU[0].IP_Com_Extend = "192.168.1.63",/**< 通用通信扩展IP */
|
||||
.CPU[0].Logger_PortBase = 55011, /**< 明文日志记录发送端口 */
|
||||
.CPU[0].Logger_PortCiphertext = 55002, /**< 暗文日志记录发送端口 */
|
||||
|
||||
.CPU[1].IP_2oo2 = "192.168.0.32", /**< 2oo2通信IP */
|
||||
.CPU[1].IP_2x2 = "192.168.2.63", /**< 2x2通信IP */
|
||||
.CPU[1].IP_Out = "192.168.2.63", /**< 外网通信IP */
|
||||
.CPU[1].IP_Maintain = "192.168.18.106", /**< 维护通信IP */
|
||||
/*适用透传通道-选配*/
|
||||
.CPU[1].IP_Com = "192.168.2.63", /**< 通用通信IP */
|
||||
.CPU[1].IP_Com_Extend = "192.168.2.63",/**< 通用通信扩展IP */
|
||||
.CPU[1].Logger_PortBase = 55012, /**< 明文日志记录发送端口 */
|
||||
.CPU[1].Logger_PortCiphertext = 55002, /**< 暗文日志记录发送端口 */
|
||||
|
||||
.CPU[2].IP_2oo2 = "192.168.0.41", /**< 2oo2通信IP */
|
||||
.CPU[2].IP_2x2 = "192.168.1.65", /**< 2x2通信IP */
|
||||
.CPU[2].IP_Out = "192.168.1.65", /**< 外网通信IP */
|
||||
.CPU[2].IP_Maintain = "192.168.146.107", /**< 维护通信IP */
|
||||
/*适用透传通道-选配*/
|
||||
.CPU[2].IP_Com = "192.168.1.65", /**< 通用通信IP */
|
||||
.CPU[2].IP_Com_Extend = "192.168.1.65",/**< 通用通信扩展IP */
|
||||
.CPU[2].Logger_PortBase = 55021, /**< 明文日志记录发送端口 */
|
||||
.CPU[2].Logger_PortCiphertext = 55002, /**< 暗文日志记录发送端口 */
|
||||
|
||||
.CPU[3].IP_2oo2 = "192.168.0.42", /**< 2oo2通信IP */
|
||||
.CPU[3].IP_2x2 = "192.168.2.65", /**< 2x2通信IP */
|
||||
.CPU[3].IP_Out = "192.168.2.65", /**< 外网通信IP */
|
||||
.CPU[3].IP_Maintain = "192.168.18.108", /**< 维护通信IP */
|
||||
/*适用透传通道-选配*/
|
||||
.CPU[3].IP_Com = "192.168.2.65", /**< 通用通信IP */
|
||||
.CPU[3].IP_Com_Extend = "192.168.2.65",/**< 通用通信扩展IP */
|
||||
.CPU[3].Logger_PortBase = 55022, /**< 明文日志记录发送端口 */
|
||||
.CPU[3].Logger_PortCiphertext = 55002, /**< 暗文日志记录发送端口 */
|
||||
|
||||
/*CPU1*/
|
||||
.AREA_CPU[0].IP_Area_A = "192.168.1.62", /**< 另一插箱A系CPU1的2x2IP */
|
||||
.AREA_CPU[0].IP_Area_B = "192.168.1.64", /**< 另一插箱B系CPU1的2x2IP */
|
||||
.AREA_CPU[0].IP_Multicast_Mine = "239.0.0.21", /**< 本插箱CPU1所在广播域 */
|
||||
.AREA_CPU[0].IP_Multicast_Dest = "239.0.0.11", /**< 另一插箱CPU1所在广播域 */
|
||||
/*CPU2*/
|
||||
.AREA_CPU[1].IP_Area_A = "192.168.2.62", /**< 另一插箱A系CPU2的2x2IP */
|
||||
.AREA_CPU[1].IP_Area_B = "192.168.2.64", /**< 另一插箱B系CPU2的2x2IP */
|
||||
.AREA_CPU[1].IP_Multicast_Mine = "239.0.0.22", /**< 本插箱CPU2所在广播域 */
|
||||
.AREA_CPU[1].IP_Multicast_Dest = "239.0.0.12", /**< 另一插箱CPU2所在广播域 */
|
||||
#endif
|
||||
/*通用端口配置*/
|
||||
.Port_Outnet_Safe = 54001, /**< 外网安全通信端口 */
|
||||
.Port_Innet_Safe = 53001, /**< 内网安全通信端口 */
|
||||
.Port_Outnet_Raw = 54002, /**< 外网透明传输端口 */
|
||||
// .Port_Log_Base = 55001, /**< 明文日志记录发送端口 */
|
||||
// .Port_Log_Ciphertext = 55002, /**< 暗文日志记录发送端口 */
|
||||
.Port_Remote_Update = 50000, /**< 远程部署通信端口 */
|
||||
/*透传配置-选配*/
|
||||
.Port_Innet_Raw_Num = 0, /**< 内网透传端口数量 */
|
||||
@@ -328,6 +385,8 @@ void APP_API_Data_Init()
|
||||
/*日志记录目标设备IP配置*/
|
||||
.Logger_G_IP = "192.168.146.100", /**< 绿网日志记录IP */
|
||||
.Logger_P_IP = "192.168.18.100", /**< 紫网日志记录IP */
|
||||
// .Logger_PortBase = 55001, /**< 明文日志记录端口 */
|
||||
// .Logger_PortCiphertext = 55002,
|
||||
/*内网通信设备注册最大支持0-255*/
|
||||
.INNET_COM_NUM = 1, /**< 内网通信设备数量 */
|
||||
.INNET_COM_CFG[0].InnetID = DEVICE_TYPE_AIM, /**< 内网通信ID */
|
||||
@@ -350,10 +409,10 @@ void APP_API_Data_Init()
|
||||
|
||||
/*组软件版本号*/
|
||||
ii = 0U;
|
||||
appVersBuffer[ii++] = VER_INTE_PROJECT;
|
||||
appVersBuffer[ii++] = VER_INTE_PRODUCT >> 2U;
|
||||
appVersBuffer[ii++] = (VER_INTE_PRODUCT << 6U) + (VER_INTE_EXE & (UINT8)0x3F);
|
||||
appVersBuffer[ii++] = VER_INTE_TIME;
|
||||
appVersBuffer[ii++] = VER_SOFT_PRODUCT;
|
||||
appVersBuffer[ii++] = VER_SOFT_MODUAL_APP >> 2U;
|
||||
appVersBuffer[ii++] = (VER_SOFT_MODUAL_APP << 6U) + (VER_SOFT_MIANVERSION & (UINT8)0x3F);
|
||||
appVersBuffer[ii++] = VER_SOFT_SUBVERSION;
|
||||
/*设置平台调用获取外网信息函数*/
|
||||
MSCP_SetSrcId(SetOutNetPara);
|
||||
/*设置内网参数*/
|
||||
@@ -376,7 +435,7 @@ void APP_API_Data_Init()
|
||||
*/
|
||||
ENUM_CM_RETURN APP_API_MainFunc(void)
|
||||
{
|
||||
ENUM_CM_RETURN retVal = ENUM_CM_NULL;
|
||||
ENUM_CM_RETURN retVal = ENUM_CM_FALSE;
|
||||
CM_UINT64 startCycTick = 0u;
|
||||
CM_UINT64 endCycTick = 0u;
|
||||
|
||||
@@ -560,10 +619,6 @@ ENUM_CM_RECCUSEB Is_Send_ExtendBoard(IN const CM_UINT16 dstDevTypeId)
|
||||
{
|
||||
retVal = ENUM_CM_SEB;
|
||||
}
|
||||
else if (CI_SYSTEM_TYPE_ITE == devType)
|
||||
{
|
||||
retVal = ENUM_CM_CCSEB;
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal = ENUM_CM_CC;
|
||||
@@ -625,8 +680,8 @@ void SetOutNetPara(UINT8* pRxBuf, UINT32 dwLen, ENUM_OUTNET_CHN_T chOutNetType,
|
||||
tempLen = *pCurLen;
|
||||
if ((TRANSMIT_OBJECT_SUM_MAX * TRANSMIT_OBJECT_DEVICE_SUM_MAX) > (tempLen + objLen))
|
||||
{
|
||||
CommonMemCpy((void*)&pOutBuf[tempLen], objLen * sizeof(UINT16), \
|
||||
(const void*)gTransmitObjTypeId, objLen * sizeof(UINT16));
|
||||
CommonMemCpy(&pOutBuf[tempLen], objLen * sizeof(UINT16), \
|
||||
gTransmitObjTypeId, objLen * sizeof(UINT16));
|
||||
*pCurLen = tempLen + objLen;
|
||||
debug_infor_printf("outnet in type len :%d", chOutNetType, objLen);
|
||||
debug_out_array(0xAA, gTransmitObjTypeId, objLen * sizeof(UINT16));
|
||||
@@ -760,7 +815,7 @@ ENUM_CM_RETURN SerialOutAtsVobcFunc(UINT16 inDstId IN, UINT16* outSrcId OUT, UIN
|
||||
UINT8 inDstType = 0U;
|
||||
|
||||
inDstType = (UINT8)((inDstId & 0xff00U) >> 8);
|
||||
if ((CI_SYSTEM_TYPE_VOBC_BACKUP == inDstType) || (CI_SYSTEM_TYPE_ITE == inDstType))
|
||||
if (CI_SYSTEM_TYPE_VOBC_BACKUP == inDstType)
|
||||
{
|
||||
*outSrcId = (CI_SYSTEM_TYPE_CI << 8) + GetSystemParaLocalCiId();
|
||||
*outDstId = GetATSInterfaceTypeId();
|
||||
|
||||
@@ -84,7 +84,7 @@ int eeprom_read_data(int fd, uint32_t regaddr, uint8_t rx_buf[],uint32_t len,uin
|
||||
|
||||
if(ret > 0)
|
||||
{
|
||||
perror("eeprom read i2c error ");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -2491,6 +2491,10 @@ void CFM_LogCiphertextSend(void)
|
||||
{
|
||||
appType = 7u;
|
||||
}
|
||||
else if(0 == strcmp(g_PFM_Cfg.APP_NAME, "YJP"))
|
||||
{
|
||||
appType = 8u;
|
||||
}
|
||||
else
|
||||
{
|
||||
appType = 0u;
|
||||
|
||||
@@ -410,6 +410,7 @@ ENUM_CM_RETURN CM_Com_LocalDataRecv(OUT CM_UINT8* pBuf, IN CM_UINT16 BufSize)
|
||||
CM_UINT32 len = 0u; /* 数据长度 */
|
||||
CM_UINT64 now_time = 0u;
|
||||
CM_UINT64 start_time = CM_GetTick();
|
||||
CM_UINT32 recvNum = 0u;
|
||||
/*- 循环执行接收线程 */
|
||||
do
|
||||
{
|
||||
@@ -418,6 +419,7 @@ ENUM_CM_RETURN CM_Com_LocalDataRecv(OUT CM_UINT8* pBuf, IN CM_UINT16 BufSize)
|
||||
/*- 是否收到有效报文 */
|
||||
if(1 == ret)
|
||||
{
|
||||
recvNum++;
|
||||
rtnValue = CM_FFFEDecode(&g_COM[1u].prtclFFFEStru,data,buf,&len);
|
||||
/*接收到完整包写入接收队列*/
|
||||
if(ENUM_CM_TRUE == rtnValue)
|
||||
|
||||
@@ -121,8 +121,19 @@ void CM_Sleep(CM_UINT32 ms)
|
||||
/*精准延时函数*/
|
||||
void CM_delayUs(CM_UINT64 us)
|
||||
{
|
||||
CM_TIMESPEC_T tv;
|
||||
tv.tv_sec = (time_t)CM_UNSIGNED_LONG_INT_EXP(us / 1000000U);
|
||||
tv.tv_nsec = (long)CM_UNSIGNED_LONG_INT_EXP(us % 1000000U);
|
||||
(void)select(0, NULL, NULL, NULL, &tv);
|
||||
/*- 变量初始化*/
|
||||
CM_TIMESPEC_T rem; /*- 延时被打断后的剩余时间*/
|
||||
CM_INT8 ret = 0;
|
||||
CM_TIMESPEC_T req = {
|
||||
.tv_sec = (time_t)(us / 1000000u),
|
||||
.tv_nsec = (long)((us % 1000000u) * 1000u)
|
||||
};
|
||||
|
||||
ret = nanosleep(&req, &rem);
|
||||
/*- 执行延时操作*/
|
||||
while ((-1 == ret) && (EINTR == errno))
|
||||
{
|
||||
ret = nanosleep(&req, &rem);
|
||||
req = rem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -619,18 +619,25 @@ void DFM_Network_Check(void)
|
||||
(void)system("drvtools -link9131 3 >> networkcheck.txt");
|
||||
|
||||
FILE *file = fopen(filename, "r");
|
||||
while (NULL != fgets(pFileBuf, sizeof(pFileBuf), file)) {
|
||||
if('w' != pFileBuf[0])
|
||||
{
|
||||
MSCP_LOG_MSG("%s", pFileBuf);
|
||||
(void)printf("%s", pFileBuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 不做处理,过滤无用数据 */
|
||||
}
|
||||
if(NULL == file)
|
||||
{
|
||||
printf("open networkcheck.txt error\n");
|
||||
}
|
||||
/* 关闭文件 */
|
||||
(void)fclose(file);
|
||||
else{
|
||||
while (NULL != fgets(pFileBuf, sizeof(pFileBuf), file)) {
|
||||
if('w' != pFileBuf[0])
|
||||
{
|
||||
MSCP_LOG_MSG("%s", pFileBuf);
|
||||
(void)printf("%s", pFileBuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 不做处理,过滤无用数据 */
|
||||
}
|
||||
}
|
||||
/* 关闭文件 */
|
||||
(void)fclose(file);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
CM_CHAR FS_FILE_PATH[100];
|
||||
|
||||
/** 平台软件版本号 */
|
||||
const CM_UINT8 MSCP_SW_VERION[4] = { 93u, 1u, 1u, 52u };
|
||||
const CM_UINT8 MSCP_SW_VERION[4] = { 93u, 1u, 1u, 54u };
|
||||
/** 驱动软件版本号 */
|
||||
CM_UINT8 MSCP_DRV_VERION[4] = {0};
|
||||
/** 与维护一体机接口文档版本号(接口文档发生改变时升级版本号) */
|
||||
@@ -648,6 +648,13 @@ void PFM_CFG_IfconfigIp(void)
|
||||
sprintf(str, "ifconfig %s %s", "wm0", "192.168.145.101");
|
||||
/*- 跳出 */
|
||||
break;
|
||||
case 0x03U:
|
||||
sprintf(str, "ifconfig %s %s", "wm0", "192.168.147.101");
|
||||
/*- 跳出 */
|
||||
break;
|
||||
case 0x43U:
|
||||
sprintf(str, "ifconfig %s %s", "wm0", "192.168.148.101");
|
||||
break;
|
||||
/*1-2*/
|
||||
case 0x55U:
|
||||
sprintf(str, "ifconfig %s %s", "wm0", "192.168.16.102");
|
||||
@@ -661,6 +668,14 @@ void PFM_CFG_IfconfigIp(void)
|
||||
sprintf(str, "ifconfig %s %s", "wm0", "192.168.17.102");
|
||||
/*- 跳出 */
|
||||
break;
|
||||
case 0x05U:
|
||||
sprintf(str, "ifconfig %s %s", "wm0", "192.168.19.102");
|
||||
/*- 跳出 */
|
||||
break;
|
||||
case 0x45U:
|
||||
sprintf(str, "ifconfig %s %s", "wm0", "192.168.20.102");
|
||||
/*- 跳出 */
|
||||
break;
|
||||
/*2-1*/
|
||||
case 0xA6U:
|
||||
sprintf(str, "ifconfig %s %s", "wm0", "192.168.144.103");
|
||||
@@ -674,6 +689,14 @@ void PFM_CFG_IfconfigIp(void)
|
||||
sprintf(str, "ifconfig %s %s", "wm0", "192.168.145.103");
|
||||
/*- 跳出 */
|
||||
break;
|
||||
case 0xF6U:
|
||||
sprintf(str, "ifconfig %s %s", "wm0", "192.168.147.103");
|
||||
/*- 跳出 */
|
||||
break;
|
||||
case 0xB6U:
|
||||
sprintf(str, "ifconfig %s %s", "wm0", "192.168.148.103");
|
||||
/*- 跳出 */
|
||||
break;
|
||||
/*2-2*/
|
||||
case 0xAAU:
|
||||
sprintf(str, "ifconfig %s %s", "wm0", "192.168.16.104");
|
||||
@@ -687,6 +710,14 @@ void PFM_CFG_IfconfigIp(void)
|
||||
sprintf(str, "ifconfig %s %s", "wm0", "192.168.17.104");
|
||||
/*- 跳出 */
|
||||
break;
|
||||
case 0xFAU:
|
||||
sprintf(str, "ifconfig %s %s", "wm0", "192.168.19.104");
|
||||
/*- 跳出 */
|
||||
break;
|
||||
case 0xBAU:
|
||||
sprintf(str, "ifconfig %s %s", "wm0", "192.168.20.104");
|
||||
/*- 跳出 */
|
||||
break;
|
||||
default:
|
||||
MSCP_LOG_MSG("drv_boardidErr:0x%x,ini:0x%x,0x%x\r\n",DrvBoard_ID,g_PFM_Cfg.BOARD_ID,g_PFM_Cfg.CPU_ID);
|
||||
/*- 跳出 */
|
||||
@@ -758,6 +789,8 @@ static void PFM_CFG_Check_BoardID(void)
|
||||
case 0x53U:
|
||||
case 0x33U:
|
||||
case 0x63U:
|
||||
case 0x03U:
|
||||
case 0x43U:
|
||||
CM_NM_ASSERT(((CM_UINT8)1U == g_PFM_Cfg.BOARD_ID) && ((CM_UINT8)1U == g_PFM_Cfg.CPU_ID), CFG_MODE, DARK_FAULT_CODE_FUN_ORDER_4, TSCP_DARK_ASSERT_1);
|
||||
/*- 跳出 */
|
||||
break;
|
||||
@@ -765,6 +798,8 @@ static void PFM_CFG_Check_BoardID(void)
|
||||
case 0x55U:
|
||||
case 0x35U:
|
||||
case 0x65U:
|
||||
case 0x05U:
|
||||
case 0x45U:
|
||||
CM_NM_ASSERT(((CM_UINT8)1U == g_PFM_Cfg.BOARD_ID) && ((CM_UINT8)2U == g_PFM_Cfg.CPU_ID), CFG_MODE, DARK_FAULT_CODE_FUN_ORDER_4, TSCP_DARK_ASSERT_1);
|
||||
/*- 跳出 */
|
||||
break;
|
||||
@@ -772,6 +807,8 @@ static void PFM_CFG_Check_BoardID(void)
|
||||
case 0xA6U:
|
||||
case 0xC6U:
|
||||
case 0x96U:
|
||||
case 0xF6U:
|
||||
case 0xB6U:
|
||||
CM_NM_ASSERT(((CM_UINT8)2U == g_PFM_Cfg.BOARD_ID) && ((CM_UINT8)1U == g_PFM_Cfg.CPU_ID), CFG_MODE, DARK_FAULT_CODE_FUN_ORDER_4, TSCP_DARK_ASSERT_1);
|
||||
/*- 跳出 */
|
||||
break;
|
||||
@@ -779,6 +816,8 @@ static void PFM_CFG_Check_BoardID(void)
|
||||
case 0xAAU:
|
||||
case 0xCAU:
|
||||
case 0x9AU:
|
||||
case 0xFAU:
|
||||
case 0xBAU:
|
||||
CM_NM_ASSERT(((CM_UINT8)2U == g_PFM_Cfg.BOARD_ID) && ((CM_UINT8)2U == g_PFM_Cfg.CPU_ID), CFG_MODE, DARK_FAULT_CODE_FUN_ORDER_4, TSCP_DARK_ASSERT_1);
|
||||
/*- 跳出 */
|
||||
break;
|
||||
|
||||
@@ -383,7 +383,7 @@ static CM_INT32 s_2oo2_ARQ_Recv(OUT CM_UINT8 *RxData, IN CM_UINT32 RxSize, OUT E
|
||||
while(1)
|
||||
{
|
||||
/*- 从通信层接收2oo2报文 */
|
||||
rxLen = p_2oo2_Ctrl->DataRecv(p_2oo2_Ctrl->UDP_Cache, (CM_UINT32)sizeof(p_2oo2_Ctrl->UDP_Cache));
|
||||
rxLen = p_2oo2_Ctrl->DataRecv(p_2oo2_Ctrl->UDP_Cache, (CM_UINT32)sizeof(p_2oo2_Ctrl->UDP_Cache));
|
||||
/*- 收到的报文长度是否大于23 */
|
||||
if (23 <= rxLen)
|
||||
{
|
||||
|
||||
@@ -725,7 +725,7 @@ static void s_State_Transition(void)
|
||||
{
|
||||
/*- 无处理 */
|
||||
SFM_LOG_MSG_2X("Transition:2x2:OFFLINE>SLAVE SysCyc:%d,BF:%d,AF:%d,COK:%d,OUT:%d,TS:%d,AFC:%d\n",
|
||||
s_2x2_state_Ctrl.SysCyc,s_2x2_state_Ctrl.LastRxInputSysCyc,
|
||||
s_2x2_state_Ctrl.SysCyc,s_2x2_state_Ctrl.LastRxInputSysCyc,s_2x2_state_Ctrl.LastFollowCyc,
|
||||
s_2x2_state_Ctrl.LastCheckOKCount,s_2x2_state_Ctrl.OutPutCheckFailFlag,
|
||||
s_2x2_state_Ctrl.TimeSyncFlag,
|
||||
s_2x2_state_Ctrl.AppFollowCmpFlag);
|
||||
@@ -2105,13 +2105,13 @@ static void s_2x2_Recv(void)
|
||||
CM_RE_ASSERT(FrameNum <= (SFM_OUTNETSAFE_BUFF_SIZE / NET_20K_SIZE), SFM_2x2_MODE, DARK_FAULT_CODE_FUN_ORDER_6, TSCP_DARK_ASSERT_15);
|
||||
CM_RE_ASSERT(FrameIndex <= FrameNum, SFM_2x2_MODE, DARK_FAULT_CODE_FUN_ORDER_6, TSCP_DARK_ASSERT_16);
|
||||
ret = SFM_2X_FrameSave(&s_2x2_FrameCtrl, (CM_UINT8)type, FrameNum, FrameIndex, pData, DataLen,
|
||||
g_2x2oo2_rx[g_2x2oo2_base][type-g_2x2oo2_data_num].p_rmt_peer_buf,
|
||||
&g_2x2oo2_rx[g_2x2oo2_base][type-g_2x2oo2_data_num].rmt_peer_len,
|
||||
(CM_UINT32)g_2x2oo2_rx[g_2x2oo2_base][type-g_2x2oo2_data_num].buf_size);
|
||||
g_2x2oo2_rx[g_2x2oo2_base][(CM_INT32)type-g_2x2oo2_data_num].p_rmt_peer_buf,
|
||||
&g_2x2oo2_rx[g_2x2oo2_base][(CM_INT32)type-g_2x2oo2_data_num].rmt_peer_len,
|
||||
(CM_UINT32)g_2x2oo2_rx[g_2x2oo2_base][(CM_INT32)type-g_2x2oo2_data_num].buf_size);
|
||||
/*记录对系邻机数据长度*/
|
||||
s_2x2_Ctrl.InPutDoublePassLen[type-g_2x2oo2_data_num][1] = g_2x2oo2_rx[g_2x2oo2_base][type-g_2x2oo2_data_num].rmt_peer_len;
|
||||
s_2x2_Ctrl.InPutDoublePassLen[(CM_INT32)type-g_2x2oo2_data_num][1] = g_2x2oo2_rx[g_2x2oo2_base][(CM_INT32)type-g_2x2oo2_data_num].rmt_peer_len;
|
||||
/*- 是否收齐了全部数据同步报文 */
|
||||
if ((ENUM_CM_TRUE == ret) && (type == g_2x2RcvMaxNum[1]))
|
||||
if ((ENUM_CM_TRUE == ret) && ((CM_UINT8)type == g_2x2RcvMaxNum[1]))
|
||||
{
|
||||
/*- 更新对系输入状态 */
|
||||
s_2x2_Ctrl.InputPeerSysCyc = msgCyc;
|
||||
|
||||
@@ -701,7 +701,7 @@ UINT8 CiSimulationInit()
|
||||
|
||||
}
|
||||
|
||||
|
||||
UINT32 ttt = sizeof(RouteDataStruct);
|
||||
/* FSIO初始化 */
|
||||
if(0 == ret)
|
||||
{
|
||||
@@ -2450,15 +2450,12 @@ void SndCbtcPrtclByDevName(UINT8 *spfbSndDataBuff)
|
||||
UINT8 *pData = spfbSndDataBuff;
|
||||
CComm *pRedCcov = NULL;
|
||||
CComm *pBlueCcov = NULL;
|
||||
CComm *pAtsRedCcov = NULL;
|
||||
CComm *pAtsBlueCcov = NULL;
|
||||
UINT16 DeviceName = 0;
|
||||
UINT8 cDstType = 0u;
|
||||
UINT8 cDstId = 0u;
|
||||
UINT16 LogicId = 0;
|
||||
UINT8 protocalType = 0;
|
||||
IpInfo ipInfoList[8];
|
||||
IpInfo atsBackUpIpInfoList[8];
|
||||
UINT8 dstNum;/*目标IP数目*/
|
||||
UINT8 findFlag = 1;
|
||||
UINT8 i_dstNum = 0;
|
||||
@@ -2472,8 +2469,6 @@ void SndCbtcPrtclByDevName(UINT8 *spfbSndDataBuff)
|
||||
UINT32 t_LenPos = 0U;
|
||||
UINT16 wGatewayId = 0U;
|
||||
UINT16 wBackUpVobcId = 0U;
|
||||
UINT8 chIteNum = 0U;
|
||||
UINT8 chAtsBackUpNum = 0U;
|
||||
struct timeval curTimeStamp;
|
||||
memset(ipInfoList,DEFAULT_ZERO,sizeof(ipInfoList));
|
||||
|
||||
@@ -2543,26 +2538,10 @@ void SndCbtcPrtclByDevName(UINT8 *spfbSndDataBuff)
|
||||
pRedCcov = &(localCcov.ocRedCcov);
|
||||
pBlueCcov = &(localCcov.ocBlueCcov);
|
||||
}
|
||||
else if (CI_SYSTEM_TYPE_VOBC_BACKUP == cDstType)
|
||||
else if (DeviceName == wBackUpVobcId)
|
||||
{
|
||||
pRedCcov = &(localCcov.atsRedCcov[ccovIdx]);
|
||||
pBlueCcov = &(localCcov.atsBlueCcov[ccovIdx]);
|
||||
DeviceName = wBackUpVobcId;
|
||||
}
|
||||
else if (CI_SYSTEM_TYPE_ITE == cDstType)
|
||||
{
|
||||
if (1U == LogicId)
|
||||
{
|
||||
pRedCcov = &(localCcov.redCcov[ccovIdx]);
|
||||
pBlueCcov =&(localCcov.atsRedCcov[ccovIdx]);
|
||||
}
|
||||
else
|
||||
{
|
||||
pRedCcov = &(localCcov.atsBlueCcov[ccovIdx]);
|
||||
pBlueCcov = &(localCcov.blueCcov[ccovIdx]);
|
||||
}
|
||||
pAtsRedCcov = &(localCcov.atsRedCcov[ccovIdx]);
|
||||
pAtsBlueCcov = &(localCcov.atsBlueCcov[ccovIdx]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2572,16 +2551,7 @@ void SndCbtcPrtclByDevName(UINT8 *spfbSndDataBuff)
|
||||
|
||||
/* 根据目标类型和ID获取对方IP和端口*/
|
||||
/*调用GetIpAndPortByDeviceName()函数后,蓝网和红网IP和端口都返回*/
|
||||
if (CI_SYSTEM_TYPE_ITE == cDstType)
|
||||
{
|
||||
GetNetEndPoint(DeviceName, LogicId, ccovIdx, ipInfoList, &chIteNum);
|
||||
GetNetEndPoint(wBackUpVobcId, 0, ccovIdx, atsBackUpIpInfoList, &chAtsBackUpNum);
|
||||
findFlag = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
findFlag = GetNetEndPoint(DeviceName, LogicId, ccovIdx, ipInfoList, &dstNum);
|
||||
}
|
||||
findFlag = GetNetEndPoint(DeviceName, LogicId, ccovIdx, ipInfoList, &dstNum);
|
||||
if (findFlag == 0)
|
||||
{
|
||||
/*find fail,do nothing*/
|
||||
@@ -2663,40 +2633,6 @@ void SndCbtcPrtclByDevName(UINT8 *spfbSndDataBuff)
|
||||
|
||||
SndData2SignalNet(ipInfoList[0].blueIp, ipInfoList[0].bluePort, &temSendBuf[0], t_OffSet, pBlueCcov);
|
||||
}
|
||||
else if(3==findFlag)
|
||||
{
|
||||
/*发送主用通道需要减去14 后备通道协议包头后发送*/
|
||||
CommonMemCpy(temSendBuf, sizeof(temSendBuf), &sndBuff[14], sndDataLen - 14);
|
||||
for (i_dstNum = 0; i_dstNum < chIteNum; i_dstNum++)
|
||||
{
|
||||
startTickCount = GetTickCount();
|
||||
if (1 == LogicId)
|
||||
{
|
||||
SndData2SignalNet(ipInfoList[i_dstNum].redIp, ipInfoList[i_dstNum].redPort, temSendBuf, sndDataLen-14, pRedCcov);
|
||||
}
|
||||
else if(2 == LogicId)
|
||||
{
|
||||
SndData2SignalNet(ipInfoList[i_dstNum].blueIp, ipInfoList[i_dstNum].bluePort, temSendBuf, sndDataLen - 14, pBlueCcov);
|
||||
}
|
||||
else
|
||||
{
|
||||
;
|
||||
}
|
||||
endTickCount = GetTickCount();
|
||||
debug_infor_printf("Snd to %04x,consume %d ms.\r\n", DeviceName, endTickCount - startTickCount);
|
||||
}
|
||||
for (i_dstNum = 0; i_dstNum < chAtsBackUpNum; i_dstNum++)
|
||||
{
|
||||
startTickCount = GetTickCount();
|
||||
|
||||
SndData2SignalNet(atsBackUpIpInfoList[i_dstNum].blueIp, atsBackUpIpInfoList[i_dstNum].bluePort, sndBuff, sndDataLen, pAtsBlueCcov);
|
||||
|
||||
SndData2SignalNet(atsBackUpIpInfoList[i_dstNum].redIp, atsBackUpIpInfoList[i_dstNum].redPort, sndBuff, sndDataLen, pAtsRedCcov);
|
||||
|
||||
endTickCount = GetTickCount();
|
||||
debug_infor_printf("Snd to %04x,consume %d ms.\r\n", DeviceName, endTickCount - startTickCount);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -3031,7 +2967,7 @@ UINT16 RedSndUnPackNew(UINT8 *sfpBuff,UINT8 *sndBuff,UINT32 *index,UINT32 totalL
|
||||
*LogicId = ShortFromChar(&sfpBuff[tempIndex]);
|
||||
tempIndex = tempIndex+2;
|
||||
|
||||
if ((CI_SYSTEM_TYPE_VOBC_BACKUP *256U) == (*DevName & 0xff00)||(CI_SYSTEM_TYPE_ITE * 256U) == (*DevName & 0xff00))
|
||||
if ((CI_SYSTEM_TYPE_VOBC_BACKUP *256U) == (*DevName & 0xff00))
|
||||
{
|
||||
ats_sendLendress = send_backupindex; /*长度地址*/
|
||||
send_backupindex += 2U;
|
||||
@@ -3044,23 +2980,20 @@ UINT16 RedSndUnPackNew(UINT8 *sfpBuff,UINT8 *sndBuff,UINT32 *index,UINT32 totalL
|
||||
localCiId = GetSystemParaLocalCiId(); /*源ID*/
|
||||
srcId = (UINT16)((CI_SYSTEM_TYPE_CI * 256) + localCiId);
|
||||
ShortToChar(srcId, &sndBuff[send_backupindex]);
|
||||
send_backupindex += 2U;
|
||||
ShortToChar(0U, &sndBuff[send_backupindex]);
|
||||
send_backupindex += 2U;
|
||||
ats_sendLen += 4U;
|
||||
ats_sendLen += 2U;
|
||||
|
||||
ShortToChar(*DevName, &sndBuff[send_backupindex]); /*目的ID*/
|
||||
send_backupindex += 2U;
|
||||
ats_sendLen += 2U;
|
||||
ShortToChar(*LogicId, &sndBuff[send_backupindex]); /*目的ID*/
|
||||
send_backupindex += 2U;
|
||||
ats_sendLen += 2U;
|
||||
|
||||
*DevName = GetATSInterfaceTypeId(); /*修改内网中目的id*/
|
||||
|
||||
}
|
||||
|
||||
sendLen = dataLen-(tempIndex-indexStart);
|
||||
|
||||
if ((CI_SYSTEM_TYPE_VOBC_BACKUP * 256U) == (*DevName & 0xff00) || (CI_SYSTEM_TYPE_ITE * 256U) == (*DevName & 0xff00))
|
||||
if ((CI_SYSTEM_TYPE_ATS_INTERFACE * 256U) == (*DevName & 0xff00))
|
||||
{
|
||||
sendLen += ats_sendLen; /*返回长度前判一下类型是否需要加给ATS交换机的数据长度*/
|
||||
ShortToChar(sendLen, &sndBuff[ats_sendLendress]);/*记录长度*/
|
||||
@@ -4932,14 +4865,6 @@ void ReadCIFsDevIpTable(const char * pCiFsPath)
|
||||
dquHlhtId2VobcName(gDeviceIpInfoArray[dwCurDevNum].estId, &wDevName, &wLogicId);
|
||||
gDeviceIpInfoArray[dwCurDevNum].logicId = wLogicId;
|
||||
}
|
||||
else if (DEVTYPE_ITE == cDevType)
|
||||
{
|
||||
gDeviceIpInfoArray[dwCurDevNum].logicId = gDeviceIpInfoArray[dwCurDevNum].estId&0x03;
|
||||
}
|
||||
else
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
dwCurDevNum++; /*每成功存储一行IP,数量加一*/
|
||||
}
|
||||
|
||||
@@ -391,7 +391,6 @@ UINT8 GetNetEndPoint(UINT16 devId, UINT16 logicId, UINT8 prtlIdx, IpInfo pIpInfo
|
||||
UINT8 devType = 0u;
|
||||
UINT8 id = 0u;
|
||||
UINT32 vobcId[2] = { 0,0 };
|
||||
UINT32 iteId[2] = { 0,0 };
|
||||
UINT8 tempDevType = 0;
|
||||
UINT16 tempDevId = 0;
|
||||
UINT8 chFuncRtn = 0U;
|
||||
@@ -426,20 +425,6 @@ UINT8 GetNetEndPoint(UINT16 devId, UINT16 logicId, UINT8 prtlIdx, IpInfo pIpInfo
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DEVTYPE_ITE:
|
||||
getHlhtRet = dquQueryOutIteDevId(id, iteId);
|
||||
if ((0u == logicId) || (1u == logicId) || (2u == logicId))
|
||||
{
|
||||
if ((0u == logicId) || (1u == logicId))
|
||||
{
|
||||
hlhtId = iteId[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
hlhtId = iteId[1];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DEVTYPE_NDSU:
|
||||
getHlhtRet = dquQueryOutDevId(QFUN_IDMAP_DSU_ID, id, &hlhtId);
|
||||
break;
|
||||
@@ -815,7 +800,7 @@ UINT8 GetDeviceNameByIpAndPort(UINT16 port,UINT32 ip,UINT16 *deviceName,UINT16 *
|
||||
{
|
||||
*deviceName = gDeviceIpInfoArray[index].deviceName;
|
||||
/*VOBC*/
|
||||
if((DEVTYPE_VOBC == (UINT8)(gDeviceIpInfoArray[index].deviceName >> 8))|| (DEVTYPE_ITE == (UINT8)(gDeviceIpInfoArray[index].deviceName >> 8)))
|
||||
if(DEVTYPE_VOBC == (UINT8)(gDeviceIpInfoArray[index].deviceName >> 8))
|
||||
{
|
||||
*pLogId = gDeviceIpInfoArray[index].logicId;
|
||||
}
|
||||
|
||||
@@ -340,12 +340,11 @@ UINT8 CbtcCcomm::RcvThread()
|
||||
|
||||
sourceID = ShortFromChar((const UINT8*)&_prcvDataBuff[t_OffSet]); /* 源ID */
|
||||
t_OffSet += 2u; /*解出后备模式实际上的VOBCID*/
|
||||
logId = ShortFromChar((const UINT8*)&_prcvDataBuff[t_OffSet]); /* 源ID */
|
||||
t_OffSet += 2u; /*解出后备模式实际上的逻辑*/
|
||||
|
||||
dstID = ShortFromChar((const UINT8*)&_prcvDataBuff[t_OffSet]);/* 目的ID */
|
||||
t_OffSet += 2u;
|
||||
t_OffSet += 2u;
|
||||
|
||||
|
||||
logId = 0u;
|
||||
|
||||
ShortToChar((rcv_data_len - t_OffSet + 4u), &tempframeBuf[0]);/*长度*/
|
||||
ShortToChar(sourceID, &tempframeBuf[2]);/*类型+ID*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user