Skip to main content
Snara.21
Senior
August 31, 2021
Question

What is the issue if the aci_gap_set_discoverable is failed.

  • August 31, 2021
  • 6 replies
  • 2401 views

I am reading the "dm00294449-bluenrg-1-bluenrg-2-ble-stack-v2-x-programming-guidelines-stmicroelectronics.pdf " and created the coding accordingly. The recommended coding

 

 

void bluenrg_process(void)

{

 

tBleStatus ret;

 

//uint8_t local_name[] = {AD_TYPE_COMPLETE_LOCAL_NAME,'B','L','E','-','G','U','P'};

//const char local_name[] = {AD_TYPE_COMPLETE_LOCAL_NAME,'B','L','E','-','G','-','U','P'};

const char local_name[]=

{AD_TYPE_COMPLETE_LOCAL_NAME,'B','l','u','e','N','R','G','1','T','e','s',' t'};

 

/* Set device in General discovereable mode */

/*

* tBleStatus aci_gap_set_discoverable(uint8_t Advertising_Type,

                  uint16_t Advertising_Interval_Min,

                  uint16_t Advertising_Interval_Max,

                  uint8_t Own_Address_Type,

                  uint8_t Advertising_Filter_Policy,

                  uint8_t Local_Name_Length,

                  uint8_t Local_Name[],

                  uint8_t Service_Uuid_length,

                  uint8_t Service_Uuid_List[],

                  uint16_t Slave_Conn_Interval_Min,

                  uint16_t Slave_Conn_Interval_Max)

*

*/

//ret = aci_gap_set_discoverable(ADV_IND, 0, 0,

// PUBLIC_ADDR,

// NO_WHITE_LIST_USE,

// sizeof(local_name),local_name, 0, NULL, 0, 0);

 

ret = aci_gap_set_discoverable(ADV_IND, 100, 100, PUBLIC_ADDR,

NO_WHITE_LIST_USE, sizeof(local_name),

local_name, 0, NULL, 0, 0);

 

 

if (ret != BLE_STATUS_SUCCESS)

{

prnt("aci_gap_set_discoverable: FAILED !! [%x]\r\n");

}else {

prnt("aci_gap_set_discoverable OK\r\n");

} /* end GAP_Peripheral_Make_Discoverable() */

 

}

 

 

    6 replies

    Pgonz.1
    Associate II
    October 21, 2021

    Hi, I also have the same problem, did you solve it?

    I tried to debug and the value of ret here "ret != BLE_STATUS_SUCCESS" is 0x46 for me.

    I have no idea why, it should be one of this values: 0693W00000FDJ5fQAH.png

    Snara.21
    Snara.21Author
    Senior
    October 22, 2021

    The issue is solved

    Pgonz.1
    Associate II
    October 22, 2021

    Can I know how did you solve it?

    Snara.21
    Snara.21Author
    Senior
    October 22, 2021

    I have changed the logic and the sequence, not followed this.. Some code sample similar to discoverable details and some from non-discoverable application notes. I changed to Ibeacon configuration and started working

    Pgonz.1
    Associate II
    October 22, 2021

    This is a new field for me, not sure if I would be able... I can see the device, I created services and characteristics but for some reason, ret is not 0x00. So when I try to upload data I can't because it gets stacked on that if.

    Any documentation or examples I can follow, tutorials... Anything, I don't know where to start

    Snara.21
    Snara.21Author
    Senior
    October 28, 2021

    What is the issue you are facing ? is it advertised in Android App ?

    Snara.21
    Snara.21Author
    Senior
    November 10, 2021

    Is it started working in Ibeacon Configuration

    ATeli.1
    Associate III
    July 31, 2024

    Can you explain me what you changed in this piece of code:

    void bluenrg_process(void)
    {
     tBleStatus ret;
    
     uint8_t local_name[] = {AD_TYPE_COMPLETE_LOCAL_NAME, 'B', 'L', 'E', '-', 'G', 'U', 'P'};
    
     // Set device in General Discoverable Mode with non-zero advertising interval
     ret = aci_gap_set_discoverable(ADV_IND, 100, 100, PUBLIC_ADDR, NO_WHITE_LIST_USE, sizeof(local_name), local_name, 0, NULL, 0, 0);
     if (ret != BLE_STATUS_SUCCESS)
     {
     printf("aci_gap_set_discoverable: FAILED! Error code: 0x%02X\r\n", ret);
     }
     else
     {
     printf("aci_gap_set_discoverable: SUCCESS!\r\n");
     }
    }