How to move cursor in Mac OSX through Bluetooth LE? - ios

I am working on iOS app which is similar to Apple Magic Mouse, function of which is to mirror the gestures on the iOS device to the Mac after establishing connection between them using Bluetooth LE.
I've purchased a new HID bluetooth dongle and managed to set up connection using CoreBluetooth Framework for the last whole week.
However, completely no idea on what data of which format should be sent from the iOS device to reflect the gestures.
I've gone over the many tutorials and demos, but still no idea.
Please help me with the solution like the APIs or anything.
Thank you.

Related

Bluetooth iOS Windows

I recently developed an application for a client, an app iOS, Android and windows, the mobile app acts as a controller and launches certain events on the windows application. The Windows application also shares data at random (not known to the mobile app) moments. The communication was done by TCP. And works great.
The client now wants it for bluetooth. Between Android and Windows, it's not been a problem and has been done, and works well. But iOS is sadly not the same story... The use of Bluetooth low energy seems to complicate things.
I've hunted high and low on google to find anything on communication between a .net application and a Swift application, to no avail. This surprises me that no one talks of a bluetooth communication between Windows and iOS.
My question is, very simply. Is it possible? I know very little about bluetooth and I've tried researching devices and all I find is a BeeWi device that's in our office, not my computer (I maybe need to launch something on computer first? The devices are paired)
My computer has a Bluetooth 4.0 dongle and the BLE emulator is present in the Device manager.
If this isn' possible, tell me know and put me out of my misery, otherwise give me hope!
Any additional advice is warmly welcome - Thank you all !
Beau Carrel
Windows has support for being a BLE client. Just Google it and you'll find many examples, such as https://developer.microsoft.com/en-us/windows/iot/Samples/BLEGatt2.
You need to set up iOS to be an advertising peripheral.

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

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.

Inter App Communication between iOS App and Atmega 1284 microprocessor via bluetooth

What I am trying to accomplish:
User enters a password on the iOS app. If the password is correct, then send a one bit value to the microprocessor that indicates the user got the right password. The microprocessor can then start up the step motor to open the door latch.
Has anyone tried to achieve this before? If so, can you please point me in a general direction. I don't know how to approach this problem. I couldn't really find a tutorial for this. My questions are:
Is there a specific Bluetooth I need to purchase? such as only BLE devices
I see a lot of examples of Bluetooth communication between iOS and Ardunio. Would the execution of events be similar for my needs?
Is there another approach to my problem? rather than using Bluetooth?
I think reading the Core Bluetooth Programming Guide is a great start. However, this assumes the device you're connecting to is using Bluetooth 4.x which is widely known as Bluetooth Low Energy (BLE). If the device you're connecting to is using Bluetooth 2.x, you'll have to use the External Accessories Framework.
EA supports only devices that have been certified MFI (Made for iPhone) by Apple.
To make a long story short, if the device you're trying to connect to is Bluetooth 2.x and it's not MFI, you're basically SOL.
Otherwise, you can start connecting to that device pretty easily. Check out LightBlue as a way to test if you connect to the device. It will work with any BLE device.
Here's a simple tutorial to get you going with Core Bluetooth.

Bluetooth Low Energy Emulate Keypress

I am playing around with a TI CC2541 chip, and was wondering if it is possible to send a "keypress" over BLE. This would be similar to the new Muku Shutter for iOS and Android, because I am trying to figure out a way to interface with a mobile device without installing a 3rd party application. Essentially, I would press the button on the CC2541 chip, and then it would emulate a keypress of volume up?
I have been researching for a while now, and all solutions to handle this have included writing a 3rd party application to map the commands in the BLE packet to a system command.
Any help would greatly be appreciated. Thank you!
On iOS the answer is no
Edit:
Exception: You might be able to set up your BT chip as a Bluetooth keyboard.
You could certainly write an app that talks with a remote BLE device and uses an agreed-upon protocol to pass key presses to your app, and then you could interpret those messages using code in your app.
However, Apple enforces a "sandbox" on its apps, and apps are not allowed to interact directly with the system except through very tightly controlled set of APIs. If there is not an official interfere to do something, it is not allowed.
If you were to run on a jailbroken device then the answer would likely be different. I can't help you there however.
Edit:
#OliverMason says in a comment that iOS shutter buttons are apparently single-key BlueTooth keyboards that emulate the volume up button, which the camera app recognizes as a way to trigger a photo. Thus my answer above isn't quite accurate.

Bonjour not advertising over BT

I've been banging my head against this for the last week or so. I've already gone through the following resources:
StackOverflow: Bonjour over bluetooth WITHOUT Gamekit ? (3844189)
StackOverflow: How does Bonjour Over Bluetooth Work (3350094)
StackOverflow: Using iOS GameKit's “Bluetooth Bonjour” with other platforms (8070998)
Technical Q&A QA1753 -- Apple Developer
WiTap sample application
SRVResolver sample application
DNSSDObjects sample application
I'm using Mac OS 10.7, Xcode 4.5, an iPhone 4 with iOS 6, and an iPad 1 with iOS 5.1.1.
My problem is this: I am modifying an application that currently uses GameKit's peer picker to connect between an iPad and a iP{hone|od touch}. We want to modify this to use Bonjour over Bluetooth instead because we've had issues with reconnecting the devices using Gamekit if the connection is lost. I've used dns_sd.h API to some success and have gotten the service to advertise and resolve over wifi, but even though I am passing kDNSServiceFlagsIncludeP2P I am not getting any success over bluetooth.
I thought possibly Bluetooth Bonjour need a PAN established between devices already, but even pairing the iPad to the iMac and browsing for DNS-SD services gives me nothing...and the iPhone won't pair to the iPad anyway.
I just finished solving this in my own app in the last 24 hours. I used the core classes from the OS X sample app DNSSDObjects. I only had to change three lines of code to add support for bluetooth. This works great in my iOS app.
In DNSSDBrowser.m, the call to DNSServiceBrowse needs to have kDNSServiceFlagsIncludeP2P passed in for the 2nd parameter.
In DNSSDRegister.m, the call to DNSServiceRegister needs the same change.
In DNSSDService.m, the call to DNSServiceResolve also needs the same change.
If you want to limit yourself to just bluetooth, and not WiFi, then the same three lines of code should be updated so the 3rd parameter is kDNSServiceInterfaceIndexP2P instead of kDNSServiceInterfaceIndexAny.
Indeed, it looks like the kDNSServiceInterfaceIndexP2P flag won't work on OSX.
If you run the code on IOS, you'll notice that Bonjour will publish two IP Adresses: one for your local WiFi network, and an 169.xx.xx.xx adress for Bluetooth.
The same code on OSX never publishes the 169.xx.xx.xx adress, so it's only found over WiFi.

Resources