diff options
| -rw-r--r-- | minion/src/wifi_module.cpp | 11 | 
1 files changed, 7 insertions, 4 deletions
diff --git a/minion/src/wifi_module.cpp b/minion/src/wifi_module.cpp index 352cb79..d1f91c9 100644 --- a/minion/src/wifi_module.cpp +++ b/minion/src/wifi_module.cpp @@ -46,7 +46,7 @@ auto WiFiModule::connect_to_wifi(const char *ssid, const char *password) noexcep  	if (command == nullptr)  	{ -		Serial.println("Memory allocation failed for creating full connection command"); +		Serial.println("Memory allocation failed for creating wifi connection command");  		return false;  	} @@ -344,7 +344,7 @@ auto WiFiModule::send_response(  	if (command == nullptr)  	{ -		Serial.println("Memory allocation failed for creating close connection command"); +		Serial.println("Memory allocation failed for creating send response command");  		return false;  	} @@ -434,7 +434,7 @@ auto WiFiModule::_read(uint64_t timeout, char *response_out) noexcept  	-> WiFiModuleResponseStatus  {  	const auto start_time = millis(); - +	size_t index = 0U;  	bool has_end = false;  	auto status = WiFiModuleResponseStatus::TIMEOUT; @@ -444,7 +444,8 @@ auto WiFiModule::_read(uint64_t timeout, char *response_out) noexcept  		{  			char character = _read_byte(); -			strncat(response_out, &character, 1U); +			response_out[index] = character; +			response_out[index + 1] = '\0';  			if (util::str_ends_with(response_out, "OK"))  			{ @@ -463,6 +464,8 @@ auto WiFiModule::_read(uint64_t timeout, char *response_out) noexcept  				status = WiFiModuleResponseStatus::FAIL;  				has_end = true;  			} + +			index++;  		}  	}  | 
