@@ -1016,8 +1016,8 @@ static DBusMessage *characteristic_write_value(DBusConnection *conn,
* - If value is larger than MTU - 3: long-write
* * "write-without-response" property set -> write command.
*/
- if ((!type && (chrc->ext_props & BT_GATT_CHRC_EXT_PROP_RELIABLE_WRITE))
- || (type && !strcasecmp(type, "reliable"))) {
+ if ((!type || (type && !strcasecmp(type, "reliable"))) &&
+ chrc->ext_props & BT_GATT_CHRC_EXT_PROP_RELIABLE_WRITE) {
supported = true;
chrc->write_op = start_long_write(msg, chrc->value_handle, gatt,
true, value, value_len, offset,
@@ -1026,8 +1026,8 @@ static DBusMessage *characteristic_write_value(DBusConnection *conn,
return NULL;
}
- if ((!type && chrc->props & BT_GATT_CHRC_PROP_WRITE) ||
- (type && !strcasecmp(type, "request"))) {
+ if ((!type || (type && !strcasecmp(type, "request"))) &&
+ chrc->props & BT_GATT_CHRC_PROP_WRITE) {
uint16_t mtu;
supported = true;