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.
Diff: master.cpp
- Revision:
- 63:74df96c098e4
- Parent:
- 60:b419ea9472de
--- a/master.cpp Mon Jan 23 10:52:18 2017 +0100
+++ b/master.cpp Mon Jan 23 11:03:47 2017 +0100
@@ -45,7 +45,7 @@
std::string output = str_hex(rxData, rx_bytes);
//wifi.printf("received: %s\r\n", output.c_str());
- pc.printf("received: %s\r\n", output.c_str());
+ //pc.printf("received: %s\r\n", output.c_str());
Data d;
d.deserialize(std::string(rxData, 32));
std::stringstream ss;
@@ -53,7 +53,7 @@
for (int i = 0; i < rx_bytes; ++i) {
ss << std::hex << rxData[i] / 16 << rxData[i] % 16; // ugly!
}
- pc.printf("received: %s|id %d \r\n", ss.str().c_str(), d.type);
+ pc.printf("received: %s|id %d |", ss.str().c_str(), d.type);
//wifi.printf("received: %s, pkt:", ss.str().c_str());
char uribuf[64] = {0};
@@ -73,10 +73,11 @@
psize = sprintf(pbuf, "%f", d.value.f);
break;
case SOUND:
- strcpy(uribuf, "sound");
+ strcpy(uribuf, "volume");
psize = sprintf(pbuf, "%f", d.value.f);
break;
}
+ printf("URI %s V %s \r\n", uribuf, pbuf);
pdu.setURI(uribuf,strlen(uribuf));
pdu.setPayload((uint8_t*)pbuf, psize);