SENA Rhio232 User Manual

Page 62

Advertising
background image

62

RHIO_SockConnect

Description : Used when users want to connect to RHIO using TCP Socket connection.

Function Prototype :

extern "C" __declspec(dllexport) bool RHIO_SockConnect

(BYTE bAddr1, BYTE bAddr2, BYTE bAddr3, BYTE bAddr4, int iPort);

Parameter :

BYTE bAddr1 : 1st byte of the IP Address

BYTE bAddr2 : 2nd byte of the IP Address

BYTE bAddr3 : 3rd byte of the IP Address

BYTE bAddr4 : 4th byte of the IP Address

int iPort :

Port number.

Return : TRUE if successful, False if failed.

eg. :

if(RHIO_SockConnect(192, 168, 100, 2, 6001))

AfxMessageBox("Connection Successful");

else

AfxMessageBox("Connection Failure");

RHIO_CommConnect

Description : Used when users want to connect to RHIO using RS232 serial connection.

(Parameter fixed as Baudrate:9600 bps, Parity: none, Data bit: 8, Stop bit: 1)

Function Prototype :

extern "C" __declspec(dllexport) bool RHIO_CommConnect (int iPort);

Parameter : None

Return : TRUE if successful, False if failed.

eg. :

if(RHIO_CommConnect(1))

AfxMessageBox("Connection Successful.");

Else

AfxMessageBox("Connection Failure.");

Advertising