Skip to content

Commit

Permalink
Merge branch '13-reproducibility'
Browse files Browse the repository at this point in the history
Remove __FILE__ macro used for the debug messages

Fixes #13
  • Loading branch information
szszszsz committed Mar 18, 2020
2 parents e5fa36a + f69d809 commit d4948fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions device.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ int device_receive(struct Device *dev, uint8_t *out_data, size_t out_buffer_size
}
}
if (i >= receive_attempts-1){
printf("WARN %s:%d: could not receive the data from the device.\n", __FILE__, __LINE__);
printf("WARN %s:%d: could not receive the data from the device.\n", "device.c", __LINE__);
return RET_CONNECTION_LOST;
}

if (out_data != nullptr){
assert(out_buffer_size != 0);
memcpy(out_data, dev->packet_query.as_data+1, min(out_buffer_size, HID_REPORT_SIZE_CONST-1));
if (out_buffer_size > HID_REPORT_SIZE_CONST-1){
printf("WARN %s:%d: incoming data bigger than provided output buffer.\n", __FILE__, __LINE__);
printf("WARN %s:%d: incoming data bigger than provided output buffer.\n", "device.c", __LINE__);
}
} else {
//exit on wrong function parameters
Expand All @@ -96,7 +96,7 @@ int device_send(struct Device *dev, uint8_t *in_data, size_t data_size, uint8_t
assert(data_size != 0);
memcpy(dev->packet_query.payload, in_data, min(data_size, sizeof(dev->packet_query.payload)));
if (data_size > HID_REPORT_SIZE_CONST-1){
printf("WARN %s:%d: input data bigger than buffer.\n", __FILE__, __LINE__);
printf("WARN %s:%d: input data bigger than buffer.\n", "device.c", __LINE__);
}
} else {
//exit on wrong function parameters
Expand All @@ -107,7 +107,7 @@ int device_send(struct Device *dev, uint8_t *in_data, size_t data_size, uint8_t
int send_status = hid_send_feature_report(dev->mp_devhandle, dev->packet_query.as_data, HID_REPORT_SIZE_CONST);

if (send_status != (int)HID_REPORT_SIZE_CONST){
printf("WARN %s:%d: could not send the data to the device.\n", __FILE__, __LINE__);
printf("WARN %s:%d: could not send the data to the device.\n", "device.c", __LINE__);
return RET_CONNECTION_LOST;
}

Expand Down

0 comments on commit d4948fd

Please sign in to comment.