Hi Dialog team
Could you please explain the program execution flow of the SDK programs (say ex Proximity reporter fh ). Though i under stood most of the functions in the programs ,am still in wonder that ther is no main() func to call these functions.then how these functions are executed & in what sequence ??
In proximity_reporter_fh app_prox_proj.c is the main file right ,but it also contains only function definitions ,then how these functions are executed ??
Diaolg SDK seems to be different from other ble SDK 's ,could you please explain about the datastructure you use ? Without main() call how these processes and services are executed ??

Hi hrg,
The application starts at main_func, which can be found in arch_main.c.
In main_func, following thing will happen in sequence:
1. initialization of the peripheral blocks
2. rwip_init is called. This function will initiate the stack. After the stack is initialized, GAPM_DEVICE_READY_IND message will be sent to your application task through the scheduler.
3.while(1)循环开始
4. in while loop, rwip_schedule() function is called. This function checkes if there is any message in the message queue. If yes, it will dispatch the message to the destination task. When the chip is cold booted for instance, in the step 2,GAPM_DEVICE_READY_IND will be at this moment in the message queue. rwip_schedule() will "send" the message to the application task. And the corresponding handler (gapm_device_ready_ind_handler in app_task.c) of the application task is triggered to execute. Thegapm_device_ready_ind_handler will after that sends another message to the scheduler and the below sequence chart will happen.
5. After all the message in the message queue is processed,rwip_schedule()will be finished. In the while (1) loop, WFI() function will be triggered. After that, the chip goes to sleep mode, until there is an external wake up, or internal timer wake up (e.g., it is the time to send an andvertising packets or connection packet).
6. After wake up, the while (1) loop continues andrwip_schedule() is called again to process message the maybe sent by lower layer stack or application task.
Does the above explanation answer your questions?
Thankyou WT_Dialog .
For example if i need to include only the generic health thermometer profile ,how to call it into my program ? ie how to call inside app_proj .c ??
why there is no response still !!?
You are not alone, hrt. I would like an answer to the same question. It is even more complicated for a fully hosted central endpoint because there are no examples. When I add an already provided 'application' profile to the app group, I am stuck with an undefined task. I assume I need to define it in rwip_config.h but there is a max of 64 tasks there and it is already full. Is one supposed to delete some? Given that this API is much more an exercise in configuration than programming it is critical the documentation is accurate and kept up to date and since it is not we need answers to fundamental questions like yours.