2021-08-31 12:25 AM - last edited on 2024-07-31 03:10 AM by Andrew Neil
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() */
}
2021-10-21 06:03 AM
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:
2021-10-22 03:19 AM
The issue is solved
2021-10-22 03:21 AM
Can I know how did you solve it?
2021-10-22 03:26 AM
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
2021-10-22 04:40 AM
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
2021-10-28 08:51 AM
What is the issue you are facing ? is it advertised in Android App ?
2021-11-10 08:32 AM
Is it started working in Ibeacon Configuration
2024-07-31 03:08 AM
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");
}
}