From 8cabb873570f5430241d21a64584db0dcf4c6a2f Mon Sep 17 00:00:00 2001 From: Stefan Nygren Date: Tue, 17 Mar 2015 14:31:17 +0100 Subject: [PATCH] Fix error where pid file is move as call and clean --- src/btle_alarm.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/btle_alarm.c b/src/btle_alarm.c index 6bc2df108..a6b73096b 100644 --- a/src/btle_alarm.c +++ b/src/btle_alarm.c @@ -45,7 +45,6 @@ struct hci_state open_default_hci_device() if((current_hci_state.device_handle = hci_open_dev(current_hci_state.device_id)) < 0) { current_hci_state.has_error = TRUE; - snprintf(current_hci_state.error_message, sizeof(current_hci_state.error_message), "Could not open device: %s", strerror(errno)); return current_hci_state; } @@ -54,7 +53,6 @@ struct hci_state open_default_hci_device() if(ioctl(current_hci_state.device_handle, FIONBIO, (char *)&on) < 0) { current_hci_state.has_error = TRUE; - snprintf(current_hci_state.error_message, sizeof(current_hci_state.error_message), "Could set device to non-blocking: %s", strerror(errno)); return current_hci_state; } @@ -68,14 +66,12 @@ void start_hci_scan(struct hci_state current_hci_state) if(hci_le_set_scan_parameters(current_hci_state.device_handle, 0x00, htobs(0x0010), htobs(0x0010), 0x00, 0x01, 1000) < 0) { current_hci_state.has_error = TRUE; - snprintf(current_hci_state.error_message, sizeof(current_hci_state.error_message), "Failed to set scan parameters: %s", strerror(errno)); return; } if(hci_le_set_scan_enable(current_hci_state.device_handle, 0x01, 1, 1000) < 0) { current_hci_state.has_error = TRUE; - snprintf(current_hci_state.error_message, sizeof(current_hci_state.error_message), "Failed to enable scan: %s", strerror(errno)); return; } @@ -86,7 +82,6 @@ void start_hci_scan(struct hci_state current_hci_state) if(getsockopt(current_hci_state.device_handle, SOL_HCI, HCI_FILTER, ¤t_hci_state.original_filter, &olen) < 0) { current_hci_state.has_error = TRUE; - snprintf(current_hci_state.error_message, sizeof(current_hci_state.error_message), "Could not get socket options: %s", strerror(errno)); return; } @@ -145,7 +140,6 @@ void error_check_and_exit(struct hci_state current_hci_state) void process_data(uint8_t *data, size_t data_len, le_advertising_info *info) { int cec=0; - printf("Test: %p and %d\n", data, data_len); if(data[0] == EIR_NAME_SHORT || data[0] == EIR_NAME_COMPLETE) { @@ -157,36 +151,28 @@ void process_data(uint8_t *data, size_t data_len, le_advertising_info *info) char addr[18]; ba2str(&info->bdaddr, addr); - printf("addr=%s name=%s\n", addr, name); free(name); } else if(data[0] == EIR_FLAGS) { - printf("Flag type: len=%d\n", data_len); int i; for(i=1; idata + 1); - printf("Event: %d\n", info->evt_type); - printf("Length: %d\n", info->length); if(info->length == 0) {