mirror of
https://github.com/greatscottgadgets/hackrf.git
synced 2026-02-20 00:33:48 +01:00
add --led option to hackrf_debug
and corresponding changes to libhackrf and firmware
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(libhackrf C)
|
||||
set(MAJOR_VERSION 0)
|
||||
set(MINOR_VERSION 7)
|
||||
set(MINOR_VERSION 8)
|
||||
set(PACKAGE libhackrf)
|
||||
set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION})
|
||||
set(VERSION ${VERSION_STRING})
|
||||
|
||||
@@ -102,6 +102,7 @@ typedef enum {
|
||||
HACKRF_VENDOR_REQUEST_GET_CLKIN_STATUS = 44,
|
||||
HACKRF_VENDOR_REQUEST_BOARD_REV_READ = 45,
|
||||
HACKRF_VENDOR_REQUEST_SUPPORTED_PLATFORM_READ = 46,
|
||||
HACKRF_VENDOR_REQUEST_SET_LEDS = 47,
|
||||
} hackrf_vendor_request;
|
||||
|
||||
#define USB_CONFIG_STANDARD 0x1
|
||||
@@ -2904,6 +2905,28 @@ int ADDCALL hackrf_supported_platform_read(hackrf_device* device, uint32_t* valu
|
||||
}
|
||||
}
|
||||
|
||||
int ADDCALL hackrf_set_leds(hackrf_device* device, const uint8_t state)
|
||||
{
|
||||
USB_API_REQUIRED(device, 0x0107)
|
||||
int result = libusb_control_transfer(
|
||||
device->usb_device,
|
||||
LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR |
|
||||
LIBUSB_RECIPIENT_DEVICE,
|
||||
HACKRF_VENDOR_REQUEST_SET_LEDS,
|
||||
state,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
0);
|
||||
|
||||
if (result != 0) {
|
||||
last_libusb_error = result;
|
||||
return HACKRF_ERROR_LIBUSB;
|
||||
} else {
|
||||
return HACKRF_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // __cplusplus defined.
|
||||
#endif
|
||||
|
||||
@@ -514,6 +514,8 @@ extern ADDAPI int ADDCALL hackrf_supported_platform_read(
|
||||
hackrf_device* device,
|
||||
uint32_t* value);
|
||||
|
||||
extern ADDAPI int ADDCALL hackrf_set_leds(hackrf_device* device, const uint8_t state);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // __cplusplus defined.
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user