Ejemplo n.º 1
0
 public ble_msg_system_whitelist_remove_rsp_t ble_cmd_system_whitelist_remove(bd_addr address, int address_type)
 {
     log("ble_cmd_system_whitelist_remove_id");
     byte[] _data = new byte[SIZE_HEADER + 0 + 1 + address.Length + 1];
     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 + address.Length + 1);
     _data[idx++] = (byte)ble_classes.ble_cls_system;
     _data[idx++] = (byte)ble_command_ids.ble_cmd_system_whitelist_remove_id;
     // data
     for(int i = 0; i < address.Length; i++)
     {
         _data[idx++] = address.Address[i];
     }
     _data[idx++] = (byte)address_type;
     // send
     BgApiResponse response = Send(new BgApiCommand() { Data = _data }, false);
     return (ble_msg_system_whitelist_remove_rsp_t)response;
 }
Ejemplo n.º 2
0
 public ble_msg_gap_connect_direct_rsp_t ble_cmd_gap_connect_direct(bd_addr address, int addr_type, int conn_interval_min, int conn_interval_max, int timeout, int latency)
 {
     log("ble_cmd_gap_connect_direct_id");
     byte[] _data = new byte[SIZE_HEADER + 0 + 1 + address.Length + 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 + address.Length + 1 + 2 + 2 + 2 + 2);
     _data[idx++] = (byte)ble_classes.ble_cls_gap;
     _data[idx++] = (byte)ble_command_ids.ble_cmd_gap_connect_direct_id;
     // data
     for(int i = 0; i < address.Length; i++)
     {
         _data[idx++] = address.Address[i];
     }
     _data[idx++] = (byte)addr_type;
     _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_direct_rsp_t)response;
 }