Read data from device via iPhone app - ios

I looked around for an answer but couldn't find anything related. My question is if I can connect another device with the iPhone/iPod/iPad via USB. Maybe I would need another device to connect the two, because I don't think this would work out of the box.
I want to write an app which can read out things like the temperature, humidity and other collected data from a device my company developed. You can read it out only by connecting it to the computer at the moment. Also it needs a special driver. I can access the driver's code and every thing else. So my question is if it would be possible to develop such an app and how. Do I have to build another connector or would it work if I connected the device and the iPhone directly via USB.
Another thought is, would it work over a Bluetooth connection? In the future my company has plans to build Bluetooth into their device to make it easier to communicate with other devices.

Related

How to connect iOS app to a hardware over wifi? Is it possible

I have this situation and I hope that anybody will be able to help me with.
So we have some hardware devices that needs to be controlled by an iOS app (either all together or one at a time which ever possible to be implemented) and in return the hardware returns values to the app! Possible scenarios:
The iPad acts like a hotspot and the devices connects to it then the app control the hardware and read data from it. In this way no need for a router.
The hardwares connects to a local network where the iPad also connected then the app controls the hardware and can read data from (I think this can be done as if was a printer and an app communicate with the printer over wifi).
Now, I have no information how to do that or if this is even possible. I searched online but couldn’t find that much of info about it.
I appreciate all the help on this.
Thanks

General questions about Bluetooth

I have been fiddling with Bluetooth lately and I feel as if there is some elusive thing I am missing, anyways here are some of my questions. What I want is to have my Bluetooth enabled laptop running Windows, communicate with my iOS and later Android devices.
Is Bluetooth LE compatible with older Bluetooth technologies?
-My believe is that Bluetooth LE is the same as other Bluetooth versions
only that of course, as the name implies, it is low power. My confusion arises from the fact that on the iOS page they refer to some of the schemes as GAT servers , and what I am guessing is another protocol, ATT. Upon reading the article posted Here there is no mention of these two only L2CAP. As well as there is no mention of those in the Bluetooth API for windows Programming with Windows sockets The protocol that this article mentions is RFCOMM
-How is a connection between the two devices started?
I know that there are service ID's which can be published in an internal Service Description server according to the article previously referenced. However there is no concrete mentioning on the iOS bluetooth pages. They mention peripherals advertising bundles of data and the central device connecting to it. No mention of SDP, unsure if the windows docs do. And I' am bit confused about how the process flows, do the two devices connect first and then one device checks what services are available and the other one subscribes? Here by services I mean which applications are running, and by connection I mean as in establishing a connection from say (in iOS) Settings>Bluetooth and then starting the application on your phone, and then it is able to scan, or can the process of enabling Bluetooth and establishing a connection be done in the application itself. Same for windows, do I have to start the Bluetooth device by Settings>Bluetooth or can it be triggered within the Bluetooth enabled application?
-Is it pivotal to assign which device is the central and which is the peripheral?
Since at the end of the day they are able to both exchange data. In my case I want to have my computer running windows communicate with my iOS 7 device. Now as mentioned there are two roles that you could choose from in iOS: Peripheral and Central. It makes sense to me that the phone should be a peripheral since the main application will run on my computer, and I want my computer to enter the listening state before the device, and have the device connect afterwards. But it makes sense to have my computer advertise its services and then letting the iOS application choose the correct one. If someone could give me some pointers on what the best practices are and how to tackle this problem, I'd appreciate it.

Does iOS 8.3 now support Wifi debugging?

