We're making a BLE app using AI2 to communicate with an application running of the nRF52 development board. I downloaded the BLE extension from the link in the MIT_App_Inventor_Basic_Connection.pdf file and imported it into my AI2 project. Having played with it for 2 weeks, I'm unable to write a byte to and read from the GATT 0x1802 service (Immediate Alert). According to the
Bluetooth Specifications the device and the app should be able to write a unsigned byte to each other, signalling the alert level. I've tried to use the WriteBytes method to send the byte from my app to the device, and use the ReadBytes to read the byte from device on the app, but got nothing. We confirmed the device could properly send & receive this byte word with Nordic's nRF Connect app. Please find my aia file attached, and may someone tell me what is missing in my codes or what I've been doing wrong the whole time?
So far my app is able to scan, discover, connect to, and disconnect from our nRF52 device; check the supported Services and Characteristics of the device; run a 1000ms loop to monitor the values read from the Battery Service (0x180f) and Tx Power (0x1804). When I have the read180fand1804 procedure (and the corresponding blocks) enabled in my codes, I'm able to see the device battery level (98%) and transmit power (-8 dBm) at the "BLE Message" field refer to attached image (180f&1804.png). On our PC, we monitor the nRF52 board with a terminal and the attached image BLE123_Log.png is the screenshot. When my app was successfully connected with the nRF52 board, it displays a log message "Connection secured. Role: 1. conn_handle: 0, Peer ID: 1, Procedure: 1", I believe that means bonding was successful. I took the phone away from the nRF52 board, connection was lost, then I walked back toward the board, and connection was re-established, and I could disconnect from the app, as the screenshot shows.
I tried to send a byte to service 1802 by pressing the Ring button. Then I got the Runtime Error "Failed resolution of: Lcom/google/common/collect/Lists;" as shown in the attached image "RuntimeError.png".
But when I disabled the read180fand1804 procedure and enabled the read1802 procedure (refer to screenshot BLE123_Log2.png) , not that I didn't receive any Immediate Alert byte, my connection also didn't show the "Connection secured. Role: 1. conn_handle: 0, Peer ID: 1, Procedure: 1" message. It seems that the bonding was incomplete.
My questions are:
1. How can I read from and write to the GATT Service 0x1802?
2. What does the runtime error "Failed resolution of: Lcom/google/common/collect/Lists;" mean?
3. When ListPicker displays a list of BLE devices, sometimes the RSSI number appears as 127. When they are some negative numbers like -78, -82, etc., I would assume that means dBm. But what does 127 mean? Is it indicating something special?
Sorry to write such a long post. This is my first thing asking for help on this forum. I try to present my problem as thoroughly as possible. Thank you very much!
Best regards,
Guansheng