I originally wanted to establish a Bluetooth broadcast function, using a connectionless method to broadcast sensor data to a mobile phone. I searched around in NXP Rapid IoT but didn't find a function that could set up broadcast data. I had no choice but to use the connection establishment method. I found that this method is also very convenient to implement in NXP Rapid IoT. On the basis of the source function, first click on the blank space, and click the BLE GATT Characteris on the right to add a Bluetooth function
A Bluetooth icon will appear in the blank space
Click the Characteris icon, and then click Add Event on the right
A prompt "Select an Element to add a Trigger Event." appears. Click the newly added Bluetooth image to associate CCS811 with Bluetooth
Click this connection to see that TVOC Read and Set Value do not need to be modified
Click the Bluetooth icon again to open NOTIFY on the right, and then set READ DATA Change TYPE, WRITE DATA TYPE and NOTIFY DATA TYPE to Unsigned Integer. Don't worry about anything else.
Then save and compile them respectively. After compiling, download the firmware and flash it to the module.
After the module is running, turn on Bluetooth. Mine shows P7470, and the data corresponds to the last 4 digits of M on the back of the module.
Click Connect and you can see that there are many services. 4523b850-d29e-4aa7-b02d-7d5b6971210f is the automatically generated one in the Bluetooth module I added later.
Click Enter and you can see that the uuid is the same as the characteristic in the newly added Bluetooth module.
Click Enter and you can see that Notification can be turned on.
After turning on Notification, you will receive data continuously. The decimal data is the same as the data displayed on the module display.