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.

HCI_LE_SetHostChanClassificationCmd failed



Hi,

I add below code in the simpleCentral project: 

#define LL_NUM_BYTES_FOR_CHAN_MAP   5

typedef struct
{
  uint8 chanMap[ LL_NUM_BYTES_FOR_CHAN_MAP ]; // bit map corresponding to the data channels 0..39
} chanMap_t;

static chanMap_t chanMap;

chanMap.chanMap[0] = 0x00;
  chanMap.chanMap[1] = 0xff;
  chanMap.chanMap[2] = 0xff;
  chanMap.chanMap[3] = 0xff;
  chanMap.chanMap[4] = 0x00;
  HCI_LE_SetHostChanClassificationCmd(chanMap.chanMap);

 

but I found the channel map is still 0x1f 0xff 0xff 0xff 0xff in ADV_CONNECT_REQ packet.  

what's wrong?

  • Hello Dan,

    Check the return value of your call to make sure it was successful.

    Do you wait for the returned HCI_CommandCompleteEvent to verify that the change was successful?

    You can catch this by adding a case for the specific returned HCI_CommandCompleteEvent in SimpleBLECentral_processCmdCompleteEvt:

    static void SimpleBLECentral_processCmdCompleteEvt(hciEvt_CmdComplete_t *pMsg)
    {
      switch (pMsg->cmdOpcode)
      {
        case HCI_READ_RSSI:
            ...
        case HCI_LE_SET_HOST_CHANNEL_CLASSIFICATION:
            ...

    The return parameters are given in Vol 2, Part E of the BT4.2 Core Specification: 7.8.19  LE Set Host Channel Classification Command.

  • Hi, Eirik:Thanks.
    Where should I call "HCI_LE_SetHostChanClassificationCmd(chanMap.chanMap)"?
    I called it in SimpleBLECentral_init,The function return value is 0x00, but no HCI_LE_SET_HOST_CHANNEL_CLASSIFICATION event generated.
    I called it before GAPCentralRole_EstablishLink(), it returned 0x00, and generated HCI_LE_SET_HOST_CHANNEL_CLASSIFICATION event ,
    but the channel map was still 0x1f 0xff 0xff 0xff 0xff in ADV_CONNECT_REQ packet.
  • Hello Dan,
    Try updating the channel map in SimpleBLECentral_processRoleEvent()-> case GAP_DEVICE_INIT_DONE_EVENT. Then wait for the complete event before you call GAPCentralRole_EstablishLink().
  • Hello Eirik,
    I have done as you said,but it is same as before,the channel map is still 0x1f 0xff 0xff 0xff 0xff in ADV_CONNECT_REQ packet.
    Should I define CTRL_CONFIG and INIT_CFG?Best RegardsDan
  • Hello Dan,

    I think the problem is, the place where you called the function. I followed the same steps as you and observed the same problems. However when I called the HCI_LE_SetHostChanClassificationCmd(chanMap.chanMap) function after the connection established, I achieved to filter some of the data channels out and observed only 3 data channels on the sniffer. I called the function in SimpleBLECentral_handleKeys, down button after the connection established.

    I think one of the GAP functions is changing your settings...

    Thanks
  • Hello Dan,
    Those defines are already set when you are defined as central (-DHOST_CONFIG=CENTRAL_CFG). What was the return parameters of the HCI_LE_SET_HOST_CHANNEL_CLASSIFICATION event?
  • Hello, ONURRR:Thanks.
    As you said,I called the function after the connection established,then I catched the channel map update packet on the sniffer,and it worked as I set.
    Best RegardsDan
  • Hello Eirik:Thanks.
    The return parameters(pMsg->pReturnParam) of the HCI_LE_SET_HOST_CHANNEL_CLASSIFICATION event I got as below:
    000F0020040006FE0400B0008480...I don't know what that mean.Best RegardsDan
  • Check only the following single Octet (byte):
    int8 retParam = (int8)pMsg->pReturnParam[0];
    Against the "1.3 LIST OF ERROR CODES" table in the BT4.2 Core Specification. If it is 0x00 it was successful and should have worked (I will then have to dig a little deeper for you), if not then find the matching error code in the table.
  • Hi,Eirik,
    Thanks.

    Best Regards

    Dan