Proof of concept for distance and temperature monitoring
Dependencies: mbed mbedConnectorInterface mbedEndpointNetwork
Revision 4:1ca75e77ae33, committed 2015-05-02
- Comitter:
- coyotebush
- Date:
- Sat May 02 01:36:41 2015 +0000
- Parent:
- 3:b51fcb5fd114
- Child:
- 5:069c0a1f1080
- Commit message:
- cleanup
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat May 02 01:10:55 2015 +0000 +++ b/main.cpp Sat May 02 01:36:41 2015 +0000 @@ -9,13 +9,6 @@ #include "StaticResource.h" -/* CoAP/NSP */ -uint8_t my_nsp_address[NSP_IP_ADDRESS_LENGTH] = {54, 191, 98, 247}; -int my_nsp_coap_port = 5683; -#define MY_NSP_DOMAIN "trash" -#define MY_ENDPOINT_NAME "trashcan" -EthernetInterface ethernet; - /* Terminal connection */ RawSerial term(USBTX, USBRX); Logger logger(&term); @@ -32,7 +25,7 @@ StaticResource model(&logger, "3/0/1", "K64F mbed Ethernet demo"); /* -DistanceResource distS(&logger, "3302/0/5600", distS); +DistanceResource distR(&logger, "3302/0/5600", distS); TemperatureResource tempR(&logger, "3303/0/5700", tempS); */ LEDResource led(&logger, "3311/1/5706"); @@ -40,6 +33,7 @@ /* invoked through linker magic via Endpoint::start() */ Connector::Options *configure_endpoint(Connector::OptionsBuilder &config) { + /* NSP configuration is in nsp_configuration.h */ logger.log("configure_endpoint: building endpoint configuration..."); return config.addResource(&mfg) .addResource(&model) @@ -56,6 +50,7 @@ logger.log("\r\n\r\nSmart Trash Can booting\r\n"); Connector::Endpoint::plumbNetwork(); Connector::Endpoint::start(); + // actually, we never reach here because the Endpoint takes over while (1) { temperature = tempS.getTemp() * 3.0 / 5.0;