File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -258,10 +258,18 @@ void CheckRFID(void) {
258258 if (OcppMode && RFIDReader == 6 ) { // Remote authorization via OCPP?
259259 // Use OCPP
260260 if (!RFIDstatus) {
261- if (RFID[0 ] == 0x01 ) {
262- ocppUpdateRfidReading (RFID + 1 , 6 ); // UID starts at RFID+1; Pad / truncate UID to 6-bytes for now
263- } else {
264- ocppUpdateRfidReading (RFID, 7 ); // UID starts at RFID; 7 byte UID
261+ if (RFID[0 ] == 0x01 ) { // old 6 byte reader
262+ if (RFID[5 ] == 0 && RFID[6 ] == 0 ) { // so we have 4 byte UID
263+ ocppUpdateRfidReading (RFID + 1 , 4 ); // UID starts at RFID+1; Pad / truncate UID to 4 bytes
264+ } else { // 7 byte UID
265+ ocppUpdateRfidReading (RFID + 1 , 6 ); // UID starts at RFID+1; Pad / truncate UID to 6 bytes for now since 7th byte is missing
266+ }
267+ } else { // new 7 byte reader
268+ if (RFID[4 ] == 0 && RFID[5 ] == 0 && RFID[6 ] == 0 ) { // so we have 4 byte UID
269+ ocppUpdateRfidReading (RFID, 4 ); // UID starts at RFID; 4 byte UID
270+ } else { // 7 byte UID
271+ ocppUpdateRfidReading (RFID, 7 ); // UID starts at RFID; 7 byte UID
272+ }
265273 }
266274 }
267275 RFIDstatus = 1 ;
You can’t perform that action at this time.
0 commit comments