Sending UDP Datagrams to and from a Cobox, Xport, or WiPort
The Cobox Micro can send and receive UDP packets. I haven’t written examples yet. Following are just my notes, from discussions on the Lantronix Xport Yahoo mailing list, and from experimentation.
To send directed UDP packets, you have to put set the connectMode appropriately. Bits 2 and 3 of the ConnectMode register are set to 1 to enable directed UDP. Setting the ConnectMode to 0xCC (hex) will set the Cobox to accept any incoming UDP packets and allow you send UDP packets to the address and port number you set for the remote IP address. Once you’ve set the ConnectMode to 0xCC, set the Datagram Type to 01. With these settings, your cobox will only send to the remote IP specified in your configuration.
It is possible to change the destination address on the fly. It’s undocumented, but the Lantronix folks on the list have been helpful in figuring it out. First, you have to set the ConnectMode to CC and the Datagram type to 00. In this configuration, you have to compose your own outgoing datagrams, as follows:
Continue Reading »