File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
src/hardware/korad-kaxxxxp Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -281,13 +281,17 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
281281 sr_dbg ("Want max %zu bytes." , len );
282282
283283 /*
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.
284+ * For the identification we send two messages due to the newline quirk
285+ * The first works on devices that require no newline to be there
286+ * The second adds support for devices that require the newline to be there
287+ * The timeout makes sure the former devices handle the cmd first
289288 */
290- ret = korad_kaxxxxp_send_cmd (serial , "*IDN?\n*IDN?" , false);
289+ ret = korad_kaxxxxp_send_cmd (serial , "*IDN?" , false);
290+ if (ret < 0 )
291+ return NULL ;
292+
293+ g_usleep (100000 );
294+ ret = korad_kaxxxxp_send_cmd (serial , "\n" , false);
291295 if (ret < 0 )
292296 return NULL ;
293297
You can’t perform that action at this time.
0 commit comments