openbci-archive / OpenBCI_NodeJS

Node.js SDK for the all OpenBCI Biosensor Boards
https://www.npmjs.com/package/openbci
137 stars 52 forks source link

Simulate packet fragmentation; fixes #100 #101

Closed baffo32 closed 7 years ago

baffo32 commented 7 years ago

This adjusts the simulator to behave a little more like reality, such that packets are split into pieces when received.

I have verified that all of the failing tests are due to issues that this additional simulation reveals, and not bugs in it. They should be fixed either in the tests or in the main library.

andrewjaykeller commented 7 years ago

Good stuff!! Very excited to get this on the books! Could you also please update the changeling.md for this feature and we gotta add #98 too!!

codecov-io commented 7 years ago

Current coverage is 93.65% (diff: 94.89%)

Merging #101 into 1.4.0 will increase coverage by 0.12%

@@              1.4.0       #101   diff @@
==========================================
  Files             4          4          
  Lines          2180       2237    +57   
  Methods         126        128     +2   
  Messages          0          0          
  Branches        475        494    +19   
==========================================
+ Hits           2039       2095    +56   
- Misses          141        142     +1   
  Partials          0          0          

Powered by Codecov. Last update 7d78748...83ac939

baffo32 commented 7 years ago

grumph, grumph, coverage ...

baffo32 commented 7 years ago

Ready for merge.

andrewjaykeller commented 7 years ago

Ok will review shortly.

andrewjaykeller commented 7 years ago

Need to add tests to make sure setting a simulator option from the top most options actually changes that in the simulator.

Please add tests here for bufferSize, fragmentation, and latencyTimer https://github.com/OpenBCI/OpenBCI_NodeJS/blob/master/test/openBCIBoard-test.js#L398-L410

baffo32 commented 7 years ago

test failure looks like a spurious issue revealed by fragmentation simulation

andrewjaykeller commented 7 years ago

test failure looks like a spurious issue revealed by fragmentation simulation

Really?! It seemed like some weird linux thing, great news to hear though.

baffo32 commented 7 years ago

@aj-ptw, I think I've implemented your requested changes. Also fixed spurious issue.

baffo32 commented 7 years ago

whoops, need to give random coverage now

andrewjaykeller commented 7 years ago

@baffo32 haha i was about to merge it but then i saw the code coverage report

baffo32 commented 7 years ago

done!

andrewjaykeller commented 7 years ago

Great thanks! @baffo32