Good Nigth all,
I am developing a project with the ARDUINO UNO R3 together CuHead Wifi Shield V2. I am having difficulty to how to use the correct functions to read datas via Socket Application from my Mobile Android App. I have been successfully run the exemplo code SocketApp.h downloaded together WiShield Library following this link -> https://github.com/l...BasedWiFiShield
. But I don`t know how to manipulate the functions inside the psock.h file. I believe that I have to use the PSOCK_READBUF() function, but I need help to use it.
In practice I need that the Arduino implements this simply function: After received the data, string data, from my Android SocketApp, it can uses a IF condition, IF(Data) make do (Liga Led) . So, I need to know manipulate any function to read this data.
Please anybody can help me? If possible please send me a exemplo code to manipulate this function or bufer
Remark: After downloaded the WiShield Library that above link, it is necessary to unzip library inside the ARDUINO Libraries folder created at the time of installation ARDUINO. Exemplo: C:\Program Files (x86)\Arduino\libraries and after this you can open socket exemplo code in ARDUINO IDE as bellow:
Click in File>Exemples>WishieldLibrarie>SocketApp
Following below the part code that handle connection in SocketApp exemplo code.
All socket functions is inside the psock.h file.
static int handle_connection(struct socket_app_state *s)
PSOCK_SEND_STR(&s->p, "Hello. What is you name?\n");
PSOCK_SEND_STR(&s->p, "Hello ");
memset(s->inputbuffer, 0x00, sizeof(s->inputbuffer));