QN9090-What is the most basic example design for a BLE Server

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

QN9090-What is the most basic example design for a BLE Server

Jump to solution
682 Views
blas_m
Contributor III

Hello there,

I am using as a base design the private_profile_server_bm to understand how the BLE APIs from NXP work but the code/design is turning a nightmare.
it contains a loads of folders and libraries for the QN9090-DK6 board.
For the point of view of an Application development, the folder "source" seems to encapsulate all required files. However, inside this folder there is a "common" folder which contains some additional files. In particular:
- ApplMain.c : This files seems to include the main loop of the BLE application (main_task()), which it calls then App_Thread(), which in turn calls App_HandleHostMessage(). This last function has a case for BLE message: 
- gAppGapGenericMsg_c
- gAppGapAdvertisementMsg_c
- gAppGapScanMsg_c .....
The ONLY messages type that seems to be received are: gAppGapGenericMsg_c.  Then the customer application function gets called: BleApp_GenericCallback(). This is the first function included in what seem to be the Development files ( in this example design, private_profile_server.c)
This is using a bare-metal example design but the amount of calls to reach the first point where a designer can modify the code seems excessive. Plus there are some calls to events queues and other functions/variable which are not accessible from the private_profile_server.c file
main_task() ->  App_Thread() -> App_HandleHostMessage()
-> BleApp_GenericCallback()

blas_m_0-1683302006051.png


- is there any more basic/simplified example design showing a BLE Server stack for the QN9090 device?
- is there some information about how this example design: private_profile_server project works, in terms of APIs and BLE states, call-back functions?

0 Kudos
1 Solution
666 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @blas_m ,

Thanks for contacting NXP support.

QN9090 provided a lot of design for  BLE,  I believe these design below could be helpful :

- For BLE Client, "beacon_bm" is the most basic example design, it works as BLE peripherals, and you can connect it with "IOT ToolBox" app on your smart phone.

- For BLE Server, "Alert Notification Server" and "Location and Navigation Server" is worth for a try.

- And also, "wireless_uart" is a basic example design can work as both central role and peripheral role.

 

For the last question, if you want to make custom modifications for your apps, please pay attention to the source/"$projectname.c" file and find the BleApp_GenericCallback() function, the switch loop in this function contains the most cases it uses and you can custom modify or add something you need. Connect Callback and Scanning Callback are important as well.

Regarding how to use these designs,you can refer to this document "Bluetooth Low Energy Demo Applications User's Guide.pdf". It is placed at this path "SDK_2_6_205_QN9090DK6\docs\wireless\Bluetooth\Bluetooth Low Energy Demo Applications User's Guide.pdf". For code, variable and function details, please refer to this document "Bluetooth Low Energy Application Developer's Guide.pdf".

Hope you are doing well!

 

Best regards,

Gavin

 

 

 

View solution in original post

Tags (1)
0 Kudos
3 Replies
642 Views
blas_m
Contributor III

Thank you Gavin for pointing out to those NXP documents for QN9090. 
I definitely take not about the example designs recommended too, although I would not consider "wireless_uart" as a basic example

thank you for your help!! much appreciate it

667 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @blas_m ,

Thanks for contacting NXP support.

QN9090 provided a lot of design for  BLE,  I believe these design below could be helpful :

- For BLE Client, "beacon_bm" is the most basic example design, it works as BLE peripherals, and you can connect it with "IOT ToolBox" app on your smart phone.

- For BLE Server, "Alert Notification Server" and "Location and Navigation Server" is worth for a try.

- And also, "wireless_uart" is a basic example design can work as both central role and peripheral role.

 

For the last question, if you want to make custom modifications for your apps, please pay attention to the source/"$projectname.c" file and find the BleApp_GenericCallback() function, the switch loop in this function contains the most cases it uses and you can custom modify or add something you need. Connect Callback and Scanning Callback are important as well.

Regarding how to use these designs,you can refer to this document "Bluetooth Low Energy Demo Applications User's Guide.pdf". It is placed at this path "SDK_2_6_205_QN9090DK6\docs\wireless\Bluetooth\Bluetooth Low Energy Demo Applications User's Guide.pdf". For code, variable and function details, please refer to this document "Bluetooth Low Energy Application Developer's Guide.pdf".

Hope you are doing well!

 

Best regards,

Gavin

 

 

 

Tags (1)
0 Kudos
21 Views
kopeljub
Contributor I

Hi, I fully agree with blas_m and share his frustration with NXP demo examples. I find them much too structured, which is probably because the same demo is made to serve multiple devices and demo boards. However, this makes them very user-unfriendly and difficult to understand, and impedes the user to learn from them (although this should be the main purpose). The main document "Bluetooth Low Energy Demo Applications User's Guide.pdf" offers only a guide about how to make these demos functioning and is not explaining anything about the code.

My problem is the following: I am trying to replicate the same application (remotely controlled drive) that we already have in mass production, but was made with NXP competitor's BLE device. I tried the same method I used the first time, when I used "SPP-over-BLE example" as starting point, basically same example as "wireless_uart". But, the competitor's example code and application note were clear and simple to understand, so it was easy to integrate with the application. I was expecting similar from NXP but I see that it is not so easy.

Please help by providing advice, where to find simpler and straight forward demo code for QN9090, possibly not linked to an existing demo board. I already have a target application PCB, so that all the code specific to the demo platform is just disturbing.

Many thanks!

0 Kudos