Skip to content

Commit

Permalink
Merge pull request #150 from aj-ptw/master
Browse files Browse the repository at this point in the history
Fix for printing debug output
  • Loading branch information
AJ Keller authored Jul 18, 2017
2 parents 1d2f6ff + 86307aa commit 259af35
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ ourBoard.write('o');
Emitted when the serial connection to the board is closed.
#### <a name="event-close"></a> .on('droppedPacket', callback)
#### <a name="event-dropped-packet"></a> .on('droppedPacket', callback)
Emitted when a packet (or packets) are dropped. Returns an array.
Expand Down Expand Up @@ -1171,7 +1171,7 @@ Emitted when the board is in a ready to start streaming state.
Emitted when there is a new sample available.
#### <a name="event-sample"></a> .on('synced', callback)
#### <a name="event-synced"></a> .on('synced', callback)
Emitted when there is a new sample available.
Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2.0.1

### Bug Fixes

* Debug bytes was set to always print in processBytes

# 2.0.0

### New Features
Expand Down
4 changes: 2 additions & 2 deletions openBCICyton.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ Cyton.prototype.write = function (dataToWrite) {
* @author AJ Keller (@pushtheworldllc)
*/
Cyton.prototype._writeAndDrain = function (data) {
obciDebug.debugBytes('>>>', data);
if (this.options.debug) obciDebug.debugBytes('>>>', data);

return new Promise((resolve, reject) => {
if (!this.isConnected()) return reject(Error('Serial port not open'));
Expand Down Expand Up @@ -1772,7 +1772,7 @@ Cyton.prototype.syncClocksFull = function () {
* @author AJ Keller (@pushtheworldllc)
*/
Cyton.prototype._processBytes = function (data) {
obciDebug.debugBytes(this.curParsingMode + '<<', data);
if (this.options.debug) obciDebug.debugBytes(this.curParsingMode + '<<', data);

// Concat old buffer
var oldDataBuffer = null;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openbci",
"version": "2.0.0",
"version": "2.0.1",
"description": "The official Node.js SDK for the OpenBCI Biosensor Board.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 259af35

Please sign in to comment.