Specifications

*/
NutRegisterDevice(&devEth0, 0x8300, 5);
/*
* Configure lan interface.
*
*/
NutNetIfConfig("eth0", mac, inet_addr("192.168.0.100"), inet_addr("255.255.255.0"));
for(;;) {
/*
* Create the three sockets.
*/
sock = NutTcpCreateSocket();
command_sock = NutTcpCreateSocket();
playlist_sock = NutTcpCreateSocket();
/*
* Listen for connections on ports
* 12345, 12222, 11111. If we return,
* we got the server.
*/
print_screen("Waiting for Server");
NutTcpAccept(sock, 12345);
NutTcpAccept(command_sock, 12222);
NutTcpAccept(playlist_sock, 11111);
/* Start the command thread with stack of 200 */
NutThreadCreate("command", Command, NULL, 200);
print_screen("Server Ready");
/*
* Change this main thread priority to be slightly less
* the default. The default is 60.
*/
NutThreadSetPriority(60);
/* main loop */
while(1){
/* Receive the MP3 data from the server */
bytes = NutTcpReceive(sock, wr_ptr, 1500);
/*
* When discard is set whatever is recieved from the
* server will be discarded until "GAP" is recieved
*
*/
if (discard){
buffer_count = bytes;
buffer_shuffle = 0;
while(buffer_count > 0){
if(*(wr_ptr + buffer_shuffle) == 'G'){
if(*(wr_ptr + buffer_shuffle + 1) == 'A'){
if(*(wr_ptr + buffer_shuffle + 2) == 'P'){
77