This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

HID Keyboard sample application and iPhone native camera application

I try to use the HID Keyboard application to take a picture when the user press the button on the keyfob.

I have tried to send different keyboard events code but no way to fire a picture :(

Any solution for that ?

Fred

  • None that I know of. I'm not sure whether iOS allows control of the camera through HID. If this is the case then you probably would have to create your own service (or use one of our examples) and create an app that uses an API for controlling the camera (again, I'm not sure whether this exists or not).

  • I have tested with a "classic" Apple bluetooth keyboard and I can take picture using the F11 F12 of this bluetooth keyboard.

    So, it seems possible to use external keyboard to take picture with native camera app...

    My point is to know if the sample app provided by TI can be compliant with the HID camera controls...

    By example: serviceUUID used for this demo or other special settings...

  • Hi Fred,

    Hope you don't mind me asking a question here.

    I came across your post at Apple Mailing list (http://prod.lists.apple.com/archives/bluetooth-dev/2014/Apr/msg00027.html), describing a problem similar to mine. I am not in the mailing list (I suppose I need an Apple's developer ID to join).

    I am working on a Play/Pause feature. Actually I had it working on an Android 4.4 device, but just not in iOS. Here is the iOS log:

    Aug 28 12:02:34 Jians-iPhone BTLEServer[1624] <Notice>: (Note ) Connecting peripheral "KBD"...
    Aug 28 12:02:34 Jians-iPhone BTLEServer[1624] <Notice>: (Note ) Peripheral "KBD" is now connected
    Aug 28 12:02:34 Jians-iPhone BTLEServer[1624] <Notice>: (Note ) Peripheral "KBD" supports service "Human Interface Device"
    Aug 28 12:02:34 Jians-iPhone BTLEServer[1624] <Notice>: (Note ) Peripheral "KBD" supports service "Battery"
    Aug 28 12:02:34 Jians-iPhone BTLEServer[1624] <Notice>: (Note ) Peripheral "KBD" supports service "Device Information"
    Aug 28 12:02:34 Jians-iPhone BTLEServer[1624] <Notice>: (Note ) Starting service "Device Information" on peripheral "KBD"
    Aug 28 12:02:35 Jians-iPhone BTLEServer[1624] <Notice>: (Note ) Service "Device Information" has started on peripheral "KBD"
    Aug 28 12:02:35 Jians-iPhone BTLEServer[1624] <Notice>: (Note ) Starting service "Human Interface Device" on peripheral "KBD"
    Aug 28 12:02:38 Jians-iPhone BTLEServer[1624] <Notice>: (Note ) PnP ID for peripheral "KBD": BT / 0x000A / 0x014C / 0x0100
    Aug 28 12:02:39 Jians-iPhone BTLEServer[1624] <Notice>: (Note ) Service "Human Interface Device" has started on peripheral "KBD"
    Aug 28 12:02:39 Jians-iPhone BTLEServer[1624] <Notice>: (Note ) Starting service "Battery" on peripheral "KBD"
    Aug 28 12:02:39 Jians-iPhone BTLEServer[1624] <Notice>: (Note ) Service "Battery" has started on peripheral "KBD"
    Aug 28 12:02:39 Jians-iPhone BTLEServer[1624] <Notice>: (Note ) Battery level for peripheral "KBD": 100%
    Aug 28 12:02:39 Jians-iPhone BTLEServer[1624] <Notice>: (Note ) Battery level for peripheral "KBD": 100%

    On the peripheral side, I saw iOS came to read my report descriptor and also registered for notification at Client Characteristic Configuration Descriptor of this input report. 

    Here is my HID Report descriptor setting:

    05 0C (GLOBAL) USAGE_PAGE 0x000C Consumer Device Page
    09 01 (LOCAL) USAGE 0x000C0001 Consumer Control (CA=Application Collection)
    A1 01 (MAIN) COLLECTION 0x01 Application (Usage=0x000C0001: Page=Consumer Device Page, Usage=Consumer Control, Type=CA)
    85 01 (GLOBAL) REPORT_ID 0x01 (1)
    19 01 (LOCAL) USAGE_MINIMUM 0x000C0001 Consumer Control (CA=Application Collection)
    2A 9C02 (LOCAL) USAGE_MAXIMUM 0x000C029C AC Distribute Vertically (Sel=Selector)
    15 01 (GLOBAL) LOGICAL_MINIMUM 0x01 (1)
    26 9C02 (GLOBAL) LOGICAL_MAXIMUM 0x029C (668)
    95 01 (GLOBAL) REPORT_COUNT 0x01 (1) Number of fields
    75 10 (GLOBAL) REPORT_SIZE 0x10 (16) Number of bits per field
    81 00 (MAIN) INPUT 0x00000000 (1 field x 16 bits) 0=Data 0=Array 0=Absolute 0=Ignored 0=Ignored 0=PrefState 0=NoNull
    C0 (MAIN) END_COLLECTION Application

    And I am setting 0xcd 0x00 and 0x00 0x00 alternatively, which is supposed to toggle the play/pause. The same peripheral firmware works on Android 4.4 but not iOS.  Of course, I tried 0xb0 0x00 also which is supposed to turn on playing.

    Thanks if you have any experience or ideas to share!