Use write with response non-response write is not available. (#1136)
If the BLE characteristic does not have write without response available this will default to using write with response.
This commit is contained in:
1 parent
749c1592b4
commit
8b40b68081
1 file changed
+4
-4
@@ -50,14 +50,14 @@ bool zBLEConnect::writeData(BLEAction* action) {
|
|||||||
std::string temp = action->value.substr(i, 2);
|
std::string temp = action->value.substr(i, 2);
|
||||||
buf.push_back((uint8_t)strtoul(temp.c_str(), nullptr, 16));
|
buf.push_back((uint8_t)strtoul(temp.c_str(), nullptr, 16));
|
||||||
}
|
}
|
||||||
return pChar->writeValue((const uint8_t*)&buf[0], buf.size());
|
return pChar->writeValue((const uint8_t*)&buf[0], buf.size(), !pChar->canWrite());
|
||||||
}
|
}
|
||||||
case BLE_VAL_INT:
|
case BLE_VAL_INT:
|
||||||
return pChar->writeValue(strtol(action->value.c_str(), nullptr, 0));
|
return pChar->writeValue(strtol(action->value.c_str(), nullptr, 0), !pChar->canWrite());
|
||||||
case BLE_VAL_FLOAT:
|
case BLE_VAL_FLOAT:
|
||||||
return pChar->writeValue(strtod(action->value.c_str(), nullptr));
|
return pChar->writeValue(strtod(action->value.c_str(), nullptr), !pChar->canWrite());
|
||||||
default:
|
default:
|
||||||
return pChar->writeValue(action->value);
|
return pChar->writeValue(action->value, !pChar->canWrite());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in new issue
Block a user