libhackrf: add transfer buffer size access calls

Applications may need to learn the size of the USB transfer buffer
queue, for example to determine how many bytes will be preloaded with
calls to the TX callback.
This commit is contained in:
Michael Ossmann
2022-09-09 16:16:24 -04:00
parent e7b19ef2c2
commit 70a04855ac
2 changed files with 25 additions and 0 deletions

View File

@@ -2685,6 +2685,26 @@ int ADDCALL hackrf_start_rx_sweep(
return result;
}
/**
* Get USB transfer buffer size.
* @return size in bytes
*/
size_t ADDCALL hackrf_get_transfer_buffer_size(hackrf_device* device)
{
(void) device;
return TRANSFER_BUFFER_SIZE;
}
/**
* Get the total number of USB transfer buffers.
* @return number of buffers
*/
uint32_t ADDCALL hackrf_get_transfer_queue_depth(hackrf_device* device)
{
(void) device;
return TRANSFER_COUNT;
}
#ifdef __cplusplus
} // __cplusplus defined.
#endif