def send_apdu(apdu)
    	cmd = apdu
    	cmd.force_encoding('ASCII-8BIT')
			command_buffer = FFI::MemoryPointer.new(:uint8, cmd.length)
			command_buffer.write_string_length(cmd, cmd.length)

			response_buffer = FFI::MemoryPointer.new(:uint8, 254)

			res_len = LibNFC.nfc_initiator_transceive_bytes(@reader.ptr,
				command_buffer, cmd.length, response_buffer, 254, 0)

			raise IsoDep::Error, "APDU sending failed: #{res_len}" if res_len < 0

			APDU::Response.new(response_buffer.get_bytes(0, res_len).to_s)
    end
def send_apdu(apdu)
    	cmd = apdu
    	cmd.force_encoding('ASCII-8BIT')
			command_buffer = FFI::MemoryPointer.new(:uint8, cmd.length)
			command_buffer.write_string_length(cmd, cmd.length)

			response_buffer = FFI::MemoryPointer.new(:uint8, 254)

			res_len = LibNFC.nfc_initiator_transceive_bytes(@reader.ptr,
				command_buffer, cmd.length, response_buffer, 254, 0)

			raise IsoDep::Error, "APDU sending failed: #{res_len}" if res_len < 0

			APDU::Response.new(response_buffer.get_bytes(0, res_len).to_s)
    end
Public: Send APDU command to tag

 apdu	-	APDU command to send. see ISO/IEC 7816-4 or wiki for details.
 				APDU is a binary string that should


 Returns APDU::Response object
 Raises IsoDep::Error if card didn't respond