I updated iOS on my phone to 8.3 and I saw this message popup on first boot, but I have not seen it since:
I have been searching all day for information and I can't find a single reference to this message or to Xcode supporting wifi debug.
I am using a macbook pro 2009 model, and I have read that this is not compatible with the new continuity features (as well as airdrop etc). I am wondering if this is part of the wifi debug (and also if BTLE is involved at all). Of course it is all speculation since I cannot find any documentation about this.
Has anybody used wifi debug, or can point me to any documentation?
No, the feature was disabled as it causes serious security flows, for example when debugging you can fake location for any app, access confidential data like your number, udid etc. WiFi can be used now only to sync using iTunes.
It's restricted to USB only. You would need to write a bridge between USB and WiFi. You could in theory connect iPhone to Raspberry Pi, use open source crossplatform libMobileDevice. And mirror all USB requests from your XCode to this device USB.

How to restrict WiFi change on iPad

I have this solution for my customer's retail stores - they have iPad Air 2, with iOS 8.1.3, router and workstation with large TV and it's absolutely necessary that the iPad will stay connected only to WiFi I am providing with those routers. If anyone changes to another hotspot, the solution won't work. So I am looking for some ways that will prevent that, either in settings or via some app..
Also, it might work with apple configurator, but I couldn't find any site where it is mentioned.
Thx for advices
Unfortunately there is no means to restrict iOS devices to a single WiFi, even with an MDM and device supervision. I have a close relationship with Apple and this has been ask from education and retail partners for over 4 years now. I feel your pain.
A "workaround" for this would be possible if you happen to be using a single app that you have developed to access these resources. If that is the case you can either interrogate which SSID the device is attached to and throw a warning if it is not correct. There are also a myriad of other examples like this to detect the wrong SSID or spoofed SSID but no way to currently lock the device to the correct SSID.

RS232 for iOS device

Is it possible to pair an iDevice to an rs232-bluetooth adapter for the purpose of sending serial commands like it would through an iDevice dock connector to rs232 (just like the Redpark Serial Cable does)? I ask because the company I work for is thinking of having an iDevice control one of our systems for demo. I know it doesn't relate to anything specific but any information would be greatly appreciated.
(See also iPhone to RS-232 via Bluetooth)
Bluetooth modules exists that support MFi (Made For iPhone) such as this one from connectBlue http://www.connectblue.com/products/bluetooth-products/bluetooth-modules/bluetooth-iphone-ios-accessory-module-obs414/ So the standard iPhone Bluetooth stack can make a SPP/RFCOMM connection to that device. That device could be added to a board along with RS232 level-conversion etc... And thus success.
I don't know whether someone sells such a device. The RS232 device that connectBlue sells seems not to support MFi, http://www.connectblue.com/products/bluetooth-products/bluetooth-devices/bluetooth-rugged-serial-port-adapter-rbs433/
Not really. The GameKit is one way to access bluetooth in iOS, but it is very limited in what that API allows you to do.
Depending on what you are building, you might be able to use the Apple Made for iPod program, but it's probably a long shot.
http://developer.apple.com/programs/mfi/
The best way to go is probably to design a device that connects via WiFi. I've gone this route, and it worked out well. If you must interface with something with an RS-232 interface, you might design an intermediary "adapter" that connects via WiFi to the iOS device, and via RS-232 to the other device.
If you don't have a need to distribute your app via the App Store, you can use Redpark's iOS serial cable: http://redpark.com/c2db9.html. (Disclaimer, I've never tried one, but according to someone at Redpark, jailbreaking is not required, you just can't distribute your app on the app store.)
You could design a small dongle that attaches via the dock connector, and broadcasts over bluetooth to your other device.
Or you could use WiFi instead of bluetooth... perhaps communicating over WiFi to something that's physically plugged into whatever you want to control.
I worked on a jailbroken app which used BTStack to communicate with a serial device. You might be able to use this for your demo.
If you're still looking to use bluetooth, this helped me out alot to facilitate the standard serial connection for prototyping without jailbreaking:
http://www.seeedstudio.com/depot/bleshield-based-on-bluegigas-ble112-module-p-1367.html
It works on the Bluetooth 4.0 enabled iOS devices and all of the schematic, boardfiles, firmware sources and the iOS App sources are available here:
https://github.com/michaelkroll/BLE-Shield

Resources