about the advertise as beacon with SDK5.0

18 posts / 0 new
Last post
liuluan002
Offline
Last seen:3 months 3 weeks ago
加入:2015-11-27 14:24
about the advertise as beacon with SDK5.0

Hi Dialog,

I am trying to make the adverstiement like beacon application for the other Bluetooth device can listen on the air, the issue that I following the guy of the link from your website, but still can not catch the packet for the broadcasting from other bluetooth device by scanning the broadcasting package. Could you please help?

Reference for what I did the same as the following:
http://support.dialog-semiconductor.com/advertisement-complete-callback-...

2-option (the proper one) is to catch the ending of a non connectable advertisement through the catch rest function (user_catch_rest_hndl). You can just place the below code in the user_peripheral.c function:

case GAPM_CMP_EVT:
{
struct gapm_cmp_evt const *msg_param = (struct gapm_cmp_evt const *)(param);
switch (msg_param->operation)
{
case GAPM_ADV_NON_CONN:
user_app_adv_start(); //or whatever you want after completetion
break;

default:
break;
} break;
}

Device:
MT_dialog
Offline
Last seen:1 week 2 days ago
Staff
加入:2015-06-08 11:34
Hi liuluan002,

Hi liuluan002,

You can go to the gapm_cmp_evt_handler() and check with a break point if the callback function of the catch rest function is invoked. If it is invoked check in the switch statement if the correct case is executed. You can always use the first option as well for debugging purposes to check if the GAPM_ADV_NON_CONN is triggered.

Thanks MT_dialog

liuluan002
Offline
Last seen:3 months 3 weeks ago
加入:2015-11-27 14:24
Thank you for your reply.

Thank you for your reply. However I am debugging on your code, however it stops in GLOBAL_INT_STOP(); in the arch_main.c when i run F10 Step over

liuluan002
Offline
Last seen:3 months 3 weeks ago
加入:2015-11-27 14:24
Dear MT_dialog,

Dear MT_dialog,

I am trying to run your code from the DA1458x_SDK\5.0.3\projects\target_apps\ble_examples\ble_app_peripheral, but I can not catch the broadcasting package from other bluetooth device. This device can got the package from other bluetooth beacon package. could you please help me to run it to get some beacon broadcasting package running based on the ble_app_peripheral ?

MT_dialog
Offline
Last seen:1 week 2 days ago
Staff
加入:2015-06-08 11:34
Hi liuluan002,

Hi liuluan002,

The code that is indicated in the post you ve mentioned is just to catch the ending of an non-connectable advertising (the device is advertising and you issue a stop causing the advertising to stop and you get the indication to your application that your device stopped advertising). What do you mean you can not catch the advertising package from another device ? In order to get ble packages from other devices you have to be a scanner in order to snif advertising packages from other peripherals.

Thanks MT_dialog

liuluan002
Offline
Last seen:3 months 3 weeks ago
加入:2015-11-27 14:24
I am using bluetooth scanner

I am using bluetooth scanner I made based on microchip RN4020 to catch up the all the advertisement package from all the broadcast package. I can see the other beacon package from other devises with the microchip RN4020 scanning, but I can not seen the package coming from the DA14580.

From my code I have just added the following changes to the project of DA1458x_SDK\5.0.3\projects\target_apps\ble_examples\ble_app_peripheral

2-option (the proper one) is to catch the ending of a non connectable advertisement through the catch rest function (user_catch_rest_hndl). You can just place the below code in the user_peripheral.c function:

case GAPM_CMP_EVT:
{
struct gapm_cmp_evt const *msg_param = (struct gapm_cmp_evt const *)(param);
switch (msg_param->operation)
{
case GAPM_ADV_NON_CONN:
user_app_adv_start(); //or whatever you want after completetion
break;

default:
break;
} break;
}

MT_dialog
Offline
Last seen:1 week 2 days ago
Staff
加入:2015-06-08 11:34
Hi liuluan002,

Hi liuluan002,

Since you dont see any advertising, and you dont get the indication that your advertising has stopped, can you please make sure that your device is advertising by using the smart snippets tool or just to make sure try an android BLE application?

Thanks MT_dialog

liuluan002
Offline
Last seen:3 months 3 weeks ago
加入:2015-11-27 14:24
Hi I can see the

Hi I can see the advertisement package from the phone, but I can not use the scanner from Mircochip to scan it. But with the same tool it can scan the package from the Ibeacon example running in the same device. Could you help please? Do I need to change the code from undirected broadcasting to the non-connected broadcasting? How I can make it?

MT_dialog
Offline
Last seen:1 week 2 days ago
Staff
加入:2015-06-08 11:34
Hi liuluan002,

Hi liuluan002,

I am not aware what kind of data packets your scanner detects. If you want to advertise in non-connectable mode you can do this by using the app_easy_gap_non_connectable_advertise_start() function in the template project of the SDK.

Thanks MT_dialog

liuluan002
Offline
Last seen:3 months 3 weeks ago
加入:2015-11-27 14:24
我已经试过了,但仍然没有

