* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/** @file
+ * Norma DM9x0/Siemens B102x DMMs driver.
+ * @internal
+ */
+
#include "protocol.h"
static const int32_t hwopts[] = {
snprintf(req, sizeof(req), "%s\r\n",
nmadmm_requests[NMADMM_REQ_IDN].req_str);
+ g_usleep(150 * 1000); /* Wait a little to allow serial port to settle. */
for (cnt = 0; cnt < 7; cnt++) {
if (serial_write(serial, req, strlen(req)) == -1) {
sr_err("Unable to send identification request: %d %s.",
return NULL;
}
len = BUF_MAX;
- serial_readline(serial, &buf, &len, 1500);
+ serial_readline(serial, &buf, &len, NMADMM_TIMEOUT_MS);
if (!len)
continue;
buf[BUF_MAX - 1] = '\0';
/* Poll every 100ms, or whenever some data comes in. */
serial = sdi->conn;
- serial_source_add(serial, G_IO_IN, 100, norma_dmm_receive_data,
- (void *)sdi);
+ serial_source_add(sdi->session, serial, G_IO_IN, 100,
+ norma_dmm_receive_data, (void *)sdi);
return SR_OK;
}