Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface LM75B mbed-rtos mbed
Diff: Slave.cpp
- Revision:
- 8:556a5738c2fa
- Parent:
- 7:2de256f902c8
--- a/Slave.cpp Mon Mar 19 00:58:20 2018 +0000 +++ b/Slave.cpp Fri Mar 23 11:06:09 2018 +0000 @@ -24,14 +24,18 @@ while(1){ char buffer[MAX_BUFFER_SIZE] = {0}; - printf("\nWaiting for UDP packet...\n\r"); + printf("##########################\n\r"); + printf("# Waiting for master.... #\n\r"); + printf("# IP:%s #\n\r", ip); + printf("##########################\n\r\n"); int n = slave.receiveFrom(master, buffer, sizeof(buffer)); buffer[n] = '\0'; - printf("Received packet from: %s\n\r", master.get_address()); + printf("Received message from master with address: %s\n\r", master.get_address()); printf("Received: '%s'\r\n", buffer); actionSlave(buffer); + printf("Sending ACK: %s \n\r\n", answer); slave.sendTo(master, answer, MAX_BUFFER_SIZE); answerReset(); @@ -122,7 +126,6 @@ { answerAppend("ACK 4.0 "); answerAppend(id); - answerAppend(" Doet da eki nie, danke"); } } else