Is it possible to get the data from an HID through bluetooth in IOS platform? - ios

Our company developed a project keyboard using bluetooth 4.0 (BLE) to connect with iPhone. It is a HID and can send both keyboard and mouse data depending on the mode it is on. My job is to develop an iOS application to catch the data from it. In my last case, IOHIDLib in OS X platforms can do it easily, but in iOS platform i found that it is hard to get something similar with IOHIDLib. I have tried some ways.
CoreBluetooth, but this library can't communicate with HID.
BluetoothManager, but private framework is hard to maintain and it doesn't
support iOS 9.3
Gamekit, but this is only for two IOS devices.
ExternalAccessory, but our product don't have a MFi license and have no plan
to get one.
To put it simply, what I need exactly is a way or a framework allows me to read and write data with a HID through BLE in IOS platforms.
I will appreciate any help!! :目
P.S. The project keyboard works well, I can use it to type letters on my iPhone correctly.
P.S. I use Objective-c.

Related

What API/SDK to print automatically to thermal printer (e.g. Brother QL) with my React Native iPhone app without interaction?

I've been looking into different API/SDKs that would be best and easiest to integrate with my React Native iPhone app. This is an internal employee app, that once a form is submitted I would like to automatically print out a label from a thermal printer (e.g. Brother QL1110NWB).
Some options I found are:
React Native:
https://github.com/christopherdro/react-native-print
Brother SDK:
https://support.brother.com/g/s/es/htmldoc/mobilesdk/
Apple AirPrint:
https://developer.apple.com/documentation/uikit/uiprintinteractioncontroller#//apple_ref/doc/uid/TP40010141-CH1-SW34
Does anyone have experience with any of these API/SDKs and can recommend best method for easy integration and be able to print directly without interaction?
Thank you!
If you can dictate the hardware to make sure it is compatible, then the Brother SDK will have the easiest integration and be transparent to the user.
Apple restricts Bluetooth Classic devices from connecting to iOS unless they are MFi certified, which adds to the price but enables the External Accessory Framework at the OS level. Device manufacturers can then sell a printer that is 'iOS certified' like the Brother QL1110NWB and provide the SDK to use it.
How to use bluetooth classic instead of le
You would need to write a React Native binding for each target device family to use the SDK's OS specific libraries. Brother has an iOS, Android and Xamarin SDK available, but I don't see one for React, so you would need to wrap their iOS SDK with hooks to invoke your print on demand. Before you start, contact Brother support or your sales rep, because they may be working on React Native SDK, or your organization may have enough buying power to request one. Either way, it's a good practice to make this an interface at the base React level so that new printers or platforms can be added just by implementing custom native device adapters.

Looking for an Xamarin.Forms bluetooth library for IOS that will pick up already paired devices to my iphone

I've got an existing PCL Xamarin forms app which works great. New requirement is to connect a Biocontrol Hhr3000 scanner via Bluetooth to the .ios version of my project. Workflow is, i first connect and pair the scanner to my iPhone over Bluetooth. I need a non LE (low energy) Bluetooth library which i can use to work with this. All i can find on the internet is all examples of LE Bluetooth so as it stands i cant get the iPhone to pick up the scanner via normal Bluetooth pairing.
Please point me in the right direction. I'm looking for an ios implementation thats simple like this one for android: https://acaliaro.wordpress.com/2017/02/07/connect-a-barcode-reader-to-a-xamarin-forms-app-via-bluetooth/
If the device is Mfi Certified by Apple, then you can use the External Accessory Framework to interact with the bluetooth device. If you can pair it, I have to assume it is Mfi Certified.

How to connect to USB device from iOS with Xcode or swift

