public ble_msg_connection_update_rsp_t ble_cmd_connection_update(int connection, int interval_min, int interval_max, int latency, int timeout)
{
log("ble_cmd_connection_update_id");
byte[] _data = new byte[SIZE_HEADER + 0 + 1 + 2 + 2 + 2 + 2];
int idx = 0;
// header
_data[idx++] = (byte)ble_dev_types.ble_dev_type_ble|(byte)ble_msg_types.ble_msg_type_cmd|0x0;
_data[idx++] = (byte)(0 + 1 + 2 + 2 + 2 + 2);
_data[idx++] = (byte)ble_classes.ble_cls_connection;
_data[idx++] = (byte)ble_command_ids.ble_cmd_connection_update_id;
// data
_data[idx++] = (byte)connection;
_data[idx++] = (byte)interval_min;
_data[idx++] = (byte)(interval_min >> 8);
_data[idx++] = (byte)interval_max;
_data[idx++] = (byte)(interval_max >> 8);
_data[idx++] = (byte)latency;
_data[idx++] = (byte)(latency >> 8);
_data[idx++] = (byte)timeout;
_data[idx++] = (byte)(timeout >> 8);
// send
BgApiResponse response = Send(new BgApiCommand() { Data = _data }, false);
return (ble_msg_connection_update_rsp_t)response;
}