cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Smart Bluetooth

Anonymous
Not applicable

Hi, I'm brand new to WICED-Smart and I'm diving into the SDK, but I can't seem to find where the main thread begins. Could someone please point me in the right direction?

0 Likes
1 Solution
MichaelF_56
Moderator
Moderator

The application runs in its own thread and the entire application framework is event driven.

The main entry point of the application is APPLICATION_INIT() where it has to register its GATT database, configurations and the application create function.

No other operations are allowed at this point.

Once this is done, the rest of the firmware and the BLE stack will be initialized -and once these are ready- the application create function will be invoked.

This is equivalent to C’s main(). Once you return from this function, everything is event driven; callbacks for connection up/down/end of ADV interval/write to GATT handle, interrupts, timer expiry etc. are all events for the application to handle.

So, there is effectively no need for a main() function.

View solution in original post

1 Reply
MichaelF_56
Moderator
Moderator

The application runs in its own thread and the entire application framework is event driven.

The main entry point of the application is APPLICATION_INIT() where it has to register its GATT database, configurations and the application create function.

No other operations are allowed at this point.

Once this is done, the rest of the firmware and the BLE stack will be initialized -and once these are ready- the application create function will be invoked.

This is equivalent to C’s main(). Once you return from this function, everything is event driven; callbacks for connection up/down/end of ADV interval/write to GATT handle, interrupts, timer expiry etc. are all events for the application to handle.

So, there is effectively no need for a main() function.

View solution in original post