204
W&T Expanded services of the Com-Server
typedef struct _PORT_DESCRIPT // ( 10 byte )
{ union
{ unsigned int wState;
struct _new_type
{ unsigned char port_type;//0x01 = serial port (serial CPU port)
//0x02 = Serial port (UART port)
//0x03 = reserved
//0x04 = Digital E/A
//0x05 = reserved
//0x06 = W&T Dual Port RAM
unsigned char state; //0=free, 1=connect, 2=waits
};
};
unsigned int mode; //0x0001 = TCP client
//0x0002 = TELNET client
//0x0003 = FTP client
//0x0004 = Box2Box client (active)
//0x0005 = UDP Send/ReceiveMode
//0x0006 = MULTI PORT (DPRAM, SERIAL PROT.)
// 0x0007 = SNMP agent
// 0x0008 = Box2Box server (passive)
// 0x0010 = SLIP router
// 0x0020 = PPP router (in preparation)
// 0x0030 = Box2Box bus system: Slave box
// 0x0040 = Box2Box bus system: Master box
unsigned long remote_IP; // if state == CONNECT, else 0
unsigned int remote_port; // if state == CONNECT, else 0
}PORT_DESCRIPT;
typedef struct _WT_INTERN3 // ** all parameters in Hostorder/Low Byte First **
{ BOX_VERSION bv; // Port = UDP_BOX_INFO_8513
BOX_DESCRIPT bd;
PORT_DESCRIPT pd[ACT_PROCESS];
} WT_INTERN3;
#pragma pack()
1
All variables of types Integer and Long are mapped
in host order, i.e. the low-value bytes come first. The IP
address 172.17.2.3 appears for example in byte order 3, 2,
17, 172.
UDP packets are connectionless and unsecure datagrams. Es-
pecially when using broadcasts the Com-Server‘s own request
as well as reply packet can get lost. To reliably ascertain all
the Com-Servers installed in a subnet you should therefore
repeat the broadcase if necessary.