Help me with converting my Bluetooth Classic Code to Bluetooth Low Energy

It is required to keep everything working exacly the same, with the only difference being that I'd like the code to use BLE, meaning any line of code related to BT Classic has to be replaced with its BLE equivalent (which is a bit over me atm, even after reading through the BLE examples available publicly).

Here is my code:

0bin - encrypted pastebin

I tried replacing some code lines with BLE related lines but the callbacks started giving errors, especially after getting rid of the BluetoothSerial SerialBT; line.

If anyone can help me with the process it'd be awesome. I'm trying to make the device compatible with both Android and iOS, the reason behind the conversion, as of right now it only works with Android OS and I can't test it on iOS devices.

Useful Resources:

ESP32_BLE_Arduino/examples at master · nkolban/ESP32_BLE_Arduino · GitHub

Thank you!

Here examples of BLE

Update: I've manage to update most of the functions in the code but it still returns an error at the moment.

See the current state of my code here: 0bin - encrypted pastebin

Screenshot_4

Update: I've managed to add a bit to my new BLE version of the code but the RSSI keeps showing as 0 no matter what connects to the Esp32.

0bin - encrypted pastebin