summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDimitri Stolnikov <horiz0n@gmx.net>2012-05-20 16:41:15 +0200
committerDimitri Stolnikov <horiz0n@gmx.net>2012-05-20 16:41:15 +0200
commit505f40d9a092ad44c7d3a77477a72e37c955b4ff (patch)
treed8131c2fea713f6c619673199acfd0552964c7dc /include
parentfdc7bc978bf423f2663b10bb8f6cbd69879d9c02 (diff)
introduce api function to read usb string descriptors
This API allows to read manufacturer and product names as well as the serial number advertized by the device on the bus.
Diffstat (limited to 'include')
-rw-r--r--include/rtl-sdr.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/rtl-sdr.h b/include/rtl-sdr.h
index a5b3dfd..804334d 100644
--- a/include/rtl-sdr.h
+++ b/include/rtl-sdr.h
@@ -33,6 +33,22 @@ RTLSDR_API uint32_t rtlsdr_get_device_count(void);
RTLSDR_API const char* rtlsdr_get_device_name(uint32_t index);
+/*!
+ * Get USB device strings.
+ *
+ * NOTE: The string arguments must provide space for up to 256 bytes.
+ *
+ * \param index the device index
+ * \param manufact manufacturer name, may be NULL
+ * \param product product name, may be NULL
+ * \param serial serial number, may be NULL
+ * \return 0 on success
+ */
+RTLSDR_API int rtlsdr_get_device_usb_strings(uint32_t index,
+ char *manufact,
+ char *product,
+ char *serial);
+
RTLSDR_API int rtlsdr_open(rtlsdr_dev_t **dev, uint32_t index);
RTLSDR_API int rtlsdr_close(rtlsdr_dev_t *dev);
@@ -69,6 +85,20 @@ RTLSDR_API int rtlsdr_set_xtal_freq(rtlsdr_dev_t *dev, uint32_t rtl_freq,
RTLSDR_API int rtlsdr_get_xtal_freq(rtlsdr_dev_t *dev, uint32_t *rtl_freq,
uint32_t *tuner_freq);
+/*!
+ * Get USB device strings.
+ *
+ * NOTE: The string arguments must provide space for up to 256 bytes.
+ *
+ * \param dev the device handle given by rtlsdr_open()
+ * \param manufact manufacturer name, may be NULL
+ * \param product product name, may be NULL
+ * \param serial serial number, may be NULL
+ * \return 0 on success
+ */
+RTLSDR_API int rtlsdr_get_usb_strings(rtlsdr_dev_t *dev, char *manufact,
+ char *product, char *serial);
+
RTLSDR_API int rtlsdr_set_center_freq(rtlsdr_dev_t *dev, uint32_t freq);
/*!