Access SmartCards from Windows 8 Store App (WinRT) - windows-8

In a Windows 8 Store App I would like to read Data from a SmartCard. After installing the SmartCard reader (USB Device) I can read its device path and connection state via the Windows.Devices.Enumeration namespace. Even the device interface id is retrievable (50dd5230-ba8a-11d1-bf5d-0000f805f530) and I put this as a required capability in the App's manifest file.
For the interaction with the device I use a C++ Component calling the CreateDeviceAccessInstance Method. But this call always results in an ACCESS_DENIED exception.
Further research taught me, that interacting with a custom hardware device (everything that is not a printer, microphone, mouse, ...) would need several adjustments in the device driver published to the windows 8 driver store.
I'd be glad to do so, but I am no IHV and would like to use the generic driver and the generic interface.
Could anyone give me a hint how to proceed from here and use the generic interface for USB SmartCard devices?

This is not a real answer, but I have the same problem and I have spent quite some time looking for the hard-to-find bits of information on this subject around the internet, and I'd like to share my results.
Windows 8.1 has some specific APIs for (virtual) SmartCards (API reference, sample), but it seems like they can only be used for authentication and there is no way to send APDU commands to a card at the moment (see this comment by Himanshu Soni). I guess one could use the new USB APIs to talk to the reader directly, but then you'd have to implement the whole protocol yourself.

Related

USB idproduct and idvendor

I am very new to USB interfacing and i am trying to build an application for WINCE 2013 device. In my device, one vendor's (let suppose 'X') VID and PID are using for USB mass storage device class.
Now, i have specific use case where communication should be built on USB rndis class. For this communication purpose we are using microsoft generic rndis driver as is (not a custom one). So, can i use the X's VID and PID(which i am using for MASS STORAGE class now) for the Rndis class too or need to purchase a new one again. I know that i can use any VID and PID during development stage but i need VID and PID's for production devices.
Or can i go with Microsoft VID, PID and compatible id's compatible for Microsoft generic rndis driver by changing only the Serial Number for devices?
Please suggest and thanks in advance! :-)
(Do let me know if the query is too vague to understand.)
It's difficult to find a definitive answer, but maybe we'll be able to extrapolate from this post by a Microsoft MVP (emphasis mine):
(...) you don't have to change MS's VID/PID anymore if
you use USB RNDIS to use ActiveSync.
Here's the official response from
Microsoft on this subject (as asked by a fellow MVP regarding a client
who had the same issue):
Question: Should they use the Microsoft PIDVID or create their own? If
they create their own, it means modifying the current .inf file and
therefore this means the driver will be unsigned and therefore may not
be able to be installed. In the past the Microsoft PIDVID gave warnings
to not use this. Now in 6.0 the warnings do not appear.
Answer: The answer is exactly the same as for Windows Mobile: For
ActiveSync usage, YES, you can use Microsoft's VID & PID for your scenario.
This is a change from documentation which says to get your own PID &
VID. Contrary to what the sample Registry file says, the OEM should ship
the device using Microsoft's VID & PID for USB-Serial ActiveSync client.
The latest OEM documentation confirms this (...)
Now, since you don't specifically mention ActiveSync, my understanding is that the above probably does not apply to your use case, which again means you will have to use your own VID and PID.
If you already own a VID/PID combination, I don't see any (legal) issues using this with RNDIS as well. It is the same device after all, and the USB host would load one of two different class (not custom) drivers to communicate with the device.
However, if you use your own VID/PID you will have to either
supply a signed INF file to end-users that contains your custom VID/PID, or
instruct users to manually select the RNDIS driver when your device is connected to the PC for the first time

How to create a USB STACK using win32 programming

I am doing my Project using win 32 programming.I am just learning about win32 programming and able to create an UI.I want to communicate with an USB Device with that UI.SO,How can i go for that?Is there any predefined functions will be there are we need to create the function for communicating with the OS and get the devices List and got the details about them.
My purpose is to ,
1.Creating an UI that tells about the Basic information about the device.
2.For that first of all i want to communicate with the OS for device attachment and find the drivers for that.That will lead to get the information about the device and communicate with the device using that UI.
So,can anyone help me about this?How can i achieve this or approach this?
Assuming your USB Device enumerates as a vendor specific device and not a class that has a preloaded driver WinUSB would be perfect for your case. If it is loading a class driver such as HID or some other class you will need to look up the API for that type of device on MSDN.

USB device design for an embedded MCU

