Is Plaintext offline PIN verification on EMV card by Micro USB OTG reader? - offline

I have n88 micro USB OTG EMV card Reader. I used below application to read card data
https://play.google.com/store/apps/details?id=sasc.android.smartcard
When I see in the log, plaintext offline PIN verification is not listed as rule in CVM list.
smart card app results
My question is if I try to verify PIN after "read record" phase, will the card accept verify command ? Till now I am getting command invalid response for verify command. So is plaintext PIN verification possible if there is no rule in CVM list ?

Actually you sholdn't perform verification metod which is not supported in CVM. But if you want force perform plaintext Verify command ( plaintext offline PIN verification ) the result will be depend of specific payment card. For example for Visa card you can always perform plaintext, but MasterCard may not allow plaintext in own application control bytes.
In your case, it seems card does not support Offline Pin at all.

You can send Verify PIN command immediately because after Read Record Commands there is no other command that need to be send to card. Terminal start to check "Processing restrictions" and then "Offline data authentication".
CVM is negotiated and chosen according to terminal and card parameters. If CVM list does not include PIN of course terminal will not ask PIN(or other methods such signature).
I did not see kernel code of a card but if you ask card to perform PIN of course card would check the possible CVM methods before performing. So we can say yes, CVM List must include PIN.

Related

Why does ReadFileEx on a USBPRINT device fail with ERROR_GEN_FAILURE?

When calling ReadFileEx on a handle to a USBPRINT device on Windows, it sometimes returns ERROR_GEN_FAILURE. This happens randomly and I can only get the device to respond again if I physically unplug the device and plug it back in.
Specifically, I am using a USB-to-Parallel adapter with a Prolific PL2305 chip connected to an Epson TM-U29P slip printer.
In my case, there is a grounding screw on the back of the TM-U295P that must be wired directly to ground. I initially ignored this because I figured the power supply was grounded and so was the USB adapter, but I guess I was wrong. Connecting a ground wire fixed the spurious I/O failures.

nanoKONTROL2 receive/send data RtMidi c++

Two Questions:
1) Is it possible to send a message to the device and receive all the current input values?
I am trying to receive and send data to the KORG nanoKONTROL2. I found an API for real-time input/output called RtMidi. Receiving data is no issue, but I don't have the state where the sliders and knobs are in when the application starts. I presume, if this could be done, you need to send a message to the device.
There is an RtMidiOut class with sendMessage functionality where you can send data (vector<uchar>) to the device, but I don't know what data to send (I did try with some for loops to see if anything happens, but no luck).
2) Is it possible to turn the button lights on/off? If so, how?
To clarify the second question; I am trying to create a toggle where the light of the button on the device will turn on/off according to the state of the toggle.
Additional Information: The received data exists of 3 unsigned char's where the first value is probably an id, I am not quite sure, the second is the button/slider id and the third is its value.
Source code link to GitHub.

Serial Port Flow Control

C++ / Windows API
When specifying hardware flow control for my rs232 port via SetCommState(), I know this asks the OS to attempt flow control with CTS/DSR signaling.
Does this configuration:
1) assume that the serial device at the other end of communications already supports CTS/DSR line flow control?
2) or expect me to somehow acquire the flow control capability of the connected serial device ?
This setting assumes that the other end is signalling CTS/DSR to your end. If this is not the case, no data will flow.
Or, if the pins are hard-wired at the other end, which is sometimes the case, it will have "no flow control, CTS/DSR is always in a state that allows data to be sent/received, whether the actual device is ready or not".
Of course, it's conceivable to have a device where the latter is configured as default, and you somehow send commands/information via the serial port to say "now make your CTS/DSR pins reflect whether you can send/recieve data".

How to Auto send SMS via Broadband USB dongle?

One of my internet connections is via a USB dongle. As well as accessing the internet I can use the SIM card contained inside to send SMS texts in the exact same fashion as a SIM card housed in my mobile phone. (I know, I really am a technical superhero...)
Anyway, I wish to be able to send a message at a pre-determined time. The ability to send an SMS when a specific incident occurs would be preferable but is not essential.
Preferably there will be some C++ library just waiting to do all the work for me, although any pointing in the right direction would be welcome.
Could some kind soul point me towards how I can automate this process?
You could look into the AT commands as that is how it works. By sending an AT command to the usb dongle, one could send a text, the ability to send a message at a pre-determined time would have to be implemented logically in the code outside of the communications with the usb dongle. Something like this in pseudo code
while (true or !quit){
getcurrenttime(&time);
if (time == specified_time){
send_command("This is a sample message", "12345678", &result);
if (result == true){
print "Sent a message to 12345678";
}
}
sleep(1);
}
That would be how you can send a message at a pre-determined time...as for the AT commands have a look here...since the usb dongle would be treated as a serial interface, it's a matter of writing to the serial port...

controling individual pins on a serial port

