#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;
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);