修复分配的内存不够添加\0的问题

This commit is contained in:
JIe
2024-09-24 17:26:00 +08:00
parent 787a688af6
commit 9d718d9d41
5 changed files with 21 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ int main(int argc, char** const argv){
auto startTime = std::chrono::system_clock::now();
// auto res = serial.GetAtUntil("AT+CFUN=1","OK", 200);
// std::cout<<res.value_or("ERROR")<<std::endl;
auto res = serial.GetAtResponse("AT+ECICCID", 200);
auto res = serial.GetAtResponse("AT+CGSN=0", 200);
std::cout<<res.value_or("ERROR")<<std::endl;
auto endTime = std::chrono::system_clock::now();
std::cout<<std::chrono::duration_cast<std::chrono::milliseconds>(endTime-startTime).count();