else
error_code = _bt_get_error_code(param->result);
+ memset(&rfcomm_connection, 0x00, sizeof(bt_socket_connection_s));
connection_ind = (bluetooth_rfcomm_connection_t *)(param->param_data);
if (connection_ind) {
case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
BT_INFO("bt_socket_connection_state_changed_cb() will be called with BT_SOCKET_DISCONNECTED");
+ memset(&rfcomm_connection, 0x00, sizeof(bt_socket_connection_s));
disconnection_ind = (bluetooth_rfcomm_disconnection_t *)(param->param_data);
if (disconnection_ind) {
return BT_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_LINE */
}
- switch (write_type) {
- case BT_GATT_WRITE_TYPE_WRITE:
- property = BT_GATT_PROPERTY_WRITE;
- break;
- case BT_GATT_WRITE_TYPE_WRITE_NO_RESPONSE:
- property = BT_GATT_PROPERTY_WRITE_WITHOUT_RESPONSE;
- break;
- default:
+ ret = __get_write_prop(write_type, &property);
+ if (ret != BT_ERROR_NONE)
return BT_ERROR_NOT_SUPPORTED;
- }
if (!(chr->properties & property))
return BT_ERROR_NOT_SUPPORTED;
- ret = __get_write_prop(write_type, &property);
- if (ret != BT_ERROR_NONE)
- return BT_ERROR_NOT_SUPPORTED;
-
chr->write_type = write_type;
return BT_ERROR_NONE;
}