]> sigrok.org Git - libsigrok.git/blobdiff - libsigrok.h
Revise session API to allow for multiple sessions in future.
[libsigrok.git] / libsigrok.h
index 3408f4338392e8b9b3061866426fac1f3980368a..3a2c900accc14b8132c01c9d6d66edd136477b67 100644 (file)
@@ -195,6 +195,10 @@ enum sr_mq {
        SR_MQ_RELATIVE_HUMIDITY,
        /** Time */
        SR_MQ_TIME,
+       /** Wind speed */
+       SR_MQ_WIND_SPEED,
+       /** Pressure */
+       SR_MQ_PRESSURE,
 };
 
 /** Unit of measured quantity, sr_datafeed_analog.unit. */
@@ -252,6 +256,12 @@ enum sr_unit {
        SR_UNIT_WATT,
        /** Consumption [Wh]. */
        SR_UNIT_WATT_HOUR,
+       /** Wind speed in meters per second. */
+       SR_UNIT_METER_SECOND,
+       /** Pressure in hectopascal */
+       SR_UNIT_HECTOPASCAL,
+       /** Relative humidity assuming air temperature of 293 kelvin (%rF). */
+       SR_UNIT_HUMIDITY_293K,
 };
 
 /** Values for sr_datafeed_analog.flags. */
@@ -367,6 +377,16 @@ struct sr_trigger_match {
  */
 struct sr_context;
 
+/**
+ * @struct sr_session
+ * Opaque structure representing a libsigrok session.
+ *
+ * None of the fields of this structure are meant to be accessed directly.
+ *
+ * @see sr_session_new(), sr_session_destroy().
+ */
+struct sr_session;
+
 /** Packet in a sigrok data feed. */
 struct sr_datafeed_packet {
        uint16_t type;
@@ -913,6 +933,8 @@ struct sr_dev_inst {
        void *conn;
        /** Device instance private data (used?) */
        void *priv;
+       /** Session to which this device is currently assigned. */
+       struct sr_session *session;
 };
 
 /** Types of device instance, struct sr_dev_inst.type */
@@ -979,7 +1001,7 @@ struct sr_dev_driver {
                        const struct sr_dev_inst *sdi,
                        const struct sr_channel_group *cg);
        /** Channel status change.
-        *  @see sr_dev_channel_enable(), sr_dev_trigger_set(). */
+        *  @see sr_dev_channel_enable(). */
        int (*config_channel_set) (const struct sr_dev_inst *sdi,
                        struct sr_channel *ch, unsigned int changes);
        /** Apply configuration settings to the device hardware.