NanoService Device Library Hello World Ported to K64F
Dependencies: EthernetInterface mbed-rtos mbed nsdl_lib
Fork of NSDL_HelloWorld by
Diff: resources/relay.cpp
- Revision:
- 9:16f54efbb5fe
- Parent:
- 2:7e489126fe7a
--- a/resources/relay.cpp Mon Aug 04 17:00:58 2014 +0000 +++ b/resources/relay.cpp Mon Feb 29 05:09:16 2016 +0000 @@ -3,12 +3,11 @@ #include "mbed.h" #include "nsdl_support.h" #include "relay.h" -#include "Beep.h" +//#include "Beep.h" #define RELAY_RES_ID "beep/0/on" extern Serial pc; -static Beep buzzer(p26); /* Only GET and PUT method allowed */ static uint8_t relay_resource_cb(sn_coap_hdr_s *received_coap_ptr, sn_nsdl_addr_s *address, sn_proto_info_s * proto) @@ -32,13 +31,13 @@ { if(*(received_coap_ptr->payload_ptr) == '1') { - buzzer.beep(1000,0); + // replace with blink buzzer.beep(1000,0); relay_state = '1'; } else if(*(received_coap_ptr->payload_ptr) == '0') { - buzzer.nobeep(); + // buzzer.nobeep(); relay_state = '0'; } coap_res_ptr = sn_coap_build_response(received_coap_ptr, COAP_MSG_CODE_RESPONSE_CHANGED);