Made explicit a few libhackrf result tests -- comparing against HACKRF_SUCCESS instead of checking for non-zero.
This commit is contained in:
@ -140,13 +140,13 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int result = hackrf_init();
|
int result = hackrf_init();
|
||||||
if( result ) {
|
if( result != HACKRF_SUCCESS ) {
|
||||||
printf("hackrf_init() failed: %s (%d)\n", hackrf_error_name(result), result);
|
printf("hackrf_init() failed: %s (%d)\n", hackrf_error_name(result), result);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = hackrf_open(&device);
|
result = hackrf_open(&device);
|
||||||
if( result ) {
|
if( result != HACKRF_SUCCESS ) {
|
||||||
printf("hackrf_open() failed: %s (%d)\n", hackrf_error_name(result), result);
|
printf("hackrf_open() failed: %s (%d)\n", hackrf_error_name(result), result);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -182,7 +182,7 @@ int main(int argc, char** argv) {
|
|||||||
} else {
|
} else {
|
||||||
result = hackrf_start_tx(device, tx_callback);
|
result = hackrf_start_tx(device, tx_callback);
|
||||||
}
|
}
|
||||||
if( result ) {
|
if( result != HACKRF_SUCCESS ) {
|
||||||
printf("hackrf_start_?x() failed: %s (%d)\n", hackrf_error_name(result), result);
|
printf("hackrf_start_?x() failed: %s (%d)\n", hackrf_error_name(result), result);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -211,7 +211,7 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
result = hackrf_close(device);
|
result = hackrf_close(device);
|
||||||
if( result ) {
|
if( result != HACKRF_SUCCESS ) {
|
||||||
printf("hackrf_close() failed: %s (%d)\n", hackrf_error_name(result), result);
|
printf("hackrf_close() failed: %s (%d)\n", hackrf_error_name(result), result);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user