I know that there are nice UPnP stacks like "Developer Tools for UPnP Technologies" (http://opentools.homeip.net/dev-tools-for-upnp). This would work but I do not need all this functionality.
All I need is that I can see my device (in e.g. the Windows Explorer - Network tree) with a property page which publishes the device IP.
Is there a library that only announces the device?
GSSDP (libgssdp in most linux distros) is a small, reliable and well tested library that handles the announcement and discovery part of UPnP: it's trivial to write a small program that advertizes the device uri with GSSDP (see example).
However, nothing guarantees that your Windows Explorer shows all SSDP announced devices. Maybe you do know what it does but I thought I should mention it might show only devices that look like UPnP devices, or it might show only devices that look like UPnP AV devices, or might even only show devices that look like DLNA supporting UPnP AV devices...
Related
Previously I have work with Windows Form application to establish some RS232 connection. I used the already provided serial port component (SerialPort), and I was able to establish RS232 communication relatively easy.
Now, I was wondering if there will be something similar in Winodows Form application to establish a USB communication ?
It seems there is this WinUSB API that provides a very low level interfacing with the device.
However, I am not sure how easy will that be? Also, not sure how easy will it be to integrate into Windows Form application ?!
Will there be a simpler version of such USB interface API?
I don't have to stick to Visual Studio. Is there other c++ USB API, besides WinUSB, that is more standard that people use? I would like to develop a GUI API that does some communication over USB. If need be, I can use Python or some other tools if it facilitates the process?
Thanks in advance.
Although USB is a serial protocol, you can't treat USB like a serial port:
It's dependant on what the actual device is. For example a mobile phone, may provide several "endpoints" for USB, one being a serial port to use the phone as a modem, one as a storage device allowing you to transfer photos and music files to/from the phones storage, and as a camera device that you can take photos with. All of these have different behaviour and need a USB driver-plugin to make it behave correctly - these are typically shipped with Windows, and your phone will appear as COM5:, the E: or "Samsung Galaxy S3 Mini" drives and as a camera under the "cameras and scanners".
Of course, you can programmatically open all these devices, but it is done as the device-type that they present as on the inside of windows (so you use serial port functions or file functions or camera functions).
You CAN also write a device driver for a device, if you have sufficient details of how it works.
But there's no real way to "open the port". The USB API is a driver API, not a user-mode API. Here's a page to start from to understand USB drivers:
http://msdn.microsoft.com/en-gb/library/windows/hardware/ff540215%28v=vs.85%29.aspx
There is a WinUSB driver, which allows a single application to access a single device, assuming you know how to operate that device.
We are developing win-mac file sync installer which is quite similar to Dropbox. The installer is built with c++ and QT. We had a use case, where if the internet is disconnected(plugged out network cable (or) not connected to any wifi) so basically no access to web, During this case we need to make the installer into offline.
I tried few approaches like polling continuously to our web servers. If we are not able to reach then we detect as internet dis-connectivity. Due to some reasons we wanted to have clean native implementation which will look for machines network connectivity.
I even tried http://msdn.microsoft.com/en-us/library/aa965303%28VS.85%29.aspx for windows but this is failing in wifi cases even though we don't connect to wifi this example is saying "Network connected".
Can anyone suggest other alternatives. Platform specific solutions also invited.
You probably want to look at INetworkManager::GetConnectivity, and check for NLM_CONNECTIVITY_IPV4_INTERNET or NLM_CONNECTIVITY_IPV6_INTERNET in the response.
I'm creating a WiFi program for Windows, I'm new to network programming.
I'm using the Native Wifi API to get information about a network but now I want information about the other devices that are connected to a network.
Does anybody know what I should learn to accomplish this? Do I need to use winsock?
You can do this via UPnP (assuming your AP supports UPnP, but most do).
You'd connect to the WLANConfiguration service of your UPnP access point, and read the TotalAssociations to get the number of associated devices, and the AssociatedDeviceMACAddress and/or AssociatedDeviceIPAddress variables to get the addresses of the associated devices. The latter might give you IPv4 or IPv6 addresses, or it might give you host names.
The TotalAssociations variable is "evented", which means you can have the access point tell you want the number of associated devices changes, and re-enumerate their addresses when that happens.
Microsoft also provides a UPnP API that may be helpful (though I've never used it personally, so I can't say much more about it).
References
UPnP Architecture specification
WLAN Configuration Service specification
I want to write a c++ dll that read certificate from my USB device and send that to browsers like Firefox.And I should mention that i have built my USB device with an ATMega32A which have 2K EEPROM and i stored a sample certificate on that.
I have read some about PKCS#11 standard but i cant figure out where to start. Could anyone help me on this?
It sounds like you're creating a PKI hardware device. I think your biggest hurdle will be accessing the ATMega32. It'll be up to you to implement an interface on the ATMega side, be that a RS232-usb bridge, USB Mass Storage, or proprietary with a custom driver.
A simple solution might be to use a USB Mass Storage interface to present a certificate as file on a pseudo disk.
Taking the custom driver route, Firefox (and other Mozilla products) use libraries that have interfaces for PKI hardware. See NSS and OpenSC.
At a guess it's possible that there's a PKI / PKCS11 driver API for Windows that you can implement.
You can not "add to Firefox" but you can expose your data to firefox and make them available for use. To do this you need to implement PKCS#11 API and create so-called PKCS#11 driver (the user-mode DLL which implements those 70 or so functions defined in PKCS#11 API). Those functions would talk to the hardware device in order to perform certain operations. Then you plug this PKCS#11 DLL to Firefox and Firefox can use certificates on your device.
Step 1: write a dll that can read data from the USB device. You could use Winusb. This will require the firmware to support it.
Step 2: write a dll that can add a certificate to Firefox
Step 3: combine previous steps into one dll
If you get stuck on something specific, write a new question and show us what you have done so far.
I need to develop an iPhone/iPod Touch application that creates a server to send some data stream (characters or bytes) to a Windows C++ application via Bluetooth. I'm thinking of creating a TCP connection, but don't know where to start.
What iPhone API should I use do to something like this? Does anyone knows some code examples that i can use to do this?
And in Windows, what should I use to support this kind of communication?
Thanks
Yes. From what it looks like you can use the PAN bluetooth profile (the same profile used for tethering) with everything except the original iPhone.
Here's an article doing bluetooth over iPhone/iPad using GameKit. The article notes that you would need at least 2 iPhone/iPad devices running iPhone OS 3.0, but I wouldn't take that as an impossibility to talk to any other bluetooth capable device.
Update
This forum indicates that the iPhone is only capable of headset pairing. It could be that the iPhone is "picky" about what you can pair it with.
"The iPhone only recognizes the "headset" profile. Another well thought out idea from Apple. No A2DP profiles, no OBEX."
-sapporobaby
Update 2
As jamone as indicated iPhone 3.0 supports A2DP. How nice is that?
Here's a table listing of iPhone/iPad bluetooth supported profiles
I'm pretty sure third-party developers don't have sufficient access to the Bluetooth stack to do this via published APIs (i.e. via an app you publish to the App Store).
Is using WiFi an option? That's what most developers seem to be using for client/server communications. If that's the case, see if you can distribute Apple's Bonjour runtime with your app. If you search the developer site for Bonjour, they have code samples (though probably no Windows examples).