我已经试过了,但仍然没有so much difference. Is the broadcasting method and behavior differece a lot from the beacon example and example of DA1458x_SDK\5.0.3\projects\target_apps\ble_examples\ble_app_peripheral?

MT_dialog
Offline
Last seen:1 week 2 days ago
Staff
加入:2015-06-08 11:34
Hi liuluan002,

Hi liuluan002,

灯塔穰mple uses two different advertising modes (depends on the software configuration - GAPM_ADV_NON_CONN and GAPM_ADV_UNDIRECT) and the device's role is set in GAP_PERIPHERAL_SLV the PDU type is ADV_NONCONN_IND. Also the beacon advertises with no scan response data. The app_peripheral as is advertises with GAPM_ADV_UNDIRECTED in GAP_PERIPHERAL_SLV with scan response data and the PDU type is using is ADV_IND.

Thanks MT_dialog

liuluan002
Offline
Last seen:3 months 3 weeks ago
加入:2015-11-27 14:24
Thank you for your reply, I

Thank you for your reply, I try to check it now.
For the scanning, is there any possibility we only listen to one channel, for example we only scanning for the channel 37?

MT_dialog
Offline
Last seen:1 week 2 days ago
Staff
加入:2015-06-08 11:34
Hi liuluan002,

Hi liuluan002,

Its not possible to only check individual advertising channels or retrieve the specific advertising channel number..

Thanks MT_dialog

liuluan002
Offline
Last seen:3 months 3 weeks ago
加入:2015-11-27 14:24
谢谢你现在工作。

谢谢你现在工作。

Anther question is about the watchdog
For the project "ble_app_barebone", I have changed the watchdog from "#undef CFG_WDOG" into "#define CFG_WDOG" in the "da1458x_config_basic.h". Then I write the following code into "app_task.c", then I find after it running for a while, the program stops, how to fix this? It looks like the watchdog is not running. Could you please help? Thank you very much again.

// device configuration updated
case GAPM_SET_DEV_CONFIG:
{
if(param->status != GAP_ERR_NO_ERROR)
{
ASSERT_ERR(0); // unexpected error
}
else
{
if( 7 == current_role)
{
#if DEBUG_LOG
printf_string("\r\n Adv1\r\n");
uart2_init(UART_BAUDRATE_115K2, 3);
#endif
while(1)
{
#if DEBUG_LOG
printf_string("\r\n WD T");
if (USE_WDOG)
{
printf_string(" 1");
wdg_reload(WATCHDOG_DEFAULT_PERIOD);
wdg_resume ();
}
if (DEVELOPMENT_DEBUG)
{
printf_string(" 2");
}
printf_string(" \r\n");
uart2_init(UART_BAUDRATE_115K2, 3);
#endif
}
record2(current_role);
EXECUTE_CALLBACK_VOID(app_on_set_dev_config_complete);
}
else
{
#if DEBUG_LOG
printf_string("\r\n Adv2\r\n");
uart2_init(UART_BAUDRATE_115K2, 3);

#endif
record2(current_role);
}
ke_timer_set(APP_SWITCH_ROLE_TIMER, TASK_APP, 10); //10*10ms
}
}
break;

MT_dialog
Offline
Last seen:1 week 2 days ago
Staff
加入:2015-06-08 11:34
Hi liuluan002,

Hi liuluan002,

I dont really understand what you are trying to do. As far as i can tell the program isn't going to advertise but it will stuck in that while(1) and will always reload the watchdog and print some stuff. If the program stops due to NMI_Handler() (meaning watchdog interrupt) then you can find where the NMI interrupt is issued by opening the memory tab and checking at address 0x81850, the seventh unsigned long integer number in your memory window is your program counter. You can check this in order to see where the program stopped.

Thanks MT_dialog

liuluan002
Offline
Last seen:3 months 3 weeks ago
加入:2015-11-27 14:24
Thank you. I make it works

Thank you. I make it works now

liuluan002
Offline
Last seen:3 months 3 weeks ago
加入:2015-11-27 14:24
Is there any way to do the

Is there any way to do the software update through the UART port? How to do it?
Is there any way to do the OTA between the two dialog BTLE by programming it?
Is there any way we still use the part of the dialog 14583's inside flash as the sensor data logging?

MT_dialog
Offline
Last seen:1 week 2 days ago
Staff
加入:2015-06-08 11:34
Hi liuluan002,

Hi liuluan002,

The current SUOTA implementation uses either an SPI Flash or an I2C eeprom there is no other implementation for another use case.

你的意思是一个哒the suota receiver and the other da operate as central and update the image of the first da ? There is no implementation of the SUOTA profile as a central since most of the spota central are usually phones or other devices that allow the upload of an image.

You can use the da's flash to store data besides the image that's going to be uploaded to the da. The beacon example uses space of the spi memory to store some configuration data, i dont see any reason why not to be able to do this with 14583.

Thanks MT_dialog