Ciao a tutti!
Sto facendo qualche test con la libreria in oggetto, partendo da questo articolo:
L'esempio contenuto nella libreria (http://maniacbug.github.com/RF24Network/meshping_8pde-example.html) mi funziona correttamente. Certo, molti passaggi non mi sono molto chiari, ma imparerò.
Ho un problema però con la direttiva:
network.write(header,&message,sizeof(unsigned long));
Il reference class () riporta:
bool RF24Network::write ( RF24NetworkHeader & header,
const void * message,
size_t len
)
Send a message.
Parameters:
[in,out] header The header (envelope) of this message. The critical thing to fill in is the to_node field so we know where to send the message. It is then updated with the details of the actual header sent.
message Pointer to memory where the message is located
len The size of the message
Returns:
Whether the message was successfully received
Io vorrei mandare una stringa invece di un numero, ma provando così non funziona:
myString = "CIAOCIAO";
printf_P(PSTR("Stringa %s\n\r"), myString);
return network.write(header,&myString,sizeof(myString));
Sulla seriale ottengo:
6000: APP Sending 6000 to 00...
Stringa CIAOCIAO
6003: APP Send ok
6006: APP Received 256 from 00
Immagino che il "256" sia un return_code. Se invio un int con un qualche numero, funziona, ma vorrei mandare una stringa
Mi sapete aiutare?