I know that serial ports work by sending a single stream of bits in serial. I can write programs to send and receive data from that one pin.
However, there are a lot more other pins on the serial port connection that normal aren't used but from documentation all seem to have some sort of function for signalling as opposed to data transfer.
Is it possible in any way to cause the other pins that are not used for direct data transfer to be controlled individually? If so, how would i go about doing that?
EDIT: more information
I am working with a modern CPU running windows 7 64-bit on an intel core i7 870 processor. I'm using serial to usb ports because its imposable for me to do anything directly with a usb port and my computer does not come with serial ports and also for some inexplicable reason i have a bunch of these usb to serial port adapters lying around.
My goal is to control mutipul stepper motors (200 steps per rotation, 4 phase motors). My simple circuitry accepts single high pulses and interprets it as a command to cause the motor to rotate one step. The circuit itself will handle the power supply and phase switching. I wish to use the data transfer pin to send the rotation signals (we can control position and velocity by altering the number of high pulses and frequency of high pulses through the pin, however there is no real pulse width modulation).
I have many motors to control but they do not need to be controlled simultaneously. I hope to use the rest of the pins and run them through a simple combination logic circuit to identify which motor is being moved and which direction it is to move in. This is part of the power switching circuitry.
The data transfer pin will operate normally at some low end frequency. However, i want to control the other pins to allow me to give a solid on or off signal (they wont be flipping very quickly, only changes when i switch to controlling another motor).
Based of the suggestion of Hans Passant , I'd like to suggest that you use an Arduino instead of an USB-to-serial converter. The "Duemilanove" is an Arduino-based board that provides 6 PWM outputs (as well as 8 other digitial I/Os and 6 analog). Some more specialized boards might be even cheaper (Arduino Pro Mini, $15 in volume, some soldering required).
Using the handshaking pins to send data can work very well, though probably not on a multitasking OS, it's just very processor intensive (because the port needs to be polled constantly) and requires some custom cables. In fact, back in the day, this is exactly how Laplink got such high transfer rates over serial connections (and why to get those rates you needed a special 'Laplink' cable). And you need both sides of hte link to be aware of what's going on and be able to deal with the custom communications. Laplink would send a packet of data over both the normal UART pins while trying to send data from the other end of the packet over the handshaking pins. If the correct cable wasn't used (or there was some other problem with sending over the handshaking pins) there was no problem - all the data would just get send normally.
Embedded developers might know this as 'bit banging' - often on small embedded systems there's no dedicated UART circuitry - to get serial communications to work they have to toggle a general I/O pin with the correct timing. The same can be done on a UART's handshaking pins. But like I said, it can be detrimental to the system if other work needs to be done.
You can use DTR and RTS only, but that is four possible states. You do need to be careful that the device on the other end uses TTL levels. At he end of this link Serial there are tips on hardware if you need it.
What kind of data rate are you thinking of when you say high frequency? What kind of serial port do you have? With the old 9 pin connectors on the back of the computer the best you can do is around 115Kbps. With a USB adapter I have done test where I could push close to 1Mbps through the port.
Here's an article from Microsoft that goes into great detail on how to work with serial ports:
http://msdn.microsoft.com/en-us/library/ms810467.aspx
It mentions EscapeCommFunction for directly controlling the DTR line.
Before you check out this information, I'm joining in with the others that say a serial port is inappropriate for your application.
I´ve been trying to find an answer to your question for 3 hours, seems like there is no "simple way" to get a simple boolean signal from a computer...
But, there is always a way, and jet, as simple (maybe even stupid) as this may sound, have you considered using the audio jack connector as an output?, It is stereo so you would have 2 outputs available,the programming would is not that difficult. and you don#t need to buy expensive shit to make it work.
If you also need an input, just disassemble a mouse... and bridge the sensors to the servos, probably the most cheap and easiest way of doing it...
Another way would be using the leds for the Num-lock, caps-lock and the dspl-lock on the keyboard, these can be activated using software, and you just need to take a cheap external keyboard, and use the connectors for these 3 leds.
you are describing maybe a parallel port - where you can set bit patterns all at once - then toggle the xmit line to send it all...
Lets take a look from the "bottom up" point of view:
The serial port pins
Pins on the serial port may be connected to a "controller" or directly connected to the processor. In order for the processor to have access (control) the pins, there must be an electrical connection from the pins to the processor. If not, the processor nor the program can control the pins.
Using a serial controller
A controller, such as a USART, would be connected between the serial port and the processor. The controller may function as to convert 8 parallel data bits into serial bitstream. In the big picture, the controller must provide access to the port pins in order for them to be controlled. If it doesn't, the pins can't be accessed. The controller must be connected to the processor in order to control the pins if a controller is connected.
The Processor and the Serial port
Assuming that the pins you want to control are connected to the processor, the processor must be able to access them. Sometimes they are mapped as physical addresses (such as with an ARM processor), or they may be connected to a port (such as the intel 8086). A program would access the pins via a pointer or using a i/o instruction. In some processor, the i/o ports must be enabled and initialized before they can be used.
Support from the OS
Here's a big ticket item: If your platform has an Operating System, the Operating System must provide services to access the pins of the serial port. The services could be a driver or an API function call. If the OS doesn't provide services, you can't access the serial port pins.
Permission from the OS
Assuming the OS has support for the serial port, your program must now have permission to access the port. In some operating systems, permission may only be granted to root or drivers and not users. If your account does not have permission to access the pins, you are not going to read them.
Support from the Programming Language
Lastly, the programming language must have support for the port. If the language doesn't provide support for the port you may have to change languages, or even program in assembly.
Accessing the "unused" pins of a serial port require extensive research into the platform. Not all platforms have serial ports. Serial port access is platform dependent and may change across different platforms.
Ask another, more detailed question and you will get more detailed answers. Please provide the kind of platform and OS that you are using.