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_VS_Read_RSSI returns error 0x02

Other Parts Discussed in Thread: CC2564

Using hcitool (running bluez 4.84 stack) to query the raw RSSI always returns an error 0x02 and 0x00 for the RSSI. I have tried this with an active serial port open over bluetooth, as well as without. See below.

{/} # hcitool cmd 0x3F 0x1FC 0xAB 0xAB
< HCI Command: ogf 0x3f, ocf 0x01fc, plen 2
  AB AB
> HCI Event: 0x0e plen 7
  01 FC FD 02 AB AB 00

Other commands work fine, for example reading the hardware address:

{/} # hcitool cmd 0x04 0x009
< HCI Command: ogf 0x04, ocf 0x0009, plen 0
> HCI Event: 0x0e plen 10
  01 09 10 00 DE 5A B9 FE FF B8

Any ideas why I cannot read the RSSI?

  • I should add that we are using the CC2564 with bluetooth_init_cc2564_2.10.bts service pack downloaded from http://processors.wiki.ti.com/index.php/CC256x_Downloads

  • This is solved, I was not specifying the correct connection handle in the HCI command.

  • I'm having the same problem, and I wonder what the correct connection handle is.

    I am using the Bluetopia core, and I am using the result Connection Handle returned by the API call GAP_Query_Connection_Handle(). It is a 16-bit word, so I tried both little endian and big endian packing, but both times I get status code 2, an echo of the 2-bytes of the Connection Handle and RSSI=0.

     

    Byte_t Command_OGF = (HCI_VS_Read_RSSI>>10);
    Word_t Command_OCF = (HCI_VS_Read_RSSI & 0x3FF);
    Byte_t Command_Length = 2;
    Byte_t Command_Data[2];
    Byte_t StatusResult;
    Byte_t BufferResult[100];
    Byte_t LengthResult = sizeof(BufferResult);
    Boolean_t WaitForResponse = 1;
    // Command_Data[0] = connectionHandle >> 8;
    // Command_Data[1] = connectionHandle & 0xFF;
    Command_Data[1] = connectionHandle >> 8;
    Command_Data[0] = connectionHandle & 0xFF;
    memset(BufferResult,0xEE,sizeof(BufferResult));
    
    
    if (0== HCI_Send_Raw_Command(BluetoothStackID, Command_OGF, Command_OCF, Command_Length, Command_Data, &StatusResult, &LengthResult, BufferResult, WaitForResponse))
    {
     
     Display(("VS_RSSI (%d): stat=%x data=%x %x %x %x\r\n",LengthResult, StatusResult, BufferResult[0], BufferResult[1], BufferResult[2],BufferResult[3]));
    }
    else {
     Display(("HCI_Send_Raw_Command failed\r\n"));
    }