Download and install the Silicon Labs EFR Connect App in the android smart phones for testing BLE applications. Users can also use their choice of BLE apps available in Android/iOS smart phones.
This application supports bare metal and RTOS environment. By default, the application project files (Keil and Simplicity Studio) are provided with RTOS configuration. To select a bare metal configuration, see Selecting bare metal.
The application can be configured to suit your requirements and development environment. Read through the following sections and make any changes needed.
4.1 Open rsi_ble_common_config.h file
4.1.1 User must update the below parameters
RSI_BLE_NEW_SERVICE_UUID refers to the attribute value of the newly created service.
#define RSI_BLE_NEW_SERVICE_UUID 0xAABB
RSI_BLE_ATTRIBUTE_1_UUID refers to the attribute type of the first attribute under this service (RSI_BLE_NEW_SERVICE_UUID).
#define RSI_BLE_ATTRIBUTE_1_UUID 0x1AA1
BLE_THROUGHPUT refers the name of the Silicon Labs device to appear during scanning by remote devices.
#define RSI_BLE_DEVICE_NAME "BLE_THROUGHPUT"
Note: Following are the Non-configurable macros in the application.
RSI_BLE_CHAR_SERV_UUID refers to the attribute type of the characteristics to be added in a service.
#define RSI_BLE_CHAR_SERV_UUID 0x2803
RSI_BLE_CLIENT_CHAR_UUID refers to the attribute type of the client characteristics descriptor to be added in a service.
#define RSI_BLE_CLIENT_CHAR_UUID 0x2902
Note: Following are the properties:
RSI_BLE_ATT_PROPERTY_READ is used to set the READ property to an attribute value.
#define RSI_BLE_ATT_PROPERTY_READ 0x02```
-**RSI_BLE_ATT_PROPERTY_WRITE** is used to set the WRITE property to an attribute value.
```c
#define RSI_BLE_ATT_PROPERTY_WRITE 0x08
RSI_BLE_ATT_PROPERTY_NOTIFY is used to set the NOTIFY property to an attribute value.
#define RSI_BLE_ATT_PROPERTY_NOTIFY 0x10
BT_GLOBAL_BUFF_LEN refers Number of bytes required by the application and the driver.
#define BT_GLOBAL_BUFF_LEN 15000
4.2 Open rsi_ble_config.h file and update/modify following macros,
Once the project is created, right click on project and go to properties → C/C++ Build → Settings → Build Steps
Add post_build_script_SimplicityStudio.bat file path (SI917_COMBO_SDK.X.X.X.XX\utilities\isp_scripts_common_flash) in build steps settings as shown in below image.
Check for M4 projects macros in preprocessor settings(RSI_M4_INTERFACE=1)
Check for 9117 macro in preprocessor settings(CHIP_9117=1).
Click on the build icon (hammer) to build the project
After the program gets executed, the Silicon Labs module will be in an Advertising state by default.
Connect any serial console for prints.
Open a EFR Connect App on the Smartphone and do the scan.
In the App, the Silicon Labs module device will appear with the name configured in the macro RSI_BLE_DEVICE_NAME (Ex: "BLE_THROUGHPUT")
Initiate a connection from the App.
After successful connection, EFR connect APP displays the supported services of Silicon Labs module
Select the attribute service which is added RSI_BLE_NEW_SERVICE_UUID(Ex: 0xAABB)
After Enable notifications for the read attribute RSI_BLE_ATTRIBUTE_2_UUID(Example: 0x1BB1) So that the GATT server notifies when value updated in that particular attribute.
Please refer to the given below images for continuous notification received on the mobile.
10. The serial teriminal are displayed as below.
7. Observing the output prints on serial terminal#