I'm trying to connect USB camera to iOS in Xcode using Swift or Objective C.
I saw online to try and use IOKit.framework, but I believe it's for MAC, which I'm not using. dos NSSstring converters but I'm unsure that will work either. I'm trying to do it through iOS.
I also have a WIFI adapter that will connect to my NIKON DSLR and shoot photos to a PC over wifi but not sure how to get the iOS device to connect and download these images.
Thanks in advance!
Looks like this isn't possible, at least for what you want.
Communicating with an external accessory requires you to work closely
with the accessory manufacturer to understand the services provided by
that accessory. Manufacturers must build explicit support into their
accessory hardware for communicating with iOS. As part of this
support, an accessory must support at least one command protocol
These USB devices obviously have not been designed with iOS in mind, so there is a very small chance you can get it to work the apple way.
Alternatively, you can look into jailbreaking and that sorta deal with the cameraconnectionkit library. This is way out of my scope though, so good luck!

Test Bluetooth on iOS

I'd really like to start testing my iOS apps Bluetooth capabilities, but have run into a few problems:
I have a device made with a RN-42 module, but it's not the Apple version and I don't have the Apple authentication module at the moment (I ordered it, but shipping from China can take a while). I know what the messages will look like, but can't send them to my iPhone!
I can use the module with my Macbook, but not in the iOS simulator! Apple has taken down all of the documentation related to getting the iOS < 7.0 to use a separate bluetooth dongle, and my efforts have left my 6.1 simulator endlessly spinning on the bluetooth screen.
I'm new to using Bluetooth, so this may be a dumb question...
Is there a way of getting a bluetooth client device (I have a Mac, another iPhone, and an Android tab) to act as a server module that can send (and receive) Bluetooth data to my iPhone?
Client/Server as per developer.bluetooth.org
Thanks!
Not 100% sure your meaning of "server module". But in CoreBluetooth, you can use CBPeripheralManager to broadcast data to other iOS or Mac apps.
https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBPeripheralManager_Class/Reference/CBPeripheralManager.html
If you're using standard Bluetooth (i.e. not Bluetooth LE or Bluetooth Smart or whatever you want to call it), you'll need to enroll in the MFI program or work with an MFI certified device (such as a Redpark cable) and use the External Accessories library provided by Apple. If you're using Bluetooth LE, you can use the Core Bluetooth library provided by Apple. If you fall into neither of those cases, sorry, you can't use Bluetooth on iOS.

IPhone Bluetooth Connectivity to Non IOS Devices

I was wondering, if there is a way to use IPhone as an HID device, with some other device like PS3. I checked out the Bluetooth specification and IOS Devices do support HID Profile. So I thought it would be easy to pair my iPhone using passkey mechanism and should be able to start using my iPhone as keyboard or mouse without much hassle. But I found very soon that this assumption is naive and I need to develop custom solution.
I was initially thinking about using GameKit framework, but I think it only works between two compatible IOS Devices. If I want to extend this capability, then I have to use iPhone External Accessory API .In my analysis, I also found that iPhone will only communicate and pair with devices that are licensed by Apple. (Made for iPhone\iPod program). Does it mean that, if I want to use iPhone with another device, I need to get that device approved by Apple. ( Which will not surprise me one bit). Also if someone could point me to more detailed documentation on this, that will also be helpful.( What is an MFI developer board ??)
I do not want a solution that needs me to jailbreak an iPhone. (or any solution that will disqualify my app by Apple).
So to summarize:
1- Please validate my findings, correct them if they are wrong?
2a- How does External Accessory API Work?
b- Can I use this to connect to third party accessories ? (or is this only for accessory developers).
3- Or is there a better solution without using External Accessory API?
Please provide supportive documentation or link if you can. Thank You.
You are unlikely to get on the External accessory program from apple unless you are a big company ( you can try, but I have read this a number of places) . iPhones use a proprietary Bluetooth interface that and hardware must also implement this interface, so not much chance of getting it to connect to any other hardware directly.
Most apps like this (Remote Mouse) for example, connect to your wifi network, and have another application installed on your computer. The iphone can then talk to this application over the wi-fi network, but not bluetooth. I would suggest that the only way I can see this would be possible to to create the server app that you install on a computer on the wi-fi network that then in turn controls the 3rd party device if there is an API that you can use from the desktop app to control the 3rd party device.
This is just what I have found when I researched about this for making an app for iPhone to control a bluetooth watch. I had to jailbreak in the end to replace the bluetooth stack on the iPhone with one that could connect to any hardware device. Not limited by apple.

Resources