Bluetooth Low Energy Emulate Keypress - ios

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.

Related

Bluesmirf HID iOS App - Bluetooth Door lock/unlock

I'm running into a hurdle and not too sure how to tackle it, looking for some help :). I'm trying to make a door lock/unlock mechanism using and arduino UNO and Bluesmirf HID (https://www.sparkfun.com/products/10938). I know similar products already exist that will do all the background work for me but I'm doing this for my own education and iOS app development experience.
Iphone bluetooth profiles are listed on this site (https://support.apple.com/en-us/HT204387). Since the Iphone5 does not support SPP (serial port profile) for bluetooth, my only logical choice is the HID profile (using another profile wouldn't make sense to me but I could be wrong?)
The Bluesmirf HID can operate on many different profiles, including SPP, but I've configured it to HID as that is the only profile that makes sense to me for Iphone communciation? The issue I run into though is that the bluetooth module ONLY communicates to the arduino via serial (rx/tx). So my question then becomes, is it possible to develop an app (setup for HID) that will eventually send critical serial data to the arduino to properly actuate the lock/unlock mechanism on the door? Is this even possible and what other road blocks may I run into?
As for the app development portion, I was planning to start with the apple example of temp/humidity. I THINk it uses BLE setup but I'll need to confirm. Once I got a handle on this I was going to start writing my own code. The ideal GUI I'm looking for would have connect, lock and unlock buttons that basically send data to the bluesmirf module and toggle a GPIO. I can add more features later on like security, etc...
Thanks in advance for any feedback. If this needs to be posted on another forum please let me know!

views, methods and function of ios device from bash

I'm doing a research for my thesis and I would like to know how I can access to the views methods or functions of the user interface(like Android View Client for Android devices) of a ios device from bash without touching the device connected. The reason is that I want to create a self-test for an app and then I would do things like touches or gestures via software. How could i do? Can you give me some guidelines?
must work for devices without jailbreak
Sorry for the bad english.
This is not practical / possible. Instead, you should look into UIAutomation. You can use javascript to simulate all interactions with an app on either actual hardware or in the simulator.

iOS Private API: lock device and power off the screen

I'm making an app for jailbreak that lock the device when the user launch the app. I've tried GSEventLockDevice(); from GraphicsServices.framework but this does not work properly because it locks the screen but does not power off the screen. Is there another way to lock the screen without MobileSubstrate?
Just as another alternative, check out this answer, which uses SBDimScreen(). You could use that in conjunction with GSEventLockDevice().
It appears that you may now (iOS 5+) need to add an entitlement to your app to use this call successfully. If you haven't done that before, here is an example of how to do so. Obviously, in this case, the entitlement in question must be changed to com.apple.backboard.client.
You also might see if #VictorRonin has experimented with this, as he commented on the question I linked to. I tested SBDimScreen() on a jailbroken iOS 4.2.1 device, but my newer devices are currently unavailable to run this test. I'll try it later on iOS 5.x and post an update.
Note: the answer I linked to from Elias has a different call altogether for iOS 6.
Look at these several questions:
Simulating System Wide Touch Events on iOS
Simulating System Wide Touch Events in iOS without jailbreaking the device
How to send a touch event to iPhone OS?
The idea is that you can simulate system wide events. One of events is power down event. If you simulate it, it will turn off device and will lock it.
BTW. You may be interested to google more on GSEvent which is the key for even simulation.
Here are couple of useful links:
http://iphonedevwiki.net/index.php/GSEvent
http://networkpx.blogspot.com/2009/08/gsevent-recording-and-playback-in-30.html
Also, this approach isn't limited to jailbroken phones. It works on jailed phone too (however, you won't be able to post it to AppStore).

iOS app with bluetooth as a trigger

I'm trying to help produce a location-specific iOS app that needs an external trigger to start audio playback when it approaches a given location within the building. (no GPS access)
Has anyone had experience doing something similar? One thought I had was to lay out some bluetooth "transmitters" (like an xbee+arduino) around the building, and if the iPhone's bluetooth was close enough to identify it, it would trigger the audio.
I've never worked with bluetooth or an application of this sort before, so any advice would be much appreciated.
Bluetooth would certainly work, although other methods might, too. The only downside to Bluetooth is that you would either need to work within the APple MFi program for standard Bluetooth or restrict the devices used to the iPhone 4s or later or the iPad 3rd Generation or later so you could use Bluetooth LE (Bluetooth 4.0).
Assuming you can use Bluetooth LE, it's not only possible, Apple demoed one such technology. Once you're signed up as a developer, check out Session 705, Advanced Core Bluetooth, from WWDC 2012. The ending demo is exactly what you're looking for, and the session describes how to do it and provides source code.

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