0
votes

I would like to make an app that accepts click events from two real-world buttons. Imagine two-player Flappy Bird that is controlled by a button you can hold.

I will be using CoreBluetooth for this project and Bluetooth Low Energy (BLE, "Bluetooth Smart"). Documented here https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/AboutCoreBluetooth/Introduction.html#//apple_ref/doc/uid/TP40013257-CH1-SW1

Is there a preferred type of physical device and bluetooth device profile I should be considering in choosing the button to use in conjunction with this app?

1

1 Answers

1
votes

The standard set of BT4.0 services are listed here

The HID service is probably the closest to the device your are describing, but this is probably more complicated than you need for two buttons. I would just define my own service and characteristics to represent the button status.

It also depends on the hardware you are using to implement the peripheral. There are a number of off-the-shelf BLE devices that present a "serial port" via a couple of attributes. You could use one of these and simply send characters that report the up/down status of the buttons.