itam !!
Wysyłam FTP (soced) bytes2send = bytes(str(E_Value) + '\0', 'ascii')
Teraz po Lan chcę to odczytać w Arduino+ W5100
Łącze się z serwerem, serwer odczytuje liczby zamiast wysłanego ciągu
Jak zmodyfikować program żeby poprawnie odczytać ciąg wysyłany ?
Coś słyszałem o reinterpret_cast ale nie wiem jak użyć
Dziękuję za pomoc[/i][/i][/i][/i][/i][/i]
Wysyłam FTP (soced) bytes2send = bytes(str(E_Value) + '\0', 'ascii')
Teraz po Lan chcę to odczytać w Arduino+ W5100
Łącze się z serwerem, serwer odczytuje liczby zamiast wysłanego ciągu
void loop() {
// check for any new client connecting, and say hello (before any incoming data)
EthernetClient newClient = server.accept();
if (newClient) {
for (byte i=0; i < 8; i++) {
if (!clients[i]) {
Serial.print("We have a new client #");
Serial.println(i);
newClient.print("Robo_FTP, client number: ");
newClient.println(i);
// Once we "accept", the client is no longer tracked by EthernetServer
// so we must store it into our list of clients
clients[i] = newClient;
break;
}
}
}
// check for incoming data from all clients
for (byte i=0; i < 8; i++) {
if (clients[i] && clients[i].available() > 0) {
// Odczyt !! read bytes from a client
byte buffer[1024];
//int count = clients[i].read(buffer,1024);
int count = clients[i].read() == '\n';
Serial.println(count);
//delay(1000);
// write the bytes to all other connected clients
for (byte j=0; j < 8; j++) {
if (j != i && clients[j].connected()) {
clients[j].write(buffer, count);
}
}
}
}
Jak zmodyfikować program żeby poprawnie odczytać ciąg wysyłany ?
Coś słyszałem o reinterpret_cast ale nie wiem jak użyć
Dziękuję za pomoc[/i][/i][/i][/i][/i][/i]