diff --git a/mgmt/main.c b/mgmt/main.c
index 6090eed..1788555 100644
--- a/mgmt/main.c
+++ b/mgmt/main.c
memcpy(buf + MGMT_HDR_SIZE, data, len);
if (write(mgmt_sk, buf, MGMT_HDR_SIZE + len) < 0) {
- fprintf(stderr, "Unable to send command: %s\n",
+ fprintf(stderr, "Unable to write to socket: %s\n",
strerror(errno));
free(pending_cmd);
pending_cmd = NULL;
char addr[18];
if (status != 0) {
- printf("Reading hci%u info failed with status %u\n",
+ fprintf(stderr, "Reading hci%u info failed with status %u\n",
id, status);
exit(EXIT_FAILURE);
}
if (mgmt_send_cmd(mgmt_sk, MGMT_OP_READ_INFO, index, NULL,
0, info_rsp, NULL) < 0) {
- fprintf(stderr, "Unable to send cmd\n");
+ fprintf(stderr, "Unable to send read_info cmd\n");
exit(EXIT_FAILURE);
}
}
if (mgmt_send_cmd(mgmt_sk, MGMT_OP_READ_INDEX_LIST,
MGMT_INDEX_NONE, NULL, 0,
index_rsp, NULL) < 0) {
- fprintf(stderr, "Unable to send cmd\n");
+ fprintf(stderr, "Unable to send index_list cmd\n");
exit(EXIT_FAILURE);
}
if (mgmt_send_cmd(mgmt_sk, MGMT_OP_READ_INFO, atoi(argv[1]), NULL,
0, info_rsp, NULL) < 0) {
- fprintf(stderr, "Unable to send cmd\n");
+ fprintf(stderr, "Unable to send read_info cmd\n");
exit(EXIT_FAILURE);
}
}
struct mgmt_mode *rp = rsp;
if (status != 0) {
- printf("Changing powered state for hci%u "
+ fprintf(stderr, "Changing powered state for hci%u "
"failed with status %u\n", id, status);
exit(EXIT_FAILURE);
}
if (mgmt_send_cmd(mgmt_sk, MGMT_OP_SET_POWERED, 0, &power,
sizeof(power), power_rsp, NULL) < 0) {
- fprintf(stderr, "Unable to send cmd\n");
+ fprintf(stderr, "Unable to send set_powered cmd\n");
exit(EXIT_FAILURE);
}
}