Monthly Archives: September 2004
Sending UDP Datagrams to and from a Cobox, Xport, or WiPort
In this configuration, you have to compose your own outgoing datagrams, as follows:From the serial side, you send: (Start of transmission byte)(Destination IP byte 1)(Destination IP byte 2)(Destination IP byte 3)(Destination IP byte 4)(Number of data bytes (a two-byte value))(data bytes, highest to lowest)For example, to send the string “1023″ to the address 192.168.0.20, you’d send the following into the serial port of the Cobox (these are the raw values of the bytes, in decimal form):2 192 168 0 20 0 4 49 48 50 51The device at 192.168.0.20 would receive the ASCII string “1023″.To send to a Cobox, you just send a datagram as you normally would…. For example, if you sent the string “AAAA” to the cobox, from IP address 192.168.0.30, then what you’d see out the serial port would look like this (again, these are the raw values of the bytes, in decimal form):2 192 168 0 30 0 4 65 65 65 65This means that in order to get the data in the packet, you have to discard the header.
Continue reading