1、获取主站报文公共地址
int inCa = CS101_ASDU_getCA(asdu);
2、主动关闭主站链接
IMasterConnection_close(connection);
3、回复主站确认
IMasterConnection_sendACT_CON(connection, asdu, false);
4、短浮点数上报
CS101_ASDU newAsdu = CS101_ASDU_create(alParams, true, CS101_COT_SPONTANEOUS, 0, ca, false, false);
InformationObject io = (InformationObject)MeasuredValueShort_create(NULL, laddr, uploadValue, IEC60870_QUALITY_GOOD);
CS101_ASDU_addInformationObject(newAsdu, io);
InformationObject_destroy(io);
CS104_Slave_enqueueASDU(slave, newAsdu);
CS101_ASDU_destroy(newAsdu);
5、单点信息上报
CS101_ASDU newAsdu = CS101_ASDU_create(alParams, true, CS101_COT_SPONTANEOUS, 0, ca, false, false);
InformationObject io = (InformationObject)SinglePointInformation_create(NULL, laddr, uploadValue, IEC60870_QUALITY_GOOD);
CS101_ASDU_addInformationObject(newAsdu, io);
InformationObject_destroy(io);
CS104_Slave_enqueueASDU(slave, newAsdu);
CS101_ASDU_destroy(newAsdu);
lastUpLoadYXValMap[devNo][name] = itor->val;