Skip to content

Commit 8643cdc

Browse files
author
Martin.JM
committed
Change the Korad IDN to work for more devices
1 parent 39aead1 commit 8643cdc

File tree

1 file changed

+10
-4
lines changed
  • src/hardware/korad-kaxxxxp

1 file changed

+10
-4
lines changed

src/hardware/korad-kaxxxxp/api.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,20 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
281281
sr_dbg("Want max %zu bytes.", len);
282282

283283
/*
284-
* TODO: check if adding the newline breaks some other devices - I cannot do so
285-
* This is required for the KA3005PS
284+
* There is a quirk rolled into here:
285+
* - The KORAD_QUIRK_NEWLINE needs a `\n`
286+
* If there's more at the end they still function perfectly fine.
287+
* But the normal ones need an `*IDN?` without anything at the end.
288+
* So this sends a combination that satisfies these constraints.
286289
*/
287-
ret = korad_kaxxxxp_send_cmd(serial, "*IDN?", true);
290+
ret = korad_kaxxxxp_send_cmd(serial, "*IDN?\n*IDN?", false);
288291
if (ret < 0)
289292
return NULL;
290293

291-
/* Newline stripping enabled by default - doesn't matter for devices that don't add one */
294+
/*
295+
* Newline stripping enabled by default - doesn't matter for devices that
296+
* don't add one
297+
*/
292298
ret = korad_kaxxxxp_read_chars(serial, len, reply, true);
293299
if (ret < 0)
294300
return NULL;

0 commit comments

Comments
 (0)