cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to see BLE Advertisement

PB S.1
Associate II

Hi,

I am using STM32WB5MMG MCU with the latest FUS V1.2.0 and BLE_Stack_full V1.13.1.

I have my own custom BLE application. After enabling BLE fast advertisement using the API "Adv_Request(APP_BLE_FAST_ADV);", I cannot able to see the advertisement in ST BLE ToolBox Mobile App.

I am getting "BLE_STATUS_SUCCESS" as a return value.

Here I am attaching the code snippet

void Adv_Request(APP_BLE_ConnStatus_t New_Status)
{
  tBleStatus ret = BLE_STATUS_INVALID_PARAMS;
  uint16_t Min_Inter, Max_Inter;
 
  if (New_Status == APP_BLE_FAST_ADV)
  {
    Min_Inter = AdvIntervalMin;
    Max_Inter = AdvIntervalMax;
  }
  else
  {
    Min_Inter = CFG_LP_CONN_ADV_INTERVAL_MIN;
    Max_Inter = CFG_LP_CONN_ADV_INTERVAL_MAX;
  }
 
  // Stop the timer, it will be restarted for a new shot */
  /* Commented out to prevent the adv from ever stopping LP 04_24_2020 */
  //HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id);
 
 
  #if(CFG_DEBUG_APP_TRACE != 0)
    APP_DBG_MSG("First index in %d state \n",
    BleApplicationContext.Device_Connection_Status);
  #endif
  
  if ((New_Status == APP_BLE_LP_ADV)
        && ((BleApplicationContext.Device_Connection_Status == APP_BLE_FAST_ADV)
            || (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_ADV)))
  {
      /* stop any current advertising */
      ret = aci_gap_set_non_discoverable();
      if (ret == BLE_STATUS_SUCCESS)
      {
        DmConsolePrintf("BLE: Successfully Stopped Advertising \r");
        #if(CFG_DEBUG_APP_TRACE != 0)
          APP_DBG_MSG("Successfully Stopped Advertising\n");
        #endif
      }
      else
      {
        DmConsolePrintf("BLE: Stop Advertising Failed | result: %d \n\r", ret);
        #if(CFG_DEBUG_APP_TRACE != 0)
          APP_DBG_MSG("Stop Advertising Failed , result: %d \n", ret);
        #endif
      }
  }
 
  BleApplicationContext.Device_Connection_Status = New_Status;
  /* Start Fast or Low Power Advertising */
    
  /* start the advertising */
  /* modified to not sent the local name and send the adv uuid */
  /* adv type changed to ADV_SCAN_IND to respond to scans LP 11-21-2019 */
  ret = aci_gap_set_discoverable(
        ADV_IND,
        Min_Inter,
        Max_Inter,
        PUBLIC_ADDR,
        NO_WHITE_LIST_USE, 
        0,
        NULL,
        sizeof(advertisement_uuid),
        advertisement_uuid,
        0,
        0);
    
  /* Update the advertising data with the manf specific data */
  ret = aci_gap_update_adv_data(sizeof(manuf_data), (uint8_t*) manuf_data);
 
  if (ret == BLE_STATUS_SUCCESS)
  {
      if (New_Status == APP_BLE_FAST_ADV)
      {
         DmConsolePrintf("BLE: Successfully Start Fast Advertising \n\r");
         APP_DBG_MSG("Successfully Start Fast Advertising\n" );
         
         /* Start Timer to get the timeout for advertising stop */
         /* Commented out to prevent the adv from ever stopping LP 04_24_2020 */
         // HW_TS_Start(BleApplicationContext.Advertising_mgr_timer_Id, INITIAL_ADV_TIMEOUT);
      }
      else
      {
        DmConsolePrintf("BLE: Successfully Start Low Power Advertising \n\r");
        #if(CFG_DEBUG_APP_TRACE != 0)
          APP_DBG_MSG("Successfully Start Low Power Advertising\n");
        #endif
      }
  }
  else
  {
      if (New_Status == APP_BLE_FAST_ADV)
      {
        DmConsolePrintf("BLE: Start Fast Advertising Failed | result: %d \n\r", ret);
        #if(CFG_DEBUG_APP_TRACE != 0)
          APP_DBG_MSG("Start Fast Advertising Failed , result: %d \n", ret);
        #endif
      }
      else
      {
        DmConsolePrintf("BLE: Start Low Power Advertising Failed | result: %d \n\r", ret);
        #if(CFG_DEBUG_APP_TRACE != 0)
          APP_DBG_MSG("Start Low Power Advertising Failed , result: %d \n", ret);
        #endif
      }
    }
 
  return;
}
 
 
/*where as
uint8_t advertisement_uuid[] = { ZUM_ADV_UUID_ARRAY };
#define ZUM_ADV_UUID             0x75,0x63,0x9f,0x14,0xd1,0x3b,0x83,0xb2,0xb4,0x47,0xbb,0x87,0xd0,0x0e,0xA3,0x79
#define ZUM_ADV_UUID_ARRAY       AD_TYPE_128_BIT_SERV_UUID_CMPLT_LIST, ZUM_ADV_UUID */

7 REPLIES 7

"I cannot able to see the advertisement in ST BLE ToolBox Mobile App"

Can you see it in any other BLE scanner apps?

Hi Andrew,

Even with the other scanner apps also I cannot able to see it.

Did you tried lightblue ble?

we dont need to firmware by ourselves, lets talk
PB S.1
Associate II

Hi Javier,

Even I tried lightblue ble app, but not able to see advertisement

Remy ISSALYS
ST Employee

Hello,

When you say "I am getting "BLE_STATUS_SUCCESS" as a return value." , you have check the return value of aci_gap_set_discoverable command ?

Best Regards

Hi,

I checked the return value of both "aci_gap_set_discoverable" and "aci_gap_update_adv_data". Both of them are giving "BLE_STATUS_SUCCESS" as a return value.

Remy ISSALYS
ST Employee

Hello,

If you take an application available in STM32CubeWB package, are you able to see advertising data ? For example, you can try with BLE_p2pServer example.

Best Regards