Dear Sirs,
I am creating a Farmware for the beacon in SDK5.0.3.
I have designed the FW to change the part of the advertising data every few seconds.
FW will for a while operating, but FW will stop the advertising.
I dont want that advertised stops.
When FW is stop the advertising, in user_app_adv_undirect_complete() of user_peripheral.c, it had received a GAP_ERR_NO_ERROR or GAP_ERR_COMMAND_DISALLOWED as status.
(Normally, it has received a GAP_ERR_CANCELED.)
此外,当广告的传播stops, user_catch_rest_hndl() is handling.
1.Do you know the reason for GAP_ERR_NO_ERROR and GAP_ERR_COMMAND_DISALLOWED occurs?
I have not seen other than GAP_ERR_NO_ERROR and GAP_ERR_COMMAND_DISALLOWED.
The two errors always has occurred at the same time.
2.I do not want to stop the advertise. Is there a better way?
I did the following measures to FW.
1.If the FW has received a non-GAP_ERR_CANCELED, FW will stop advertising.
(FW will use the processing of adv_data_update_timer_cb ().)
2.然后,弗兰克-威廉姆斯是user_app_adv_恢复广告start ().
I do this renovation in FW, it was allowed to operate 10 hours.
GAP_ERR_COMMAND_DISALLOWED发生,但advertisements are not stopped.
Best regards.
Hi Coral0310,
I assume that you are operating under fully hosted mode. You can check the barebone example in the SDK5 that does exactly what you want, it advertises and changes the advertising string whenever the kernel timer elapses. In order to change the advertising string there is no other way, you have to stop advertising, change the advertising string and issue an advertising command once more. When you terminate the advertising procedure then you should get a GAP_ERR_CANCELED, if for example you issue an advertising command while you are allready advertising then you will get a GAP_ERR_COMMAND_DISALLOWED.
Thanks MT_dialog
Hi Dialog Staff,
Thank you for your reply.
I'll check the barebone example in the SDK5.
I would like to review the code of my project.
Thank you.
Dear Sirs,
>When you terminate the advertising procedure then you should get a GAP_ERR_CANCELED, if you start advertising while >you are allready advertising then you will get a GAP_ERR_COMMAND_DISALLOWED.
I have a question.
I want to know the conditions under which user_app_adv_undirect_complete() is called.
I think that user_app_adv_undirect_complete() is called after FW stops advertising.
However, I do not have confidence in their own thinking.
Please tell me the conditions under which user_app_adv_undirect_complete() is called.
Thank you.
Hi Coral0310,
If you are advertising and youinvoke theapp_easy_gap_advertise_stop() it issues a GAPM_CANCEL_CMD in order to cancel the on going air operation,this will cancel the advertising procedure. When the GAPM_CANCEL_CMD is completed (meaning that you wont be advertising anymore) theGAPM_CANCEL_CMD will give a GAPM_CMP_EVT (complete event) as an indication that the cancelation for the on going operation has completed. The GAPM_CMP_EVT will be handled by thegapm_cmp_evt_handler() and regarding the completed operation it will go to the appropriate case, the appropriate case then will call the appropriate callback, in the case of the advertising cancelation the app_on_adv_undirect_complete callback is called which is mapped to your custom callback.
Thanks MT_dialog
Dear Dialog staff,
Thank you for your reply.
>>If you are advertising and you invoke the app_easy_gap_advertise_stop() it issues a GAPM_CANCEL_CMD in order to cancel the on going air operation,this will cancel the advertising procedure.
I understand that "app_on_adv_undirect_complete callback"
is not called If FW do not run the app_easy_gap_advertise_stop().
(Please let me know if my thinking is wrong.)
Once again, I checked the operation of my projects.
a. In the case of normal,
"app_on_adv_undirect_complete callback" has been called after app_easy_gap_advertise_stop() has been executed.
b. In the case of GAP_ERR_COMMAND_DISALLOWED,
This case does not have app_easy_gap_advertise_stop() is executed before the "app_on_adv_undirect_complete callback” is called.
I do not understand the reason why this happens.
Please let me if you know something.
Thank you.
Dear Dialog staff,
Sorry, I was the wrong question.
>>I assume that you are operating under fully hosted mode.
Please let me more about “fully hosted mode".
Today, I was allowed to run the “blue_app_barebone” example in SDK5, Then GAP_ERR_NO_ERROR error has occurred, FW was stopped advertise.
(I have not made changes other than to issue a log on it.)
My Project and “blue_app_barebone” example is different, but stops the way is very similar.
I think that my project has not been to the “fully hosted mode”.
sorry to hear many times.
Thank you.
Hi Coral0310,
The fully hosted mode means that the application runs in the 580 internal processor, in fully embedded mode the application runs on an external proccesor. The GAP_ERR_NO_ERROR that you see on the barebone example its no error state, you should get aGAP_ERR_NO_ERROR when the device has reseted successfully and another similar message when the device has completed the configuration succesfully.
Thanks MT_dialog
Thank you for your reply.
1.
>>The fully hosted mode means that the application runs in the 580 internal processor, in fully embedded mode the application runs on an external proccesor.
Excuse me. Not well understood…
How do I can judge whether internal processor or external processor?
Hope that helps.
I am using a development kit of TypeZY(by murata corporation).
TypeZY is Downloading FW to via UART from MDK-ARM.
2.
>>The GAP_ERR_NO_ERROR that you see on the barebone example its no error state, you should get a GAP_ERR_NO_ERROR when the device has reseted successfully and another similar message when the device has completed the configuration succesfully.
Thank you.
I was able to understand GAP_ERR_NO_ERROR.
However, I do not understand about GAP_ERR_COMMAND_DISALLOWED.
I understand that "app_on_adv_undirect_complete callback” is not called If FW do not run the app_easy_gap_advertise_stop().
(Please let me know if my thinking is wrong.)
Once again, I checked the operation of my projects.
a. In the case of normal,
"app_on_adv_undirect_complete callback" has been called after app_easy_gap_advertise_stop() has been executed.
b. In the case of GAP_ERR_COMMAND_DISALLOWED,
This case does not have app_easy_gap_advertise_stop() is executed before the "app_on_adv_undirect_complete callback” is called.
I do not understand the reason why this happens.
Please let me if you know something.
Thank you.
Hi Coral0310,
1. If you have an external pc code and communicates with the 580 over an interface, UART for example (as the proximity_reporter_ext) in order to send command (advertise, connect etc) then you are operating under fully embeded configuration, if your program runs exclusively on the 580 then you have a fully hosted configuration (most of dialogs projects are this way).
2.Yes, if you do not call the app_easy_gap_advertise_stop() the app_on_adv_undirect_complete() callback shall not be called. Regarding the command disallowed as i allready mentioned should not be called in normal operation and it is returned when you issue a start advertise before stopping the ongoing advertising procedure. In the app_ble_barebone i haven't seen this message occur. Please check the example.
Thanks MT_dialog
Dear dialog staff,
Thank you for your reply.
1. Thank you.
I was running in a fully embedded mode.
2.Thank you.
I will re-check my project and app-ble-barebone.
I want to first resolve the GAP_ERR_NO_ERROR.
Even after the GAP_ERR_NO_ERROR has occurred,
I want to continue the broadcast of advertising.
Please let me a good way.
I'm glad when there is a sample project that would be helpful.
sorry to hear many times.
Thank you.
Hi Coral0310,
No problem, just follow the barebone example and check the procedure that is used in order start and set up the device and then to alter the advertising strings, make the appropriate compares with your program.
Thanks MT_dialog
Dear Dialog staff,
Thank you for your reply.
I checked the operation of the FW again.
GAP_ERR_NO_ERROR status is displayed after it has been referred to the “app_on_connection callback" is called.
I want to make “app_on_connection callback" does not occur,
Because My FW does not need to be a connection.
Is there something a good way?
(I’m thinking of changing the advertise type from “undirect" to “non_connection".)
Thank you.
Hi Coral0310,
If you dont want connections on your peripheral, turning your device to non-connectable is a way, you can have a look at the beacon reference design on SDK3 which advertises in non-connectable mode. You can find the beacon in the Reference design section of the support site.
Thanks MT_dialog
Dear Dialog staff,
Thank you for your reply.
I have a two questions.
1.Sorry, I’m using the SDK5.0.3.
Is there a sample that would be helpful in SDK5?
I think I just change the setting(e.g. user_config.h) or the advertise start method.
For example, please let me how to change the advertising mode of “ble_app_barebone sample" to "non-connectable mode".
2.I am selecting the SDK5.
However, I can’t decide which choice to SDK5 or SDK3.
At the moment, Which do you think is better choice?
If the support of SDK3 continues, I might consider the use of SDK3.
Sorry to hear many times.
Thank you.
Hi Coral0310,
1) There isn't any official beacon example for the SDK 5 on the portal, you can change the user_config.h file in the non-connectable section and make your device non-connectable in the barebone example by using the app_easy_gap_non_connectable_advertise_start() function in order to start advertising.
2) The SDK3 is still supported but dialog recommends for new designs to use the SDK5 since its more easy to use and most of the bugs are fixed.
Thanks MT_dialog
Thank you for your reply.
1.
>you can change the user_config.h file in the non-connectable section and make your device non-connectable in the barebone example by using the app_easy_gap_non_connectable_advertise_start() function in order to start advertising.
Please let me more about “user_config.h” file.
I want to know the value to be modified in the "user_config.h" file.
Thank you.
Hi Coral0310,
There is no value you should change in the user_config.h file, the struct that handles the non-connectable advertising is user_non_connectable_advertise_conf, you can configure the interval, etc and after that you need to invoke app_easy_gap_non_connectable_advertise_get_active(); and app_easy_gap_non_connectable_advertise_start(); in order to start advertise in non-connectable mode.
Thanks MT_dialog
Thank you for your reply.
I have been using the “ble_app_barebone” example.
I changed the code of user_barebone.c.
//before
void user_app_adv_start(void)
{
…
struct gapm_start_advertise_cmd* cmd;
cmd = app_easy_gap_undirected_advertise_get_active();
…
app_easy_gap_undirected_advertise_start();
}
//after
void user_app_adv_start(void)
{
…
struct gapm_start_advertise_cmd* cmd;
cmd = app_easy_gap_non_connectable_advertise_get_active();
…
app_easy_gap_non_connectable_advertise_start();
}
It could not be build, because app_easy_gap_non_connectable_advertise_get_active()
is not defined.
I have defined the app_easy_gap_non_connectable_advertise_get_active()
to “app_easy_gap.h" file.
(I was referring to the app_easy_gap_undirected_advertise_get_active().)
Build came to pass. However, FW is can’t advertise the update, advertise stops.
Maybe, I'm wrong how to define the app_easy_gap_non_connectable_advertise_get_active().
Is there something a good way?
(I would like some code, please.)
Thank you.
Hi Coral0310,
Most probably you do advertise but your advertising stops since the timer that stops the advertising is triggered, there is no default callback for catching the non connectable advertising ending, but you can implement one by using the catch rest function, please follow the link below for the code that should be implemented:
http://support.dialog-semiconductor.com/advertisement-complete-callback-...
Thanks MT_dialog
Hi Dialog Staff,
Thank you for your reply.
It was able to to continue to advertise for FW.
Today, I did a test, but there was no problem.
Maybe, I think that this matter has been resolved.
Thank you so much.