+ // lets start. 12bytes of data to be produced.
+ uint8_t rawbytes[12];
+ memset(rawbytes, 0x00, sizeof(rawbytes));
+
+ // xor key
+ rawbytes[0] = xorKey;
+
+ // add format length (decimal)
+ // len | hex | bin
+ // 26 | 1A | 0001 1010
+ rawbytes[1] = (26 << 2);
+ // 36 | 24 | 0010 0100
+ //rawbytes[1] = (36 << 2);
+ // 40 | 28 | 0010 1000
+ //rawbytes[1] = (40 << 2);
+
+ // 2bit checksum, unknown today,
+ // these two bits are the last ones of rawbyte[1], hence the LSHIFT above.
+ rawbytes[2] = 1;
+ rawbytes[3] = 0;
+
+ // add wiegand to rawbytes
+ for (i = 0; i < 4; ++i)
+ rawbytes[i+4] = bytebits_to_byte( pre + (i*8), 8);
+
+ if (g_debugMode) printf(" WIE | %s\n", sprint_hex(rawbytes, sizeof(rawbytes)));