+bool test(){\r
+\r
+ if ( !DemodBufferLen) \r
+ return false;\r
+ \r
+ uint8_t si = 1;\r
+ uint8_t safer = PackBits(si, 4, DemodBuffer); si += 4; \r
+ uint8_t resv = PackBits(si, 7, DemodBuffer); si += 7+3;\r
+ uint8_t extend = PackBits(si, 1, DemodBuffer); si += 1;\r
+\r
+ //PrintAndLog("test: %X %X %X ", safer, resv, extend);\r
+ \r
+ // 2nibble must be zeroed.\r
+ if ( resv > 0x00) return FALSE;\r
+\r
+ if ( safer == 0x6 || safer == 0x9){\r
+ if ( extend == 0x00)\r
+ return TRUE;\r
+ }\r
+ if ( resv== 0x00) return TRUE;\r
+ return FALSE;\r
+}\r