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: MPU6050_SIM5320_TEST
Fork of MPU_SDCARD by
DeviceFull.cpp
00001 #include <DeviceEmpty.h> 00002 #include <DeviceFull.h> 00003 #include <CaseFsm.h> 00004 00005 00006 00007 DeviceFull::DeviceFull(CaseFsmStates& states, Timer& timer) : CaseState(states,timer) 00008 { 00009 } 00010 00011 CaseState* DeviceFull::handle(SwitchPosition& event) 00012 { 00013 printf("Odoh u DEVICE EMPTY STATE\r\n"); 00014 return states_.deviceEmptyState(); 00015 } 00016 00017 00018 00019 CaseState* DeviceFull::handle(RFIDEvent& event) 00020 { 00021 int count=0; 00022 uint8_t tag[]= {0xDB,0x6C,0x10,0x2B}; 00023 //printf("%d\r\n",event.cardType); 00024 for(int i=0; i<event.size; i++) { 00025 if(tag[i]==event.uid[i]) { 00026 // printf(" %x count=%d",event.uid[i], count); 00027 count++; 00028 } 00029 } 00030 00031 //printf(" count %d\r\n",count); 00032 00033 if(count==4) { //Je li to validan TAG 00034 printf("Odoh u PHONE DETECTED STATE\r\n"); 00035 00036 return states_.phoneDetectedState(); //TAG je validan idem u detected 00037 00038 } else { 00039 printf("Odoh u PHONE UNDETECTED STATE\r\n"); 00040 return states_.phoneUndetectedState(); //Ako nije idem u undetected 00041 00042 } 00043 } 00044 CaseState* DeviceFull::handle(TimerEnd& event) 00045 { 00046 printf("Odoh u DEVICE UNDETECTED STATE\r\n"); 00047 return states_.phoneUndetectedState(); 00048 } 00049 00050
Generated on Tue Jul 12 2022 19:25:17 by
1.7.2
