
SDK Programming Guide Version 1.511
ABLELink
R
Ethernet-Serial Server MAXI Series
return;
}
connect_f = _OK;
//----- request to receive data
tcp_receive( cb->handle, (unsigned char far *)recvbuf, sizeof(recvbuf), recv_post, 0l );
}
C.2 Serial port sample program
/*-------------------------------------------------------------------------------------------------------
This is a serial port sample program for s.
*This program do following things:
1. Open COM1: 9600,n,8,1
2. After COM1 is opened, echo a message:
"Hello, this is GW21 series".
3. After receiving data, it will prompt a message and echo the received data.
For example: Receiving a 'A', then it will echo the message:
"Receive data =A"
*You can use the 'terminal' utility to test this sample program
-------------------------------------------------------------------------------------------------------*/
#include "g21s3api.h"
#include "comapi.h"
//=============================================================
void main()
{
int i, com_port, cnt ;
int
ret;
char buf[ 256], *ptr ;
SetAPSerialNo( "COM sample program"); //set AP version
Copyright © 2004 Atop Technologies, Inc.
All rights reserved. Designed in Taiwan.