}
}
- argc -= optind;
argv += optind;
optind = 0;
}
}
- argc -= optind;
- argv += optind;
optind = 0;
cp = (void *) buf;
}
}
- argc -= optind;
- argv += optind;
optind = 0;
memset(&cp, 0, sizeof(cp));
}
}
- argc -= optind;
- argv += optind;
optind = 0;
memset(&cp, 0, sizeof(cp));
struct mgmt_cp_unpair_device cp;
uint8_t type = BDADDR_BREDR;
int opt;
- uint16_t index = mgmt_index;
+ uint16_t index;
while ((opt = getopt_long(argc, argv, "+t:h", unpair_options,
NULL)) != -1) {
}
}
- argc -= optind;
- argv += optind;
optind = 0;
cp->irk_count = cpu_to_le16(count);
memcpy(cp->data + 2, uuids, uuid_bytes - 2);
}
- memcpy(cp->data + uuid_bytes, adv_data, adv_len);
- memcpy(cp->data + uuid_bytes + adv_len, scan_rsp, scan_rsp_len);
+ if (adv_len)
+ memcpy(cp->data + uuid_bytes, adv_data, adv_len);
+
+ if (scan_rsp_len)
+ memcpy(cp->data + uuid_bytes + adv_len, scan_rsp, scan_rsp_len);
if (!mgmt_send(mgmt, MGMT_OP_ADD_ADVERTISING, index, cp_len, cp,
add_adv_rsp, NULL, NULL)) {
memcpy(cp->data + 2, uuids, uuid_bytes - 2);
}
- memcpy(cp->data + uuid_bytes, adv_data, adv_len);
- memcpy(cp->data + uuid_bytes + adv_len, scan_rsp, scan_rsp_len);
+ if (adv_len)
+ memcpy(cp->data + uuid_bytes, adv_data, adv_len);
+
+ if (scan_rsp_len)
+ memcpy(cp->data + uuid_bytes + adv_len, scan_rsp, scan_rsp_len);
if (!mgmt_send(mgmt, MGMT_OP_ADD_EXT_ADV_DATA, index, cp_len, cp,
add_ext_adv_data_rsp, NULL, NULL)) {