-->
Page 1 of 1

How to pass the(serverClients[i].read() to byte array on esp

PostPosted: Sun May 17, 2020 9:28 pm
by DarioG
In a sketch of arduino thre is example Wifi Telnet To Serial with esp8266 there is a piece of code that is used to receive data from a client:
Code: Select all //check clients for data
 for(i = 0; i < MAX_SRV_CLIENTS; i++){
   if (serverClients[i] && serverClients[i].connected()){
     if(serverClients[i].available()){
    //get data from the telnet client and push it to the UART
     while(serverClients[i].available())
        Serial.write(serverClients[i].read());
   }
  }
 }


This data is sent to the console or the serial port, but I need to capture that data and store it in a byte array:
Code: Select allbyte bufferMSGfromCliente[1024]


Someone can tell me how to do it?

Re: How to pass the(serverClients[i].read() to byte array on

PostPosted: Mon Apr 12, 2021 10:50 am
by John Travland
Hi, did you ever determine how to do this? I need to read data from a client into an 8 byte array and am having trouble.

Re: How to pass the(serverClients[i].read() to byte array on

PostPosted: Tue Apr 13, 2021 4:14 pm
by John Travland
Did you determine how to do this? I need to do the same thing.