Node-serialport: Mocking example fails

Created on 12 Jul 2017  Â·  6Comments  Â·  Source: serialport/node-serialport

  • __SerialPort Version__:5.0.0-beta7
  • __NodeJS Version__:tried on v6.xxx
  • __Operating System__ and __Hardware Platform__: tried on Mac and Windows

Summary of Problem

getting this error

  serialport:main opening path: COM_ANYTHING +0ms
  serialport:main _read queueing _read for after open +5ms
  serialport:main opened path: COM_ANYTHING +2ms
port opened
  serialport:main _write 10240 bytes of data +5ms
  serialport:main _read discarding the read buffer pool +1ms
  serialport:main _read reading +2ms
  serialport:main binding.write write finished +7ms
Write callback returned
Last write:      undefined

Steps and Code to Reproduce the Issue

To see the Last write: undefined
npm install to a clean folder on with the attached package.json
get mocking.js from github
run node mocking.js
package.txt

bug docs

All 6 comments

I cleaned it up. Thanks for for the report!

thanks, did you clean install it ?
I am getting now
Port opened: COM_ANYTHING
Write: Complete!
Received: Hi from my test!
(node:86621) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'toString' of undefined

You'll need to work off master or wait for the next release

On Sat, Jul 15, 2017, 3:19 PM vkuehn notifications@github.com wrote:

thanks, did you clean install it ?
I am getting now
Port opened: COM_ANYTHING
Write: Complete!
Received: Hi from my test!
(node:86621) UnhandledPromiseRejectionWarning: Unhandled promise rejection
(rejection id: 1): TypeError: Cannot read property 'toString' of undefined

—
You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
https://github.com/EmergingTechnologyAdvisors/node-serialport/issues/1227#issuecomment-315556031,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABlbhZ18JNjAx8W88x0m5fZzDddqHC1ks5sORC8gaJpZM4OVw5y
.

oh ok, thought I did install latest master version...will wait for the next release

I published 5.0.0-beta8

and now it works like charming

serialport:main opening path: COM_ANYTHING +0ms
serialport:bindings open +3ms
serialport:main _read queueing _read for after open +4ms
serialport:main opened path: COM_ANYTHING +1ms
Port opened: COM_ANYTHING
serialport:main _write 16 bytes of data +5ms
serialport:bindings write 16 bytes +2ms
serialport:main _read discarding the read buffer pool +2ms
serialport:main _read reading +2ms
serialport:bindings read +3ms
serialport:main binding.write write finished +3ms
Write: Complete!
Last write: Lets write data!
serialport:main binding.read finished +7ms
Received: Hi from my test!
serialport:main _read reading +5ms
serialport:bindings read +3ms

:)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

apiel picture apiel  Â·  5Comments

callen5914 picture callen5914  Â·  7Comments

belargo picture belargo  Â·  4Comments

byarchil picture byarchil  Â·  3Comments

jbollacke picture jbollacke  Â·  6Comments