Skip to content

Conversation

@mauzybwy
Copy link

See: Issue #22

_finish() joins the built list before sending to Logic via _cmd()
'set_active_channels' calls _build() on a list object, and therefore fails the join.

I have fixed this issue by joining the channel list before passing to _build. Seems to work fine for me now.

xerox1101 pushed a commit to xerox1101/python-saleae that referenced this pull request Aug 12, 2016
Using type(list) doesn't work for all possible types and isinstance() is a safer way to check this. This was happening with Python 2.7.10 when passing a list of specific digital channels to the _build() routine in export_data2() but could also happen in other places in the code.
@ppannuto
Copy link
Owner

Looks like there are some whitespace issues with your PR:

https://travis-ci.org/ppannuto/python-saleae/jobs/151665617#L330

Also, I don't think this change is correct / necessary. The _build function accumulates a list of things which the _finish function will eventually ', '.join. Before your change:

>>> s.set_active_channels([0,1,2,3], [0])
DEBUG:saleae.saleae:Send >SET_ACTIVE_CHANNELS, digital_channels, 0, 1, 2, 3, analog_channels, 0<

After your change:

>>> s.set_active_channels([0,1,2,3], [0])
DEBUG:saleae.saleae:Send >SET_ACTIVE_CHANNELS, digital_channels, 0,1,2,3, analog_channels, 0<

Note that this function is only supported by Logic 16, Logic 8(2nd gen), Logic Pro 8, and Logic Pro 16. If you just start up an instance of Logic with no Saleae attached, the virtual Saleae it creates doesn't support this function and the command will be NAK'd.

Feel free to re-open this PR if I missed something and you've fixed the whitespace issues.

@ppannuto ppannuto closed this Aug 16, 2016
ppannuto added a commit that referenced this pull request Aug 16, 2016
Issue #23: Fix a problem building strings from lists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants