32int parseSystemSerial( std::vector<int> &address, std::vector<std::string> &serial,
const std::string &response )
34 size_t at = response.find(
'@', 0 );
36 if( at == std::string::npos )
41 while( at != std::string::npos )
43 size_t sp = response.find(
' ', at );
45 if( sp == std::string::npos )
55 int add = std::stoi( response.substr( at + 1, sp - at - 1 ) );
57 address.push_back( add );
59 at = response.find(
'@', at + 1 );
61 sp = response.rfind(
' ', at );
62 size_t ed = response.find_first_of(
"\n@", sp );
63 if( ed == std::string::npos )
71 std::string ser = response.substr( sp + 1, ed - sp - 1 );
73 if( ser.size() == 0 ||
74 !std::all_of( ser.begin(), ser.end(), [](
unsigned char c ) { return std::isdigit( c ) != 0; } ) )
79 serial.push_back( ser );