diff --git a/android/gatt.c b/android/gatt.c
index 77c3b02..921217a 100644
--- a/android/gatt.c
+++ b/android/gatt.c
break;
}
- if (length)
- g_attrib_send(dev->attrib, 0, pdu, length,
- confirmation_cb, NULL, NULL);
+ g_attrib_send(dev->attrib, 0, pdu, length, confirmation_cb, NULL, NULL);
}
static struct app_connection *create_connection(struct gatt_device *device,
*/
resp_length = enc_confirmation(opdu, length);
- if (resp_length)
- g_attrib_send(dev->attrib, 0, opdu, resp_length, NULL, NULL,
- NULL);
+ g_attrib_send(dev->attrib, 0, opdu, resp_length, NULL, NULL, NULL);
}
static void connect_cb(GIOChannel *io, GError *gerr, gpointer user_data)
return HAL_STATUS_UNSUPPORTED;
}
- if (!length)
+ if (!g_attrib_send(dev->attrib, 0, pdu, length, test_command_result,
+ NULL, NULL))
return HAL_STATUS_FAILED;
- g_attrib_send(dev->attrib, 0, pdu, length, test_command_result, NULL,
- NULL);
-
return HAL_STATUS_SUCCESS;
}
cmd->len, pdu, mtu);
}
- if (length == 0) {
- error("gatt: Failed to encode indication");
+ if (!g_attrib_send(conn->device->attrib, 0, pdu, length,
+ confirmation_cb, UINT_TO_PTR(conn->id), NULL)) {
+ error("gatt: Failed to send indication");
status = HAL_STATUS_FAILED;
} else {
- g_attrib_send(conn->device->attrib, 0, pdu, length,
- confirmation_cb, UINT_TO_PTR(conn->id), NULL);
status = HAL_STATUS_SUCCESS;
}
/* Respond with our MTU */
len = enc_mtu_resp(mtu, rsp, length);
- if (!len)
+ if (!g_attrib_send(dev->attrib, 0, rsp, len, NULL, NULL, NULL))
return ATT_ECODE_UNLIKELY;
- g_attrib_send(dev->attrib, 0, rsp, len, NULL, NULL, NULL);
-
return 0;
}
resp_length = enc_error_resp(ipdu[0], 0x0000, status, opdu,
length);
- if (resp_length)
- g_attrib_send(dev->attrib, 0, opdu, resp_length, NULL, NULL,
- NULL);
+ g_attrib_send(dev->attrib, 0, opdu, resp_length, NULL, NULL, NULL);
}
static void connect_confirm(GIOChannel *io, void *user_data)