How to send stream data via Bluetooth from an iPhone/iPod Touch to a Windows C++ application? - c++

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).

Related

control a Qt/C++/QML GUI application running on a embedded device from a remote client application?

Scenario:
We have a Qt application(Qt 5.9.5,C++,QML,Ubuntu) running on a device (deals with telecommunications), which can also be viewed in a browser using webserver. All the operations done manually on the device have been visualized on the browser simultaneously.
Requirement: Now what we want to achieve is build a similar application(maybe web application) so that you execute it from a browser and simultaneously the application on the device should execute by itself. The device is just switched on initially. everything should be operated from the client application. What are the possible options?
We have started with Qt Remoteobjects to make a remote application but Qt version of device is older one when compared with Qt version of some functionalities in remote objects module. so using remote objects is not possible now.
Can Qt WebGL streaming helpful in this case?
Does QtWebchannel and websockets help by setting up communication with html/javascript application. Is it a possible solution?
Is virtual network computing (VNC) an option to think about in my scenario?
I have come across some concepts like Qt for WebAssembly, Web toolkit(Wt), Emscripten, Cutelyst web-framework, Qt for Automation - MQTT,OPC UA, KNX, CoAP . Do these really help at any point while developing a client application to control the QML GUI on a telecom. device?
Which of the options suits my scenario?
I have been following Qt's blogs about these related topics. Still not sure which method is suitable?
Sorry for a lengthy explanation. Kindly provide some suggestions.
Thank you.

How to connect hardware device to an Iphone application over Bluetooth

I have a hardware device which would communicate with a third party application on Android and IOS over Bluetooth to send to and fro data.
With Android I am able to achieve this, however in case of IOS I don't have any information.
Till now the information gathered to work with IOS devices is:
1. Application runs on Iphone 5
2. Hardware is MFI enabled
3. IAP2 is supported
Please guide how to connect the hardware to an application and what other information is essential?
Is AppName, BundleID, BundleSeedID and ProtocolName required to connect? If yes how we can get these details?
I tried unzipping the application but the Info.plist file looks garbled and not able to get much info from that.
Currently I am able to connect the hardware with IPhone over Bluetooth, but my real concern is how to communicate with a specific application on it.
Also if you can provide some link or pseudo code to initiate a session between hardware and IOS application.
I assume you've already connected the SPP profile on Android. However for iOS the SPP(BLE is another story and do not need MFi) was hidden but need MFi authentication for raw data links.
Since you want to establish the raw data link between your hardware device and your iPhone, you need:
Make sure your hardware has MFi chip, generally this chip is connected with your hardware by I2C.
After step 1 make sure you can communicate with this chip at your hardware, fortunately the hardware vendor or MFi vendor will support this kind of code or binary.
The MFi channel have a specific UUID(which may defined by Apple?) to replace the SPP official(which defined by Bluetooth SIG) UUID, hence if you want to make connection between your hardware and your iPhone, you need register the iOS defined UUID and make them as same as the normal SPP profile.
After the RFCOMM channel created, iOS would first authenticate the link, just like 3-way handshaking or something, so your hardware just communicate with the MFi chip and transfer the token to iOS.
After that iOS would set this RFCOMM channel(same as SPP actually) for your hardware, then you can send/recv data between them.

Windows form application for USB port

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.

Is it possible to do WebRTC browser to native (C, C++ or other)?

I have seen several examples of native to browser WebRTC applications, like for streaming video files stored on a server to one or more browsers, but is it possible to do the reverse ? I.e. streaming the webcam from the browser to a server, written in C, C++, Java or other ?
It is possible.
WebRTC is using open standards to stream content over the network. You can find all the details in the following RFCs:
http://tools.ietf.org/wg/rtcweb/
If you want to write your own native application that will receive (and even send) WebRTC media you can either get the WebRTC native code from here: http://www.webrtc.org/webrtc-native-code-package and build it into your solution or alternatively use one of the existing SDKs that can provide you this functionality (depending on which platform you want your native application to run on).
If you want to connect WebRTC to existing hardware like a SIP desk phone, you will need to have some sort of a gateway that will have one leg that will communicate with WebRTC on the browser and the other leg that will communicate with your SIP phone.
There are a lot of commercial solutions already out there, but eventually it all comes down to what your needs are.

I need a Windows 8 WinRT application to communicate with a standalone application written in C

I have 2 application running on the same machine.
Editor, is a Windows 8 application developed with WinRT and is sand-boxed. (Client)
Integrator is a C++ application for reading hardware devices over serial COM ports. (Server)
I have done a lot of searches about how to get client/server communication to work on Windows 8,
and can only find posts that say it is not possible using standard WinRT classes, etc.
What I need is a solution where by the Windows 8 application works as a client, and the standalone
executable works as a server.
Can someone please suggest a mechanism that can be used to do client/server communication.
If we cannot find a good solution for this, then we will have to resort to using files, which
I would rather not have to do.
Clarification: I am aware of the many mechanism that can be used to do client/server communication.
What I am looking for is a workaround to the problem, where the these techniques will not work on
a Windows 8 application, developed with WinRT. As the sand-boxing explicitly prohibits the client
and server being on the same host machine.
Well, the posts stating that such communication is not possible, are mostly right. There are 2 reasons, why this is prevented:
Being able to communicate to an application outside the sandbox effectively breaks the sandbox. The Windows Store app is now suddenly able to do everything the desktop application can do: access file system, registry... Windows Store apps live in a sandbox for reason - to be safe for the user.
The Windows Store app won't work after it is installed from the the store or from a package. It needs to have a desktop application installed and set up correctly as well.
I would suggest you try to move your server part to a different machine and make it a proper server. If for some reason you really can't do that, you still have the following options available:
You can use TCP/IP to connect local network resources if you remove the isolation for your Windows Store app. You will need to use CheckNetIsolation.exe, but since you already need to separately install the desktop application, this shouldn't be that much of a problem.
You can create files with a specific extension. Then register the desktop app for one extension and the Windows Store app for another extension. You can now shell execute files with these extensions to use them as a message for the other app.