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.

LAUNCHXL-CC2640R2: LAUNCHXL-CC2640R2 RSSI reading

Part Number: LAUNCHXL-CC2640R2

I am using simplelink sdk 1_40_00_45 simple central example on LAUNCHXL-CC2640R2.And want to read rssi as per user (my master) command.I have implemented all the related logic, as after scanning I have store the result & send it to user after that i have clear the result.whenever user again want rssi data new result should load.All this is working fine only if user demand data after 6sec of time interval.I want to workout it for even 1 sec of time period.when i am trying to read data after 1 sec it shows wrong result. Is there any setting for fast reading so that i can get updated result after every 1 sec.

I have done the following changes:

- After discovery completed again call StartGapDiscovery(); 

- result load in SimpleBLECentral_addDeviceInfo1().

static void SimpleBLECentral_processRoleEvent(gapCentralRoleEvent_t *pEvent)
{
     switch (pEvent->gap.opcode)
     {
              case GAP_DEVICE_INIT_DONE_EVENT:
               {
                 //maxPduSize = pEvent->initDone.dataPktLen;

                }
               break;

              case GAP_DEVICE_INFO_EVENT:
              {
                    SimpleBLECentral_addDeviceInfo1(pEvent->deviceInfo.addr,pEvent->deviceInfo.addrType,pEvent->deviceInfo.rssi); 

               }

              break;

              case GAP_DEVICE_DISCOVERY_EVENT:
              {
                   if (gapPendingCancelScan)
                   {
                       gapPendingCancelScan = false;
                        break;
                    }
                   // discovery complete
                   scanningStarted = FALSE;

                  SimpleBLECentral_startGapDiscovery();

                  scanRes = pEvent->discCmpl.numDevs;

              }
              break;

             default:
             break;
         }
}

  

static void SimpleBLECentral_addDeviceInfo1(uint8_t *pAddr, uint8_t addrType, int8 rssi)
{
         uint8_t i;

        // If result count not at max
        if (scanRes < DEFAULT_MAX_SCAN_RES)
        {
             Display_print1(dispHandle, 20, 0, "Devices Found %d", scanRes);
             if(scanIdx >= scanRes)
             scanIdx = 0;
             else
             scanIdx++;

            // Check if device is already in scan results
            for (i = 0; i < scanRes; i++)
            {
                        if (memcmp(pAddr, devList[i].addr , B_ADDR_LEN) == 0)
                       {
                             return;
                       }
             }

// Add addr to scan result list
memcpy(devList[scanIdx].addr, pAddr, B_ADDR_LEN);
devList[scanIdx].addrType = addrType;
rssiList[scanIdx].rssi = rssi;


// Increment scan result count
//scanRes++;

         }
}

  • Hi Bhakti,

    Are you scanning continuously or starting a new scan when you want a new RSSI value?

    Also, you will eventually need to update to a newer SDK because Bluetooth SIG changed their qualification process. Please see the sticky post: 

    Can you update to SimpleLink CC2640R2 SDK 3.20 or newer and retest?

  • Hello Marie,

    Thanks for the reply....

    As per my understanding GAP_DEVICE_DISCOVERY_EVENT comes when discovery process completed....thats why i put  SimpleBLECentral_startGapDiscovery() routine in GAP_DEVICE_DISCOVERY_EVENT.

    so whenever my discovery get completed i am again start a new scan,and i expecting latest value of rssi from each new scan event...

    (I have already workout with the old sdk only this one minor issue remains in the code for fast scanning)

    Any guidance to solve this issue....? 

  • Hi Bhakti,

    Apologies for the delay.

    Yes, GAP_DEVICE_DISCOVERY_EVENT is sent from the stack when the discovery process is complete. 

    I would recommend you to port your application to the latest SDK as there have been multiple updates and fixes. See http://dev.ti.com/tirex/explore/node?node=AAafBKylj8ra01461K-lnQ__krol.2c__LATEST for more information.

    Thanks, 
    Elin