Bachelorthesis/Modbus/include/ModbusUdpClientCommon.cin

34 lines
618 B
Text
Raw Normal View History

/*@!Encoding:1252*/
includes
{
#include "UdpCommon.cin"
2014-05-09 15:39:16 +02:00
#include "ModbusClientCommon.cin"
}
void ModbusConnectTo(char Remote_IP[], word Remote_Port)
{
UdpConnectTo("192.168.1.3", 502);
}
void ModbusSend(byte buffer[])
{
UdpSnd(buffer, elCount(buffer));
}
void ModbusSend(byte buffer[], word length)
{
UdpSnd(buffer, length);
}
void ModbusRecv()
{
UdpRecv();
}
void OnUdpReceiveFrom(dword socket, long result, dword address, dword port, byte buffer[], dword size)
{
OnModbusReceive(socket, result, address, port, buffer, size);
if (result == 0 && size != 0)
UdpRecv();
}