2 Replies Latest reply on Dec 25, 2016 3:37 PM by andy.cheng

    HID over GATT

    andy.cheng

      I am currently working with my first HID over GATT project.  I am using the sample code for HID Keyboard as the starting point.  However, I am unable to understand two things:

         

      1. The 8 bytes of data I send out using CyBle_HidssSendNotification.  What do they mean?  Where can I find the specification?

         

      2. How do I know when I can send another key?  For example, if I want to send the string "Hello" what should I do?  I tried sending via subsequent calls but only the first one arrive.

         

      Thank you.

        • 1. Re: HID over GATT
          hima

          Hello,

             

          1)Are you referring to the HID keyboard example? In that case 8 bytes is the standard number of bytes which will be sent to host in case of all standard keyboards. If you want details on what each bytes means , please have a look at "AN58726"(Link:http://www.cypress.com/documentation/application-notes/an58726-usb-hid-intermediate-psoc-3-and-psoc-5lp) section: 2.1 Data Sent to the Host.

             

          2) If you have a look at the example project , we have added a small timer KEYBOARD_TIMEOUT. Inside SimulateKeyboard() there is condition 

             

          if((CyBle_GattGetBusyStatus() == CYBLE_STACK_STATE_FREE) && (--keyboardTimer == 0u))

             

          this will ensure that the next data can be sent.

             

          Thanks,

             

          Hima

          • 2. Re: HID over GATT
            andy.cheng

            Hi Hima, thank you for the information.  Will definitely look at the doc.  It is great that there is a timeout on the HID example, this means I can simply make a buffer to store the keys I like to send, and store an index to let the keys out in sequence.