-// prepare the Mifare AUTH transfer with an added necessary delay.
-void PrepareDelayedAuthTransfer(uint8_t* frame, int len, uint16_t delay)
-{
- CodeIso14443aBitsAsReaderPar(frame, len*8, GetParity(frame,len));
-
- uint8_t bitmask = 0;
- uint8_t bits_to_shift = 0;
- uint8_t bits_shifted = 0;
-
- if (delay) {
- for (uint16_t i = 0; i < delay; i++) {
- bitmask |= (0x01 << i);
- }
- ToSend[++ToSendMax] = 0x00;
- for (uint16_t i = 0; i < ToSendMax; i++) {
- bits_to_shift = ToSend[i] & bitmask;
- ToSend[i] = ToSend[i] >> delay;
- ToSend[i] = ToSend[i] | (bits_shifted << (8 - delay));
- bits_shifted = bits_to_shift;
- }
- }
-}
-
-
-