cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Bluetooth

Anonymous
Not applicable

Hey guys, it's me again.

I tried to program my first BLE app with the WICED Turorials but there are still a lot of questionmarks in my head...

I used the WICED Smart Designer to generate the GATT but I don't understand in which order the single functions are performed. The program tools I used until now always need a main-function. But I can't find this after the code-generation.

Can you tell me in which order the function calls proceed?

0 Likes
1 Solution
MiTo_1583836
Contributor II

We produced a set of videos/on-line workshops on the topic here: Bluetooth SMART Virtual Workshops - Macnica Americas Inc.

The following video helps you to go through the steps of producing an application step by step: Video Link : 1229

This is the best content on the topic I have seen so far, hopefully it will help you out with your design.

View solution in original post

3 Replies
Anonymous
Not applicable

There is no "main" function available.

User application runs as event driven.

If you use Smart Designer and "abc" is the name, abc_create() function will be called once after boot up.

You can write initialization code there.

Some other callback function also be created like abc_connection_up(), abc_timer_fine(), and so on.

0 Likes
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, as dmiya mentioned, there is effectively no need for a main() function.

0 Likes
MiTo_1583836
Contributor II

We produced a set of videos/on-line workshops on the topic here: Bluetooth SMART Virtual Workshops - Macnica Americas Inc.

The following video helps you to go through the steps of producing an application step by step: Video Link : 1229

This is the best content on the topic I have seen so far, hopefully it will help you out with your design.

View solution in original post