I am working on a product with an LPC1788 which needs the following USB features:
Firmware download (from host PC to device, not through a USB
key).
File upload (from device to host).
Ideally we'd also be able to get some information from the device like serial number etc.
The device should only work with a custom Windows application, so simply using a mass-storage device as-is will not do. There are quite a lot of data to upload (200MB +), so using USB bulk transfers seem necessary to me.
What is the best way to approach this? I imagine I would need to create some sort of USB composite device(?). However, I was hoping to use nxpUSBlib or winUSB so I don't have to go through the Windows driver validation process.... What are my options? Perhaps there some way to make the mass-storage device invisible for Windows?
Thanks!
Dirk
I think you'll definitely want to go with a vendor specific bulk device and you can easily use WinUSB for all of this. This should be sufficient for everything you've specified here.
For your firmware loader I'd recommend looking at the DFU (device firmware update) specification. You'll probably want make some command for your device that when sent will cause it to reenumerate itself in to DFU mode for update (rather than a composite device that is always exposed - this restricts the issue of the other interface being in use while you're flashing your device). Then you can flash it and reset it so it will reenumerate as your vendor specific bulk device again.
I wouldn't recommend mucking with mass storage, from your requirements it will be better to implement your own protocol and create some application or DLL that consumes the WinUSB API to communicate with your device, including the firmware update.

Printer Status Monitoring adobe AIR Desktop App

Want a platform independent desktop app to check the toner/Cartridge level of a network printer and notify the user of the status and give him option to request for purchase of the toner if low.
The info i got till now is that we need to fetch values for OID from MIB files of a SNMP enabled Printer. I want this app to be as generic as possible for all Brands, however need for today is specially for Brother Printers & MFPs.
Sorry for looking nube but i have searched enough and there is not much information available.
Can i use native support & Monitoring tool of the Manufacturer as brother provides its monitoring utility which can be installed on Desktop(In that case where the MIB file will be located(on the device or within installed program on the Desktop?) or need to use network monitoring tools like icanga, negios etc.
Secondly how to implement it on AIR.I am thinking to use AIR for the first time and wondering will it be helpful and do i need to know something more on this technology before proceeding.
There are some networking monitoring tools available like negios & Icinga. which can be installed even over a desktop. Can the data from these can be parsed and used. We need it for brother printer but want to implement it for Multi-Manufacturer solution as per documents format for MIB file is getting standard. We will invest time only if its universal even after a year or so as its not worth time for a single manufacturer.
So following CLI's i find useful in Net-SNMP and believe that it will get me to output by calling these Applictions by External Script(AIR).
convert between numerical and textual forms of MIB OIDs, and display MIB content and structure (snmptranslate).
A graphical MIB browser (tkmib), using Tk/perl.
A daemon application for receiving SNMP notifications (snmptrapd). Selected notifications can be logged (to syslog, the NT Event Log, or a plain text file), forwarded to another SNMP management system, or passed to an external application.
An extensible agent for responding to SNMP queries for management information (snmpd). This includes built-in support for a wide range of MIB information modules, and can be extended using dynamically loaded modules, external scripts and commands, and both the SNMP multiplexing (SMUX) and Agent Extensibility (AgentX) protocols.
Are there any API to read MIB files in AIR.
Any links or some added information is highly appreciated.
For printers without SNMP support, you'll probably have to implement a manufacturer-specific solution. If you want to write an AIR app that talks to SNMP-enabled printers, I can see the following approaches:
Implement SNMP client in ActionScript
Since SNMP is usually based on UDP, you could use flash.net.DatagramSocket to implement your own SNMP client in AIR. AFAIK, there are no ready-to-use ActionScript libraries, so you'd need expert knowledge of the SNMP protocol and a lot of development time.
Write an AIR Native Extension
With a Native Extension (ANE) you could implement the SNMP client in C/C++. This has the advantage that you could use an open source library like Net-SMTP to do the heavy lifting, but you'd still need some experience in developing and building C/C++ libraries.
Use a command-line tool
The easiest solution is probably to use one of the free SNMP command-line utilities from Net-SMTP or SnmpSoft, for example. All you have to do is to call one of these programs using flash.desktop.NativeProcess providing the correct arguments and then parse the output.

How to program midi messages to HUI Pro Tools uses?

I found some specs online but It wouldn't work for Play.
I tried
const UInt8 noteOn[] = {0x90, 127}; and it didn't work.
Does anybody know what midi messages to HUI Pro Tools uses for play and stop?
There are 2 main Protocols out there for controlling DAWs, Logic Control and Mackie Control (HUI). Unfortunately both are close protocols. Only recently Apple added support for TouchOSC (iOS application) and the OSC protocol (Open Sound Control) in general for Logic Pro, hopefully Pro Tools to follow (maybe it already did and I'm not updated, you better check it out).
If you want to reverse engineer the record/stop buttons and you own some sort of Mackie Control device, I recommend using Midi Monitor or LC Xmu to monitor what data gets in. Not sure whats there for PC users, on my PC era I used my Pro Soundcard.
If you don't own some sort of controller and looking around the internet for the answer please notice that these protocols have many versions that each manufacture tweak a little bit. On the other hand, there are not that many options, you can try them ALL :)
Anyhow, I program an iOS application that controls Logic Pro without using LC or MC at all. I opened Logic's Key Command and set the Midi Listen button of the Start/Stop on, then sent some Midi Note from my iOS application to calibrate the button. It worked well, but was not intuitive to users so I decided to give up.
You can send a midi machine control message through your virtual server with you virtual server, I had some success after reading this: http://en.wikipedia.org/wiki/MIDI_Machine_Control
Be sure to enable your virtual source as a mmc in your DAW. Also there is a Boolean check in the core midi docs you can use to verify that your program is sending the mmc messages, I believe it is something like kmidimachinecontrolenable, it is a coremidi constant and should not be hard to find.