Something in that line is possible. But you can't use pointers as you do now; you need a fixed size array that is big enough to hold the longest ssid or password plus one spare. So if the length of the longest ssid is 10 characters, the array needs to be 11 in size.
Your topic has been moved to a more suitable location on the forum.
First, when DHT11 is connected to the battery, it will transmit the signal to Wi-Fi and install another sensor later. I will use Evil to reduce power consumption.
A BLE device is a phone or laptop.
Thank you for your kind advice.