Android Question BLE2 Library issue. ("Unknown Type: ble2")

JacoMuller

New Member
Licensed User
Longtime User
I am doing a project to monitor the signals for the lights on a tow wiring harness. I want to read 5 GPIO signals with my ESP32. The names of the signals are Left indicator, Right indicator, Brake, Reverse, Tail/Park. I want to do the sketch in Arduino IDE. I then want to connect to my Samsung Phone via Bluetooth. I want an app on my Samsung phone, written in B4A to show the status of the signals. The ESP32 sketch is done and I have tested the Bluetooth message with nRF Connect - all good. The issue is with B4A and more specific the BLE2 Library. I cannot get B4A to compile. There is an error "Unknown Type: ble2". I have selected BLE2 in Library manager. Installed version 1.41, online version 1.39. I have used ChatGPT to assist with the code for B4A as I am familiar with Arduino IDE and ESP32 for ESP32 code. The first round of code from ChatGPT was comprehensive and included everything that I have asked for. Only issue is, the BLE2 library error keeps popping up. ChatGPT then simplified the code for fault finding but the error is still there. I am at a point where the code is only:
B4X:
Sub Process_Globals
End Sub

Sub Globals
    Private lblStatus As Label
    Private btnConnect As Button
    Private ble As BLE2
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("MainPage")
    lblStatus.Text = "Disconnected"
    btnConnect.Text = "CONNECT"
End Sub

Sub btnConnect_Click
    lblStatus.Text = "Button pressed"
End Sub
The error is in the line 7, "Private ble As BLE2".

What am I missing?
 

teddybear

Well-Known Member
Licensed User
Have you used the ble2 library before? there is no type ble2, perhaps it is BleManager2, here is the example.
 
Upvote 0
Top