return FALSE;
}
- if (len > 0) {
+ if (len > 0 && len < chr_info->mtu) {
- bt_gatt_notify_req_t char_val;
+ bt_gatt_char_property_t char_val;
BT_INFO("FD io sending value changed %s %d \ni", buffer, len);
char_val.val = g_malloc0(len + 1);
- memcpy(char_val.UUID, chr_info->UUID, 16);
+ memcpy(char_val.prop.uuid, chr_info->UUID, 16);
memcpy(char_val.val, buffer, len);
- char_val.len = len;
- memcpy(char_val.adress, chr_info->adress, 18);
+ char_val.val_len = len;
+ memcpy(char_val.address, chr_info->adress, 18);
event_info = _bt_event_get_cb_data(BT_GATT_CLIENT_EVENT);
g_free(char_val.val);
- }
+ } else
+ BT_ERR("Packet corrupted");
g_free(buffer);
return TRUE;
}
-
if (cond & (G_IO_NVAL | G_IO_HUP | G_IO_ERR)) {
BT_ERR("Error : GIOCondition %d, [%s]", cond, chr_info->UUID);
g_io_channel_shutdown(gio, TRUE, NULL);