public ble_msg_gap_connect_selective_rsp_t ble_cmd_gap_connect_selective(int conn_interval_min, int conn_interval_max, int timeout, int latency)
{
log("ble_cmd_gap_connect_selective_id");
byte[] _data = new byte[SIZE_HEADER + 0 + 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 + 2 + 2 + 2 + 2);
_data[idx++] = (byte)ble_classes.ble_cls_gap;
_data[idx++] = (byte)ble_command_ids.ble_cmd_gap_connect_selective_id;
// data
_data[idx++] = (byte)conn_interval_min;
_data[idx++] = (byte)(conn_interval_min >> 8);
_data[idx++] = (byte)conn_interval_max;
_data[idx++] = (byte)(conn_interval_max >> 8);
_data[idx++] = (byte)timeout;
_data[idx++] = (byte)(timeout >> 8);
_data[idx++] = (byte)latency;
_data[idx++] = (byte)(latency >> 8);
// send
BgApiResponse response = Send(new BgApiCommand() { Data = _data }, false);
return (ble_msg_gap_connect_selective_rsp_t)response;
}