M2M in Open Source - c++

Is there any open source(it may be c,c++ and java) for machine to machine communication ?
I would like to make communication between my hospital ECG device and my pc.
Serial port with Linux platform
Thanks
-Anlon

M2M is a generic term. there is no standard protocol or medium to implement a machine-to-machine communication. thus ou have to search for yourself which communication mean would best fit your need, depending on your device.
basically any communication channel can be considered a m2m channel: serial port, usb port, ethernet, also gsm/sms for gsm enabled devices. as for the protocol, it depends on the protocol used by your device (you won't be able to modify your ecg device to fit a specific protocol of your choice, you will have to stick to what format the data comes out of your device).

There's currently an initiave at Eclipse Foundation to start to gather efforts around Open Source M2M and 2 projects from this initiative are starting: 1 about tooling (Koneki) and 1 about M2M protocol (Paho).

You might be interested in trying out Mihini, a project recently added to the Eclipse M2M initiative that provides an open-source embedded framework for M2M. It allows to really easily do serial communication with Linux.
I don't know what protocol your ECG is talking, but there's e.g. built-in support for the Modbus protocol in Mihini.

Related

UPNP To Detect Devices in Network?

I just finished understanding what's UPNP (universal plugs and play).
Now supposing it's enabled in my router, how can I used UPNP to detect devices connected to the network and analyzing it (it's a fridge, printer etc?)
I'm looking to work with C/C++ and not sure where to start from.
UPnP is a collection of active and passive discovery protocols. Either hosts send advertising multicasts on their own, or they need to respond to search requests. Interested parties can then query the varies capabilities ("description") of a discovered service.
Hosts not directly supporting the required protocol cannot be discovered.

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.

controlling ethernet speeds in lan c++ windows

I am wondering if it is possible to limit/control ethernet upload and download speeds on specific transport layers (tcp/udp) using c++? I am trying to make a simple to use program that can control the speeds of any device that the ethernet is connected to. For example: Computer B is connected to computer A via Internet Connection Sharing, I use my program to limit computer B's download or upload speed to 120kbs (or any number i choose), with this I would also like to choose udp or tcp.
Basically, I want to create my own program similar to net limiter and other such software, but I also want to add my own features which many of which lack for my needs. These other features are easy enough, but I have no idea how to go about the actual limting process.
The way forward in the general case you ask about would be to create a virtual network adapter and all the monitored route traffic through it. Once that was done, then you can monitor streams between hosts or on specific ports.
Not an easy job... A starting point would be the Windows device driver kit.
If you were prepared to limit just one app, and could modify it, the task would be much simpler... wget and curl for example both offer limiting.
HTH, Ruth

QoS trough UPnP for improved VoIP quality on wireless lans

I'm working on an application that does VoIP, Cam-streaming and file transfers at the same time. Currently it runs under Windows, OS X, Android and iPhone/iPad. As you may understand, this can create quite some network traffic, especially if several people on the same LAN does it simultaneously. As a result, VoIP quality suffers.
I figure that the best theoretical solution is to ask the local wi-fi router politely if it can prioritize the VoIP traffic. Unfortunately, most of the traffic streams, including SIP for VoIP and Video is encrypted and sent over TCP. So the router has no way to figure out what TCP/UDP streams does what.
I have looked briefly at UPnP QoS. From the specifications, it's just what I need. But I don't know if it is widely available for today's home routers. I also don't know if it actually works the way I want. To put it simple: For VoIP, I want to specify a stream by it's endpoints, and tell the wi-fi router/home network to give it minimum latency.
So my questions are really:
Is it worth the effort to dig further into UPnP QoS?
Is this widely adapted by modern home LAN hardware (wi-fi routers)?
Are there better approaches to consider?
I also noted that Samsung has a patent pending for this, and I am concerned about the implications.
I have not found any really nice API's for UPnP and QoS, but I guess it's possible to cook something together with curl or boost::asio. If I do, is there any interest for a C++ Open Source library for this purpose?
Encryption doesn't play a part in QoS as encryption is (usually) at the application level not the TCP/IP level.
More likely your problems are related to http://www.bufferbloat.net/