+int CmdIceManchester(const char *Cmd){\r
+ ManchesterDemod( -1);\r
+ return 0;\r
+}\r
+int ManchesterDemod(int blockNum){\r
+\r
+ if (!HasGraphData()) return 0;\r
+ \r
+ uint8_t sizebyte = 32;\r
+ // the value 5 was selected during empirical studies of the decoded data. Some signal noise to skip.\r
+ uint8_t offset = 5;\r
+ uint32_t blockData;\r
+ uint8_t bits[LF_BITSSTREAM_LEN] = {0x00};\r
+ uint8_t * bitstream = bits;\r
+ \r
+ manchester_decode(GraphBuffer, LF_TRACE_BUFF_SIZE, bitstream, LF_BITSSTREAM_LEN); \r
+ blockData = PackBits(offset, sizebyte, bitstream);\r
+\r
+ if ( blockNum < 0)\r
+ PrintAndLog(" Decoded : 0x%08X %s", blockData, sprint_bin(bitstream+offset,sizebyte) );\r
+ else\r
+ PrintAndLog(" Block %d : 0x%08X %s", blockNum, blockData, sprint_bin(bitstream+offset,sizebyte) );\r
+ \r
+ return 0;\r
+} \r