NEC Near Field Communication RF module library for mbed H001-000003-001 (950MHz), H001-000013-001 (920MHz), TY24FM-E2024 (2.4GHz)
Dependents: NECnfc_sample Drone_air Drone_ground
NEC Near Field Communication RF module library
NEC製の近距離無線モジュール用のライブラリです。
Diff: NECnfc_msg.cpp
- Revision:
- 5:e5a358e9ed94
- Parent:
- 4:07e752ff8dce
- Child:
- 6:2e1fc47e5bca
--- a/NECnfc_msg.cpp Tue Sep 15 06:17:57 2015 +0000 +++ b/NECnfc_msg.cpp Mon Oct 19 01:36:35 2015 +0000 @@ -12,19 +12,24 @@ #endif switch (_mode) { case MODE_READY: - _rxbuf[count] = c; switch (count) { case 0: - if (c == 0x0f) count ++; + if (c == 0x0f) { + _rxbuf[count] = c; + count ++; + _received = 0; + } break; case 1: if (c == 0x5a) { + _rxbuf[count] = c; count ++; } else { count = 0; } break; case 2: + _rxbuf[count] = c; count ++; len = (int)((unsigned char)c); _mode = MODE_DATA;