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.

Compiler/CC2564: How to send keyboard data through HID protocol?

Part Number: CC2564

Tool/software: TI C/C++ Compiler

HI, I use the TI HIDdemo of CC2564B of STM32,Now I set the cc2564 module to devie,The cc2564module has been connected to the mobile phone。At the same time, I changed HIDdemo program to keyboard mode, and now it has been successful, as shown in the figure below (my Bluetooth device name is cm900-191030003). My question is how to send data through "dataWrite"?

  • Hello,

    Please refer to our HIDDemo wiki for how to use the HIDDemo example. There is a demo in the beginning of how to setup connection and later it uses DataWrite.

    Jesu

  • Hi,:

            Thank you for your answer. Hiddemo wiki is about mouse mode. It uses dataWrite to move the mouse. Now I have changed the mouse mode in HidDemo to keyboard.

            My question is how to realize data transmission through keyboard mode in HIDDemo?

  • Hi,Jesu:

               In the《CC2564 HFP / HID / SPP Integration Demonstration》 guidance document :

    www.ti.com/.../swra637.pdf

    The HID is based on the SPP profile to send and receive the HID key event and data. Thus, the user can
    combine those two profile demonstrations into one scenario, as shown in the following steps. Type the
    following commands listed:
    1. Set Server Mode.
    2. Set Local Name Rio_HID_SPP.
    3. Connect the Rio_HID_SPP from an Android phone.
    4. Launch any Text Editor tool.
    I have implemented the first three steps above, but I have some problems in step 4: when there is a command in the screenshot, HID_Data_Write“”. I can't find this command in  the  demo of HID/SPP. Please provide the relevant program of  HID_Data_Write?
  • Hello,

    I closed the other thread you created about this issue. I am meeting with our BT expert tomorrow and will give you a response on this tomorrow as well.

    Jesu

  • Hello,

    I thought you were working from the HIDDemo. You are working off of some combined HID/SPP demo? 

    I'm not familiar with this demo you're working with but if you want to add HID_Data_Write you read below.

    HID_Data_Write is part of the HID profile library in the Bluetopia folder of the SDK. The actually implementation of HID_Data_Write is not available but you could include HIDAPI.h in your application and link the library file in the HID profile folder in the Bluetopia folder mentioned earlier. If you get stuck doing this please let me know.

    Also, how did you modify the example to work with keyboard. Did you add a keyboard report descriptor and register it to the SDP database? Please share with the rest of the community.

    Jesu

  • Hi,Jesu:                  

          We are developing a product which communicates with CC2564 Bluetooth chip. The CC2564 +  STM32F4 is adopted for the product. At present, the product can send the data collected by  STM32 to the mobile phone through spp protocol. Next, the data collected by STM32 is sent  to  the mobile phone through HID protocol.The two protocols are selected by pressing the  key, and the user selects different protocols according to the actual needs to achieve data  communication. Now I have Merged  HIDDemo to SPPDemo, and I  have realized the Bluetooth connection of HID protocol by modifying the following four steps.    

            1、add a keyboard report descriptor

            2、

    Descriptor.DescriptorLength=sizeof(KeyboardReportDescriptor)

    Descriptor.Descriptor  = KeyboardReportDescriptor  

           3、Change the general mouse report value 0x02 to the keyboard report value 0x06 as  follows:static Byte_t GenericMouseReport[] ={0x06, 0x80, 0x50, 0x00}

            4、Add HID related library files and call functions in SPPDEMO's project.    

            Through the above four steps,I changed HIDdemo program to keyboard mode, and now it has been successful,  As shown in the picture in the first question(my Bluetooth device name is cm900-191030003).                                                                                  

           My question now is:

    How to modify the HIDDataWrite in HIDDEMO so that the collected data can be sent to the mobile phone through the HID keyboard?

  • Hi, Jesu:

          Please reply to my question as soon as you see it. I've developed it for several days, but I still haven't made progress。thank you!