You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • As I understand it, UART.write/eval will create a connection (internally) and will then use that - so if you're writing to just a single device then that's all you need. You're prompted on the first call and after that it 'just works'.

    It feels not optimal to have to duplicate that part of the code:

    Yes, you're right. The write/eval there should really be some common functionality in the connection object, or at the very least should take a connection as an argument so could be used on multiple connections. Are you interested in making that change, or should I look at it?

    Is there a way to do both these things at once? For example adding a custom connection.on("data", cb) on the same connection used by UART.write() and UART.eval().

    I believe after you're connected, you can just do UART.getConnection().on('data', ...)?

About

Avatar for Gordon @Gordon started