Basic Examples

Top  Previous  Next

Except for Remote_loopback, all examples assume a  network where the DSP has IP address “192.168.0.2” and the PC “192.168.0.1”. You can adjust the constants myIP, netmask, gateway, and destination if you need a different network configuration.

 

UDP Examples

 

Simple_send tests basic UDP communications from the DSP to the PC.

Dragons003You must start the PC receiver first.

When the sender is started and the connection has been established, the sender will transmit several messages to the receiver. Both sender and receiver display the messages on the console.

 

Simple_receive  tests UDP communications in the other direction.

Dragons003Once again, the receiver, this time on the DSP, must be started first.

 

TCP Examples

 

Simple_server makes the DSP a server that exchanges data with a PC client.

 

Simple_client makes the DSP a client that exchanges data with a PC server.

 

Remote_loopback tests communication with a computer located outside your local network. The example connects to our server and sends few kilobytes of data to it. The server is programmed to invert data and send it back to the client. The client receives the data, checks if they are correct and reports status on the screen.

 

Dragons003You will have to change the IP address of your gateway to run Remote_loopback. No other parameters should need to be changed.