IEC104规约,客户端源代码
#include "cs104_connection.h"
#include "hal_time.h"
#include "hal_thread.h"
#include
#include
static void
connectionHandler (void* parameter, CS104_Connection connection, CS104_ConnectionEvent event)
{
switch (event) {
case CS104_CONNECTION_OPENED:
printf("Connection established\n");
break;
case CS104_CONNECTION_CLOSED:
printf("Connection closed\n");
break;
case CS104_CONNECTION_STARTDT_CON_RECEIVED:
printf("Received STARTDT_CON\n");
break;
case CS104_CONNECTION_STOPDT_CON_RECEIVED:
printf("Received STOPDT_CON\n");
break;
}
}
/*
* CS101_ASDUReceivedHandler implementation
*
* For CS104 the address parameter has to be ignored<