Knowing details of serial port and paired bluetooth devices on Windows Mobile 6.1 - compact-framework

I want to do the following using C# on .NET compact framework
1) know the list of all COM ports,
2) know whether a particular Blue-tooth device I have, is paired with my PDA (running Windows Mobile 6.1) or not.
3) If it's not paired I need to figure a COM port that can be used for my Bluetooth device.

For #1, the simplest way is to use the static GetPortNames method of the System.IO.SerialPort class. An alternate would be to look in the registry at HKLM\Drivers\BuiltIn for drivers that are serial ports (a prefix of "COM" is a good indicator, though not always the only one).
For pairing, etc. you might look at the 32 feet library.

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

Zebra ZM400 USB Printing in WINCE 5.0 and VB.NET

I have an application in VB.NET, for smart devices, that prints labels containing some product information such as manufacturar name, product name, product weight and a barcode with the product name. In the past I used to print it using the serial port of my device but, due to a hardware change, the new device my company bought doesn't have the serial port anymore, but it has more USB ports than the old device.
I googled for answers but most of them didn't point me to an answer, due to most, or all of them, don't use the .NET CF to print in Zebras. Many of topics I found explain how to create a connection to USB port but, obviously, when moved to WIN CE, it didn't work.
I have the code for Zebra printing (ZPL II), just need a way to send it to one of my USB ports and check if it's printing the correct information.
Thanks in advance.
You need a driver for the printer. Windows CE provide a generic USB print transport driver that should work with many of those text-based printers, you may add it to your Windows CE OS image and try it.
If it works you may be able to send data to the printer by using PRN*: instead of COM*: as device name (PRN1:, PRN2: etc.).

Choosing a GPS to read position from VB.net 2010? Which one I should buy?

I'm trying to build a device to read the current GPS coordinates. The device will include a small computer inside running Windows 7.
I'm looking for a usb GPS to connect it to the computer and be able to read the GPS coordinates from my VB.net 2010 program. Of course, here the most important thing is what hardware I need to accomplish that. Suggest me some GPS models.
Do I need only a GPS receptor or do I need even more hardware?
In addition to jcibar's answer:
For Bluetooth GPS or most USB devices you probably don't even have to set the classic RS232 communication settings like "baud rate". It will just work, whatever baud rate you set.
Look at the "Ports (COM & LPT)" list of the Windows Device Manager - One of the "COM" devices listed should be the GPS receiver and it many times includes a description that indicates what it is.
E.g. on my Win7 x64 notebook I have a "Sierra Wireless Gobi 2000 HS-USB NMEA 9001 (COM8)" port, which is the notebook's built-in GPS. It will just start communicating the moment I open the port:
17.09.2013 10:12:01.890 [RX] - $GPGSA,A,1,,,,,,,,,,,,,,,*1E<CR><LF>
$GPGSV,4,1,16,10,,,,21,,,,20,,,,32,,,*7A<CR><LF>
$GPGSV,4,2,16,31,,,,30,,,,29,,,,28,,,*78<CR><LF>
$GPGSV,4,3,16,27,,,,26,,,,25,,,,24,,,*79<CR><LF>
$GPGSV,4,4,16,23,,,,22,,,,19,,,,18,,,*7E<CR><LF>
$GPGGA,,,,,,0,,,,,,,,*66<CR><LF>
$PQXFI,,,,,,,,,,*56<CR><LF>
$GPVTG,,T,,M,,N,,K,N*2C<CR><LF>
$GPRMC,,V,,,,,,,,,,N*53<CR><LF>
You can use any serial COM port / RS232 logger to test this.
You can use any GPS (USB, Bluetooth) that provides a RS232-level serial interface (serial port). The GPS will create a virtual serial port (e.g. COM13) that you can use in your VB.net program to read serial data (NMEA frames tipically at 4800 bauds).
For instance, for USB you could use something like this: Haicom HI-206USB.

Mac Application - Disable specific USB port

There is any way to I disable/enable a specific USB Port with my application ?
I'm not aware of any way to do this from user space, and even within the kernel it could be tricky: I think you would need to install a dummy I/O Kit driver which matches all USB devices and/or interfaces. This could be tricky as existing drivers would take precedence, so you'd need to work around that. Once matched, you would check the port in the driver's probe() method and return true if it was one of the disallowed ports. This would stop other drivers from grabbing the device, which would essentially disable it.

Multiple Driver for USB Device

Is it possible for a USB device to support multiple drivers? I'd like to support my own proprietary driver but also CCID as a second choice. When the device is plugged in, the user can select which one to use. The driver to use is determined by what the USB descriptor says, right? If that is so, is it possible to indicate that both drivers are supported? Is the idea of supporting two drivers doable?
On Windows, having two supported drivers is possible. In fact, to get Microsoft Logo certification, it is mandatory that the USB device supports this functionality. (Requirement CONNECT-0123)
However, the UI behavior you describe isn't offered by Microsoft. Driver selection is automatic.
Your USB device can indicate it supports two interfaces. In that case, both drivers will be loaded.
I am sure that it is not possible for a device to use two drivers at the same time but what is possible is for the device to enumerate using one class type and driver and then during its operation, in response to some command over the USB or operation of the device, for it to disconnect and then re-enumerate as a different type of device using the second driver.
As an example the product that I am developing normally enumerates as a CDC (serial port emulation) but when I need to reload the code it re-enumerates as a different device type and uses the chip vendor supplied driver to perform the code download. Once this completes then the device re-enumerates itself again as a CDC device type and resumes its serial port emulation.
You therefore need to provide a "command" interface that will trigger the transition between the two operating modes and to ensure that the two drivers are installed on the host computer ready for the mode switch.