EXPORT_C TInt RFlowContext::Open(MFlowManager *aManager, const TSockAddr &aDst, const TSockAddr &aSrc, TUint aProtocol, TUint aIcmpType, TUint aIcmpCode) /** * Just a convenience function, which combines Open, SetRemoteAddr, SetLocalAddr, SetIcmpInfo and Connect. * * @param aManager Flow Manager * @param aDst Flow's destination address (and port) * @param aSrc Flow's source address (and port) * @param aProtocol The upper layer protocol associated with the flow * (and the value for the IP NextHeader/Protocol field, * unless some hook adds extension headers) * @param aIcmpType ICMP type (only sensible when protocol is ICMP) * @param aIcmpCode ICMP code (only sensible when protocol is ICMP) * * @return * current value of CFlowContext::iStatus. */ { TInt ret = Open(aManager, aProtocol); if (ret != KErrNone) return ret; else if (iFlow) { SetRemoteAddr(aDst); SetLocalAddr(aSrc); SetIcmpType(aIcmpType, aIcmpCode); iFlow->Connect(); return iFlow->iStatus; } else return KErrBadHandle; }
//################################################################################################################################ //-------------------------------------------------------------------------------------------------------------------------------- //函数名称:CLevel21_Sure() //-------------------------------------------------------------------------------------------------------------------------------- //函数功能:确认键的第3层任务 //-------------------------------------------------------------------------------------------------------------------------------- //输入参数: tmp为第几个按键的值 //-------------------------------------------------------------------------------------------------------------------------------- //输出参数: null //-------------------------------------------------------------------------------------------------------------------------------- //说 明: //-------------------------------------------------------------------------------------------------------------------------------- //################################################################################################################################ void CLevel3_Sure(uint8 tmp)//具体设置层 { uint8 row,i,j=1; uint8 delflag=1; uint8 hz[]="请按确定删除完成"; // uint8 vAnnRow; if((GetCounter1() == 1)&&(GetCounter2()== 1))//本机设置 { if((100*GetLocalAddr(0)+10*GetLocalAddr(1)+GetLocalAddr(2))>CIRCOUNT) { SetLocalAddr(0,0); SetLocalAddr(1,0); SetLocalAddr(2,0); } //存储到flash SendToArray(0,(100*GetLocalAddr(0)+10*GetLocalAddr(1)+GetLocalAddr(2))); SendToArray(1,GetLocalDepSum()); // CheckFalshData(); ClearScreen(0); Local_Menu(GetLocalAddr(0),GetLocalAddr(1),GetLocalAddr(2),GetLocalDepSum(),GetLocalParaSel(),1); SendDataToFlash(); } else if((GetCounter1() == 1)&&(GetCounter2()== 2))//部件注册 { //发送到部件 SetDepCompSum(GetCompRegDep(),GetCompRegNum());//单个防区的部件总数 ClearScreen(0); SetComRegFlag(1); CompReg_menu(GetCompRegDep(),GetCompRegNum(),0,GetCompRegAddr(),GetCompRegParaSel(),1); // CompReg_menu(GetCompRegDep(),GetCompRegNum(),0,GetCompRegDep(),GetCompRegParaSel(),1); if(GetSendToF(2)>=0xff) SendToArray(2,0); if(GetSendToF(2)<GetCompRegAddr()) SendToArray(2,GetCompRegAddr()); // SendDataToFlash(); // CheckFalshData(); } else if((GetCounter1() == 1)&&(GetCounter2()== 3))//部件设置 { row = GetRow(GetCompSetDep(),GetCompSetNum()); SetConvertdata(0,GetPSNFormFlash(row,0));//psn0 SetConvertdata(1,GetPSNFormFlash(row,1));//psn1 SetConvertdata(2,GetPSNFormFlash(row,2));//psn2 SetConvertdata(3,GetPSNFormFlash(row,3));//psn3 //GetPSNFormFlash(row,7);//注册地址 switch(GetComSetSelSet()) { case 0:// 0x 34 启用 CMD_BOOT for(i=0;i<MASKSUM;i++) { if(row==vMaskPSN[i]) vMaskPSN[i] = 0xff; } break; case 1://0x 30 消音 SetConvertdata(4,0x30); SetConvertdata(5,0); UartCom(CMD_CONTROL,9); break; // case 2://0x 35 复位 // SetConvertdata(4,0x35); // SetConvertdata(5,0); // UartCom(CMD_CONTROL,9); // break; case 2://0x 33 屏蔽 for(i=0;i<MASKSUM;i++) { if(row==vMaskPSN[i]) { vmaskflag=0; break; } else vmaskflag=1; } if(vmaskflag) { if(vMaskCount<MASKSUM) vMaskPSN[vMaskCount++]=1; if(vMaskCount==MASKSUM) vMaskCount = 0; SaveMaskPSN(); } break; case 3://删除 while(FIO0PIN&(1 << 10)) { if(j==1) { ClearScreen(0); j=0; } DisplayJBHZK(1,2,16,((hz[0]<<8)+hz[1])); DisplayJBHZK(1,2,32,((hz[2]<<8)+hz[3])); DisplayJBHZK(1,2,48,((hz[4]<<8)+hz[5])); DisplayJBHZK(2,2,0,((hz[6]<<8)+hz[7])); DisplayJBHZK(2,2,16,((hz[8]<<8)+hz[9])); DisplayJBHZK(2,2,32,((hz[10]<<8)+hz[11])); if(!(FIO0PIN&(1 << 25))) { delflag=0; j=1; break; } } if(delflag==1) { if((GetSendToF(14)>0)&&(GetSendToF(14)<0xff)) SendToArray(14,(GetSendToF(14)-1)); SendToArray((14+GetPSNFormFlash(row,7)),0xff); CAmendPSNToFlash(row,0xff); CSendPSNToFlash(); // if(j==1) // { // ClearScreen(0); // j=0; // } // DisplayJBHZK(1,2,32,((hz[8]<<8)+hz[9])); // DisplayJBHZK(1,2,48,((hz[10]<<8)+hz[11])); // DisplayJBHZK(2,2,0,((hz[12]<<8)+hz[13])); // DisplayJBHZK(2,2,16,((hz[14]<<8)+hz[15])); } break; default:break; } SetDatatoFlash(row,2,GetComSetSelSet()); ClearScreen(0); CompSet_Menu(GetCompSetDep(),GetCompSetNum(),GetComSetSelSet(),GetComSetSel(),1); } else if((GetCounter1() == 1)&&(GetCounter2()== 4))//时间 { PCF8563_Set(&timedate); ClearScreen(0); DateMod_Menu(GetYear(),GetMonth(),GetDay(),GetHour(),GetMintue(),GetSecond(),GetSelTime(),1); } else if((GetCounter1() == 1)&&(GetCounter2()== 5))//注释 { // row=GetAnnRow(GetAnnDep(),GetAnnCompNum()); // ClearScreen(0); // Annotate_Menu(GetAnnDep(),GetAnnCompNum(),GetAnnSel()); } else if((GetCounter1() == 2)&&(GetCounter2()== 1)) { SetLocalDepSum(GetSendToF(1)); if(GetLocalDepSum()>DEPART) SetLocalDepSum(0); if(GetSysCheckDep()>GetLocalDepSum()) SetSysCheckDep(0); ClearScreen(0); SysCheck_Menu(GetLocalDepSum(),GetCompSum(),GetSysCheckDep(),1); // SysCheck_Menu(GetLocalDepSum(),GetSumRegNum(),GetSysCheckDep(),1); } else if((GetCounter1() == 2)&&(GetCounter2()== 2)) { if(CheckDepComp(GetStatusDep(),GetStatusComp())) { row = GetRow(GetStatusDep(),GetStatusComp()); // vAnnRow = GetAnnRow(GetPSNFormFlash(row,4),GetPSNFormFlash(row,5)); ClearScreen(0); CompStat_Menu(GetStatusDep(),GetStatusComp(),GetPSNFormFlash(row,6),GetDatatoFlash(row,3),(GetPSNFormFlash(row,7)+GetSendToF(0)-1),GetStatusFlag()); } } else if((GetCounter1() == 2)&&(GetCounter2()== 3)) { } else if((GetCounter1() == 3)&&(GetCounter2()== 1))//自检 { } else if((GetCounter1() == 3)&&(GetCounter2()== 2))//信号强度 { CompInten_Menu(GetIntenDep(),GetIntenComp(),0,0); } else if((GetCounter1() == 7)&&(GetCounter2()== 1))//信号强度 { // CLevel27_Sure(); } }
//################################################################################################################################ //-------------------------------------------------------------------------------------------------------------------------------- //函数名称:CLevel21_Sure() //-------------------------------------------------------------------------------------------------------------------------------- //函数功能:确认键的第二层第一个任务 //-------------------------------------------------------------------------------------------------------------------------------- //输入参数: tmp为第几个按键的值 //-------------------------------------------------------------------------------------------------------------------------------- //输出参数: null //-------------------------------------------------------------------------------------------------------------------------------- //说 明: //-------------------------------------------------------------------------------------------------------------------------------- //################################################################################################################################ void CLevel21_Sure(uint8 tmp) { // uint8 j; PCF8563_DATE timeAndDate; switch(tmp) { case 1: ClearScreen(0); SetLocalAddr(0,(GetSendToF(0)/100)); SetLocalAddr(1,(GetSendToF(0)%100/10)); SetLocalAddr(2,(GetSendToF(0)%10)); SetLocalDepSum(GetSendToF(1)); if((100*GetLocalAddr(0)+10*GetLocalAddr(1)+GetLocalAddr(2))>CIRCOUNT) { SetLocalAddr(0,0); SetLocalAddr(1,0); SetLocalAddr(2,0); } if(GetLocalDepSum()>DEPART) SetLocalDepSum(0); Local_Menu(GetLocalAddr(0),GetLocalAddr(1),GetLocalAddr(2),GetLocalDepSum(),1,0); break; case 2: ClearScreen(0); // SetCompRegDep(SSP1_Read_1Byte(2)); // SetCompRegAddr(SSP1_Read_1Byte(13)); // GetRegNum(GetCompRegDep()); if(GetCompRegDep()>DEPART) SetCompRegDep(0); if(GetCompRegNum()>DEPARTCOM) SetCompRegDep(0); if(GetCompRegAddr()>CIRADDRESS) SetCompRegAddr(0); CompReg_menu(GetCompRegDep(),GetCompRegNum(),0,GetCompRegAddr(),1,0); // CompReg_menu(GetCompRegDep(),GetCompRegNum(),0,GetCompRegDep(),1,0); SetComRegFlag(1); NVIC_DisableIRQ(EINT3_IRQn); break; case 3: ClearScreen(0); CompSet_Menu(GetCompSetDep(),GetCompSetNum(),GetComSetSelSet(),1,0); break; case 4: PCF8563_Read(&timeAndDate); SetYear(timeAndDate.year); SetMonth(timeAndDate.month); SetDay(timeAndDate.day); SetHour(timeAndDate.hour); SetMintue(timeAndDate.minute); SetSecond(timeAndDate.second); ClearScreen(0); DateMod_Menu(GetYear(),GetMonth(),GetDay(),GetHour(),GetMintue(),GetSecond(),1,0); break; // case 5: // ClearScreen(0); // Annotate_Menu(GetAnnDep(),GetAnnCompNum(),1); // SetAnnUartFlag(1); // break; case 5: ClearScreen(0); Waiting_menu(); EndInt(); SendDataToFlash(); CSendPSNToFlash(); SaveMaskPSN(); CSaveAnn(); StartInt(); ClearScreen(0); CSaveInfo(); break; // case 7: // // break; default:break; } }