Read/Write Packets for PTP/USB on Windows - winapi

I'm trying to create a PTP/USB driver for Windows. Here's what I've done so far:
I was able to successfully use WIA, but win32 scans the entire SD card and builds a tree of files before I can do anything (takes 5 minutes, so unusable)
Tried SetupAPI with CreatePipe(), got unsupported error code
Tried SetupAPI with WinUSB, got unsupported error code (later decided against using WinUSB for misc reasons)
Tried SetupAPI with ReadFile/WriteFile and DeviceIoControl, got more unsupported errors
My SetupAPI code to discover the camera is working perfectly. The GUID for what I'm connecting to is {6BDD1FC6-810F-11D0-BEC7-08002BE2092F}. My PTP driver is working perfectly on Linux with LibUSB bindings.
Not asking for code fixes, just want to know which path I should try again. Thanks for any advice.

Related

What are the additional configurations/ additions for integrating USB3503 to Android on IMX8QM?

I'm trying to integrate the USB3503 HSIC hub to Android in IMX8QM. I have already done the same on Linux. However, even after integrating similar lines of code, which were added in Linux for the hub bringup- we are not able to get proper response from the device.
The driver is loading and the driver lists when checked with i2cdetect, but i2cdump and other i2c commands return I/O errors.
Please help.
Thanks & regards

How can I create a Bulk USB Gadget WinUSB Device

I created an small embedded WinUSB device which offers 2 bulk endpoints. This device can communicate with Linux and with Windows10 without installing driver, or a .inf file.
Now we want to use the same API with a embedded Linux. The USB-Gadget mode offers Serial CDC/ACM and RNDIS-Ethernet and many more.
I was able to create a USB-Gadget with the gadgetfs which had only bulk ep. I could communicate with Linux and Windows host. The USB-Device had /dev/ttyGS0 to communicate. But in Windows I had to install WinUSB driver manually.
I work with yocto to create embedded kernel.
I added some line of code here: /linux-imx/drivers/usb/gadget/legacy/serial.c , f_serial.c, u_serial.h to add additional variable os_desc and parameter use_winusb. But the resulting g_serial still creates a COM-Port in Windows10 or a no WinUSB device. For our device we need WinUSB-Device only.
The RNDIS Gadget does has WinUSB support. So I tried to create a own USB-Gadget device with https://github.com/libusbgx/libusbgx. But if I use the USBG_F_SERIAL function type then it can't create WinUSB. See error:
Error setting function OS desc
Error: USBG_ERROR_NOT_FOUND : Not found (file or directory removed)
If I use USBG_F_RNDIS, it works, and with manipulated USB descriptor it'll recognized by Windows as WinUSB device. But Linux implement's it as USB-ETH ethernet device. The USB-Device get's no /dev/ttyGS0 serial connection to communicate.
I'm reading the Linux kernel driver source now, to find the position, where I can simply ann this WinUSB os-descriptor stuff into the USBG_F_SERIAL type. But I think it'll take month to get through.
Any solution would be ok. Patch for the Linux driver sources g_serial or how to configure a USB-Gadgetfs would be great. Any hint, where to put additional code would also be fine.
I wanted to change the kernel, but fortunately found this:
https://blog.soutade.fr/post/2016/07/create-your-own-usb-gadget-with-gadgetfs.html
This code made it easy to add WinUSB features.
Source of modified Version for WinUSB: https://github.com/rundekugel/gadgetfsd/tree/WinUSB

Gammu - gammu - detect under windows?

I am pretty new to gammu, my nokia which was working fine with it has died and I am getting a Huawei K4505 3g modem to replace it.
I would like to try using gammu-detect, but am running under windows and it isnt included in the distribution files.
Is there a way of getting it/ using it under windows, or alternatively can anyone direct me to the correct config settings for my 'new' modem.
I have searched everywhere, and have found some references to installing detect under windows, but no details as to how to actually do it!
Many thanks .... David.
update ... couldnt find windows version of --detect, but config file worked fine
with device = com19 and connection = at19200
NOt possible to use a usb connection type directly, so need to map modem to a virtual com port first.

Is it possible to fully install a driver when the device is not present?

Is it possible to fully install (and not just pre-install) a device driver on a system before the physical device is plugged in? In particular, I'm looking at the D2XX drivers by FTDI. Their driver installation program effectively runs dpinst.exe, and if you watch the console output of that program it says this:
No matching device was found for 'c:\drivers\ftdiport.inf'. Driver will be installed when plugged in.
The trouble is that I'm also using their .NET library for accessing the device, and that library is funny. It pops up an alert in the constructor if the driver isn't installed. Of course the usual solution is to simply plug in the device and let the driver installation finish as normal, but sometimes this is neglected. The pitfalls with having an unavoidable popup box in a 3rd party library should be obvious.
So does anyone know of a way to automate the full installation, and not just the pre-installation? Are there any dangers to copying the driver to the system folder manually / in advance?
You seem to mention "fully install" by "staging" the driver not by "loading" the driver. You can refer to the source code of "devcon.exe" for dp_add command, which actually do staging the driver package. Staged driver package will be being searched by PnP Manager when the unknown device is detected.

Windows 7 Default Audio Device Problems, PJLIB VOIP SDK

I have been able to build PJSUA. The softphone runs perfectly on Windows XP, but on Windows 7 but it gives me the following error
It seems to be an issue with PJSUA on Windows 7. Has anyone been able to resolve this?
If you look into the code you will see that PJSUA is looking for a default device that has both input and output (mic and speakers) - such as headset. Just output or just input will not work...So if you plug in a headset you may eliminate your error. It works great on Win7.
The audio part of PJSIP is quite complicated IMO. Although I have it working now I am myself researching how to implement giving user a choice. That is, the user will have a choice of using headset or mic/speakers built-in combo.
Seems it is incompatible with windows7, and so is Sipek, because of some library which is no longer present in Windows7 (libwavemixer, ...).
I went on to use the Java-based Peers SIP Phone.

Resources