This commit is contained in:
James 2024-04-25 22:26:53 +01:00
parent 9e6fb60a71
commit c3829c180e

View File

@ -18,7 +18,7 @@ void setup() {
Serial.println("Scanning...");
}
std::__cxx11::string currentName;
char currentName[128];
bool gotBasicInfo;
bool gotCellInfo;
@ -97,7 +97,11 @@ void loop() {
gotBasicInfo=false;
gotCellInfo=false;
currentName=advertisedDevice.getName();
std::__cxx11::string deviceName = advertisedDevice.getName();
strncpy(currentName, deviceName.c_str(), sizeof(currentName) - 1);
currentName[sizeof(currentName) - 1] = '\0'; // Ensure null-termination
while(gotBasicInfo==false || gotCellInfo==false){
// REQUEST BASIC INFO
// header status command length data checksum footer