![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Versão limpa em 04/09/2014. Telnet funcionando.
Dependencies: EthernetInterface mbed-rtos mbed NTPClient
Diff: Codes/EventDetector.cpp
- Revision:
- 2:628a25bb5d62
- Parent:
- 1:fe2d4530da1b
- Child:
- 29:fcfcb31a6362
--- a/Codes/EventDetector.cpp Fri Sep 12 13:08:14 2014 +0000 +++ b/Codes/EventDetector.cpp Fri Oct 17 19:17:52 2014 +0000 @@ -207,6 +207,7 @@ //void EventDetector::SendMessage(int ext,float rmsvalue) void EventDetector::SendMessage(int ext, float rmsvalue, float mv2, int under, int over, int duration) { + int flagrfid = 0; //printf("Chegou SendMessage\n"); //Here we must alloc a CaptureEvent object from mailbox pool, CaptureEvent* event = GetMailbox().alloc(); @@ -238,16 +239,19 @@ //send hitag request //capture hitag response //printf("OUTLET=%d\n",outlet_index+1); - - if(m_OutletTriggered){ - //Capture::ReadRFID(outlet_number+1,rfid); + + //Capture::ReadRFID(outlet_number+1,rfid); + if (Settings::get_ReadRfid()){ if (! Capture::ReadRFID(outlet_number+1,rfid) ){ // não leu tag RFID - printf("Entrou\n"); - strcpy(rfid, "1234560"); - rfid[7] = (char)outlet_number + '0'; + //printf("Entrou\n"); + flagrfid = 1; } - //printf("#%s#\n", rfid); - } + } + if (! flagrfid){ + strcpy(rfid, "1234560"); + rfid[7] = (char)outlet_number + '0'; + } + //printf("#%s#\n", rfid); if(Settings::get_Purpose(m_Channel) == 'p') // phase channel {