Posts: 5
Registered: ‎09-11-2017
Accepted Solution

NCP code tracing

Hi all,


I have just start NCP mode project from two months ago.


I notice that "*gecko_rsp_msg = &_gecko_rsp_msg" in gecko_bglib.h.

But I don't see "_gecko_rsp_msg" where it was be operated even I find the key term with all path under SiliconLabs\SimplicityStudio\v4


Is it possible to know how does it work ?


Thank you!

Posts: 2,674
Registered: ‎09-01-2015

Re: NCP code tracing

_gecko_rsp_msg is the variable declaration, it appears in the code only once. (gecko_bglib.h)


In the rest of the code, this variable is referenced using this pointer:

 struct gecko_cmd_packet *gecko_rsp_msg = &_gecko_rsp_msg; 

If you search with keyword gecko_rsp_msg, you will find that this is used in gecko_bglib.c source file. 

(located in: C:\SiliconLabs\SimplicityStudio\v4\developer\sdks\gecko_sdk_suite\v1.1\protocol\bluetooth_2.4\ble_stack\src\host\ )


It is referenced in function gecko_wait_message(). The return value of this function is a pointer to a BGAPI event. The code puts the response in the variable pointed by gecko_rsp_msg (= &_gecko_rsp_msg).



Posts: 5
Registered: ‎09-11-2017

Re: NCP code tracing

Hi Jaakov!


Thanks for your reply.


I got it with your clearly answer.


Thank you very much!


Best regards,