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.

How to set "Minor Device Class field " ?

hello!

My application is based on HOGP Demo. i wish to change my class of device from keyboard (the current state it is in) to pointing device.

Where in the code can i do this? is it done during start up / initialization ?

thanks.

  • Hi , Your query has been assigned to BT expert. We will get back to you shortly
    Saurabh
  • Hi Yuri,

    You can use the HIDS_FLAGS_SUPPORT_MOUSE as the flag in the HIDS_Initialize_Service() API instead of the HOGPDemo default HIDS_FLAGS_SUPPORT_KEYBOARD.

    For reference, you can find all the possible flag values in the HIDSAPI.h

    Best regards,
    Vihang
  • Hi  Vihang!

    Will try this and get back to you ASAP.

    thanks.

  • Hi Vihang!

    The value of the flag in the HID initialization: 

     HIDS_Initialize_Service(ApplicationStateInfo.BluetoothStackID, HIDS_FLAGS_SUPPORT_MOUSE, &HIDInformation, 0, NULL, 0, NULL, (sizeof(ReportReferenceData)/sizeof(HIDS_Report_Reference_Data_t)), ReportReferenceData, _BLE_HIDS_Event_Callback, 0, &ServiceID);

     has been change long time ago to the value of: HIDS_FLAGS_SUPPORT_MOUSE . so perhaps i wasn't asking correctly. 

    I am referring to table 9 values on this page:   

    Currently our device reports are of class device 0x540, which is Peripheral – keyboard. We need to change it  to 0x580 which is Peripheral – pointing device.

    thanks.

  • Hello,

    Please make the following changes to get the device reported correctly -

    all changes in 'HOGPDemo.c' -

     

    a) In function, 'ConfigureHIDS()', Initialize for Mouse -

       ret_val = HIDS_Initialize_Service(ApplicationStateInfo.BluetoothStackID, HIDS_FLAGS_SUPPORT_MOUSE, &HIDInformation, 0, NULL, 0, NULL, (sizeof(ReportReferenceData)/sizeof(HIDS_Report_Reference_Data_t)), ReportReferenceData, HIDS_Event_Callback, 0, &ServiceID);

     

    b) Set the device apperance to MOUSE in 'OpenStack()' -

          GAPS_Set_Device_Appearance(ApplicationStateInfo.BluetoothStackID, ApplicationStateInfo.GAPSInstanceID, GAP_DEVICE_APPEARENCE_VALUE_HID_MOUSE);

     

    c) Set Device appearance value in 'FormatAdvertisingData()' -

       ASSIGN_HOST_WORD_TO_LITTLE_ENDIAN_UNALIGNED_WORD(&(Advertisement_Data_Buffer.AdvertisingData.Advertising_Data[Length+2]), GAP_DEVICE_APPEARENCE_VALUE_HID_MOUSE);

    Thanks

  • Hello!

    Thanks for your response,

    A and B were already in order, C needs to change. 

    As soon as i am done testing this i will confirm the answer.

    thanks again.

  • Hi, seems to be working fine.
    thank you very much!