dmm/bm52x: add support for recorded measurements (memory data sets)
Extend the BM52x packet parser, add config get/set/list code to handle the data source property. Either let the common serial-dmm code run the acquisition of live readings, or locally retrieve the selected "session page" and forward its measurements to the session bus. These separate code paths are required because the protocol differs a lot between these modes, a totally different set of requests and responses is involved, response interpretation logic is impossible to share between live and recorded measurements.
This commit is contained in:
parent
9a1a7dc283
commit
0931639a12
1134
src/dmm/bm52x.c
1134
src/dmm/bm52x.c
File diff suppressed because it is too large
Load Diff
|
@ -127,6 +127,14 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
|
|||
* happen to provide them. (This is a compromise to do it here,
|
||||
* and not extend the DMM_CONN() et al set of macros.)
|
||||
*/
|
||||
if (dmm->packet_parse == sr_brymen_bm52x_parse) {
|
||||
dmm->dmm_state_init = brymen_bm52x_state_init;
|
||||
dmm->dmm_state_free = brymen_bm52x_state_free;
|
||||
dmm->config_get = brymen_bm52x_config_get;
|
||||
dmm->config_set = brymen_bm52x_config_set;
|
||||
dmm->config_list = brymen_bm52x_config_list;
|
||||
dmm->acquire_start = brymen_bm52x_acquire_start;
|
||||
}
|
||||
if (dmm->dmm_state_init)
|
||||
dmm->dmm_state = dmm->dmm_state_init();
|
||||
|
||||
|
|
|
@ -2349,6 +2349,20 @@ SR_PRIV gboolean sr_brymen_bm52x_packet_valid(const uint8_t *buf);
|
|||
SR_PRIV int sr_brymen_bm52x_parse(const uint8_t *buf, float *floatval,
|
||||
struct sr_datafeed_analog *analog, void *info);
|
||||
|
||||
struct brymen_bm52x_state;
|
||||
|
||||
SR_PRIV void *brymen_bm52x_state_init(void);
|
||||
SR_PRIV void brymen_bm52x_state_free(void *state);
|
||||
SR_PRIV int brymen_bm52x_config_get(void *state, uint32_t key, GVariant **data,
|
||||
const struct sr_dev_inst *sdi, const struct sr_channel_group *cg);
|
||||
SR_PRIV int brymen_bm52x_config_set(void *state, uint32_t key, GVariant *data,
|
||||
const struct sr_dev_inst *sdi, const struct sr_channel_group *cg);
|
||||
SR_PRIV int brymen_bm52x_config_list(void *state, uint32_t key, GVariant **data,
|
||||
const struct sr_dev_inst *sdi, const struct sr_channel_group *cg);
|
||||
SR_PRIV int brymen_bm52x_acquire_start(void *state,
|
||||
const struct sr_dev_inst *sdi,
|
||||
sr_receive_data_callback *cb, void **cb_data);
|
||||
|
||||
/*--- dmm/bm85x.c -----------------------------------------------------------*/
|
||||
|
||||
#define BRYMEN_BM85x_PACKET_SIZE_MIN 4
|
||||
|
|
Loading…
Reference in New Issue