Program for test the tcp/ip communication between mbed and Android phone

Dependencies:   EthernetInterface mbed-rtos mbed

Notebook page HERE

main.h

Committer:
edodm85
Date:
2016-07-20
Revision:
0:149b394928f3

File content as of revision 0:149b394928f3:

#pragma once 
#include "mbed.h"
#include "EthernetInterface.h"
#include "eth_status.h"


#define ECHO_SERVER_PORT   2000


bool new_send = false;
bool checketh = false;

DigitalOut led1(LED1);          // broken cable
DigitalOut led2(LED2);          // ARM is alive?
DigitalOut led3(LED3);          // 0 = established connection
DigitalOut led4(LED4);          // 


Serial pc(USBTX, USBRX);


//ETHERNET
char* ip = "192.168.153.153";             // ip
char* mask = "255.255.255.0";           // mask
char* gateway = "192.168.153.254";          // gateway
EthernetInterface eth;
TCPSocketConnection client;
TCPSocketServer server; 


//ETHERNET BUFFER
char bufferRX[20];
char bufferTX[4800];    

//RESET
extern "C" void mbed_reset();



//THREAD
void net_thread(void const *argument);
osThreadId tencid;
osThreadDef(net_thread, osPriorityNormal, DEFAULT_STACK_SIZE); 



//FUNCTION
void parse_cmd(int sizeCMD);