cancel
Showing results for 
Search instead for 
Did you mean: 

What is the issue if the aci_gap_set_discoverable is failed.

Snara.21
Senior

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() */

 

}

 

 

8 REPLIES 8
Pgonz.1
Associate II

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
Senior

The issue is solved

Can I know how did you solve it?

Snara.21
Senior

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

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
Senior

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

Snara.21
Senior

Is it started working in Ibeacon Configuration

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");
    }
}