]> sigrok.org Git - libsigrok.git/blobdiff - sigrok.h
log messages: Use device name, not vendor name.
[libsigrok.git] / sigrok.h
index 7b3d4a4967d9c38c92e552099c4752a5ea64c8ed..c0c28a3a44aa5ffa3829b2095309fbcebc7b746d 100644 (file)
--- a/sigrok.h
+++ b/sigrok.h
@@ -53,7 +53,8 @@ extern "C" {
 #define SR_OK                 0 /* No error */
 #define SR_ERR               -1 /* Generic/unspecified error */
 #define SR_ERR_MALLOC        -2 /* Malloc/calloc/realloc error */
-#define SR_ERR_SAMPLERATE    -3 /* Incorrect samplerate */
+#define SR_ERR_ARG           -3 /* Function argument error */
+#define SR_ERR_SAMPLERATE    -4 /* Incorrect samplerate */
 
 #define SR_MAX_NUM_PROBES      64 /* Limited by uint64_t. */
 #define SR_MAX_PROBENAME_LEN   32
@@ -66,6 +67,13 @@ extern "C" {
 
 #define SR_HZ_TO_NS(n) (1000000000 / (n))
 
+/* libsigrok loglevels. */
+#define SR_LOG_NONE    0
+#define SR_LOG_ERR     1
+#define SR_LOG_WARN    2
+#define SR_LOG_INFO    3
+#define SR_LOG_DBG     4
+
 typedef int (*sr_receive_data_callback) (int fd, int revents, void *user_data);
 
 /* Data types used by hardware plugins for set_configuration() */
@@ -114,7 +122,7 @@ struct sr_datafeed_header {
        int num_logic_probes;
 };
 
-#if 0
+#if defined(HAVE_LA_ALSA)
 struct sr_analog_probe {
        uint8_t att;
        uint8_t res;    /* Needs to be a power of 2, FIXME */
@@ -134,7 +142,7 @@ struct sr_input {
 };
 
 struct sr_input_format {
-       char *extension;
+       char *id;
        char *description;
        int (*format_match) (const char *filename);
        int (*init) (struct sr_input *in);
@@ -149,7 +157,7 @@ struct sr_output {
 };
 
 struct sr_output_format {
-       char *extension;
+       char *id;
        char *description;
        int df_type;
        int (*init) (struct sr_output *o);
@@ -326,8 +334,8 @@ struct sr_device_plugin {
        void (*cleanup) (void);
 
        /* Device-specific */
-       int (*open) (int device_index);
-       void (*close) (int device_index);
+       int (*opendev) (int device_index);
+       int (*closedev) (int device_index);
        void *(*get_device_info) (int device_index, int device_info_id);
        int (*get_status) (int device_index);
        int *(*get_capabilities) (void);