]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/rdtech-dps/protocol.h
rdtech-dps: research to reduce serial comm transfer volume again
[libsigrok.git] / src / hardware / rdtech-dps / protocol.h
index fc23ed3ab1c087e2fdbe86484e330c4728386dc4..456e20419bf6f785de425588111ccaa195ebe920 100644 (file)
 
 #define LOG_PREFIX "rdtech-dps"
 
+enum rdtech_dps_model_type {
+       MODEL_NONE,
+       MODEL_DPS,
+       MODEL_RD,
+};
+
 struct rdtech_dps_model {
+       enum rdtech_dps_model_type model_type;
        unsigned int id;
        const char *name;
        unsigned int max_current;
@@ -79,13 +86,20 @@ struct rdtech_dps_state {
        float voltage, current, power;
 };
 
+enum rdtech_dps_state_context {
+       ST_CTX_NONE,
+       ST_CTX_CONFIG,
+       ST_CTX_PRE_ACQ,
+       ST_CTX_IN_ACQ,
+};
 SR_PRIV int rdtech_dps_get_state(const struct sr_dev_inst *sdi,
-       struct rdtech_dps_state *state);
+       struct rdtech_dps_state *state, enum rdtech_dps_state_context reason);
 SR_PRIV int rdtech_dps_set_state(const struct sr_dev_inst *sdi,
        struct rdtech_dps_state *state);
 
 SR_PRIV int rdtech_dps_get_model_version(struct sr_modbus_dev_inst *modbus,
-       uint16_t *model, uint16_t *version);
+       enum rdtech_dps_model_type model_type,
+       uint16_t *model, uint16_t *version, uint32_t *serno);
 SR_PRIV int rdtech_dps_seed_receive(const struct sr_dev_inst *sdi);
 SR_PRIV int rdtech_dps_receive_data(int fd, int revents, void *cb_data);