* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <config.h>
#include "protocol.h"
/* serial protocol */
static const char mso_head[] = { 0x40, 0x4c, 0x44, 0x53, 0x7e };
static const char mso_foot[] = { 0x7e };
-extern SR_PRIV struct sr_dev_driver link_mso19_driver_info;
-
SR_PRIV int mso_send_control_message(struct sr_serial_dev_inst *serial,
uint16_t payload[], int n)
{
return mso_send_control_message(devc->serial, ARRAY_AND_SIZE(ops));
}
-SR_PRIV inline uint16_t mso_calc_raw_from_mv(struct dev_context * devc)
+SR_PRIV uint16_t mso_calc_raw_from_mv(struct dev_context *devc)
{
return (uint16_t) (0x200 -
((devc->dso_trigger_voltage / devc->dso_probe_attn) /
SR_PRIV void stop_acquisition(const struct sr_dev_inst *sdi)
{
- struct sr_datafeed_packet packet;
struct dev_context *devc;
devc = sdi->priv;
serial_source_remove(sdi->session, devc->serial);
- /* Terminate session */
- packet.type = SR_DF_END;
- sr_session_send(sdi, &packet);
+ std_session_send_df_end(sdi);
}
SR_PRIV int mso_clkrate_out(struct sr_serial_dev_inst *serial, uint16_t val)
{
struct sr_datafeed_packet packet;
struct sr_datafeed_logic logic;
- struct sr_dev_inst *sdi;
- GSList *l;
+ struct sr_dev_inst *sdi = cb_data;
+ struct dev_context *devc = sdi->priv;
int i;
- struct drv_context *drvc = di->priv;
-
- /* Find this device's devc struct by its fd. */
- struct dev_context *devc = NULL;
- for (l = drvc->instances; l; l = l->next) {
- sdi = l->data;
- devc = sdi->priv;
- if (devc->serial->fd == fd)
- break;
- devc = NULL;
- }
- if (!devc)
- /* Shouldn't happen. */
- return TRUE;
-
(void)revents;
uint8_t in[1024];
logic.length = 1024;
logic.unitsize = 1;
logic.data = logic_out;
- sr_session_send(cb_data, &packet);
+ sr_session_send(sdi, &packet);
devc->num_samples += 1024;
if (devc->limit_samples && devc->num_samples >= devc->limit_samples) {
sr_info("Requested number of samples reached.");
- sdi->driver->dev_acquisition_stop(sdi, cb_data);
+ sdi->driver->dev_acquisition_stop(sdi);
}
return TRUE;