bool transmit_bits(const uint8_t *pbtTx, const size_t szTxBits) { // Transmit the bit frame command, we don't use the arbitrary parity feature if ((szRxBits = nfc_initiator_transceive_bits(device, pbtTx, szTxBits, NULL, abtRx, sizeof(abtRx), NULL)) < 0) return false; return true; }
static bool transmit_bits(const uint8_t *pbtTx, const size_t szTxBits) { // Show transmitted command printf("Sent bits: "); print_hex_bits(pbtTx, szTxBits); // Transmit the bit frame command, we don't use the arbitrary parity feature if ((szRxBits = nfc_initiator_transceive_bits(pnd, pbtTx, szTxBits, NULL, abtRx, sizeof(abtRx), NULL)) < 0) return false; // Show received answer printf("Received bits: "); print_hex_bits(abtRx, szRxBits); // Succesful transfer return true; }
std::vector<uint8_t> NFCReaderUnit::transmitBits(const uint8_t *pbtTx, const size_t szTxBits) { const int MAX_FRAME_LEN = 264; uint8_t abtRx[MAX_FRAME_LEN]; int szRxBits; // Transmit the bit frame command, we don't use the arbitrary parity feature if ((szRxBits = nfc_initiator_transceive_bits(d_device, pbtTx, szTxBits, NULL, abtRx, sizeof(abtRx), NULL)) < 0) { LOG(ERRORS) << "NFC write bits error: " << std::string(nfc_strerror(d_device)); // THROW_EXCEPTION_WITH_LOG(LibLogicalAccessException, // "Writing bits to NFC reader failed: " + std::string(nfc_strerror(d_device))); return {}; } return std::vector<uint8_t>(std::begin(abtRx), std::begin(abtRx) + szRxBits / 8 + 1); }
static bool transmit_bits (const byte_t * pbtTx, const size_t szTxBits) { // Show transmitted command if (!quiet_output) { printf ("Sent bits: "); print_hex_bits (pbtTx, szTxBits); } // Transmit the bit frame command, we don't use the arbitrary parity feature if (!nfc_initiator_transceive_bits (pnd, pbtTx, szTxBits, NULL, abtRx, &szRxBits, NULL)) return false; // Show received answer if (!quiet_output) { printf ("Received bits: "); print_hex_bits (abtRx, szRxBits); } // Succesful transfer return true; }
bool transmit_bits(const uint8_t *pbtTx, const size_t szTxBits) { //! Show transmitted command #ifdef DEBUG_PRINTF fprintf(stderr,"Sent bits: "); #endif print_hex_bits(pbtTx, szTxBits); //! Transmit the bit frame command, we don't use the arbitrary parity feature if ((szRxBits = nfc_initiator_transceive_bits(pnd, pbtTx, szTxBits, NULL, abtRx, sizeof(abtRx), NULL)) < 0) { return false; } //! Show received answer #ifdef DEBUG_PRINTF fprintf(stderr,"Received bits: "); #endif print_hex_bits(abtRx, szRxBits); //! Succesful transfer return true; }