A few user reported that the SPT datapoint was no longer being properly read.
void ClearSpecialCharacters(std::string &strText, const std::string& strAllowed)
{
const std::string cAllowed = strAllowed; //"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-";
auto new_end = std::remove_if(strText.begin(), strText.end(),
[cAllowed](std::string::value_type c)
{ return cAllowed.find(c) == std::string::npos; });
strText.erase(new_end, strText.end());
}
// Extracts strings of length OBJ_NAME_SIZE in pdata separated by 0x00, 0x00
void extract_obj_names(const uint8_t *pdata, uint8_t data_len, std::vector<std::string> *obj_names) {
const uint8_t *start = pdata + 4;
const uint8_t *endp = pdata + data_len;
while (start < endp) {
const uint8_t *end = std::min(start + OBJ_NAME_SIZE, endp);
std::string s((const char *) start, end - start);
ClearSpecialCharacters(s, "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_");
obj_names->push_back(s);
start = end + 2;
}
}
I suspect the current code actually puts characters with a raw hex value of 0x00 into the string which causes the object name to not match the configured value.