publish final code
Dependencies: WncControllerK64F
Fork of WNCInterface by
Revision 11:75cf1e1c921c, committed 2016-10-31
- Comitter:
- JMF
- Date:
- Mon Oct 31 13:54:21 2016 +0000
- Parent:
- 10:9d8b23b60fd6
- Child:
- 12:0071cb144c7a
- Commit message:
- Added changes to slow down polling of the WNC data module. Frequent polling appears to cause problems for WNC.
Changed in this revision
Socket/TCPSocketConnection.cpp | Show annotated file Show diff for this revision Revisions of this file |
WncControllerK64F.lib | Show annotated file Show diff for this revision Revisions of this file |
--- a/Socket/TCPSocketConnection.cpp Fri Oct 07 13:54:09 2016 +0000 +++ b/Socket/TCPSocketConnection.cpp Mon Oct 31 13:54:21 2016 +0000 @@ -23,6 +23,8 @@ #include "TCPSocketConnection.h" #include <cstring> +#define READ_EVERYMS 500 //number of milliseconds between WNC socket reads + TCPSocketConnection::TCPSocketConnection() : _is_blocking(0), _btimeout(0){ @@ -80,10 +82,11 @@ if( s != WncController_fk::WncController::WNC_ON ) return ret; + M_LOCK; t.start(); - M_LOCK; do { - cnt = WNCInterface::_pwnc->read(0, (uint8_t *)readBuf, (uint32_t) length); + if( !(t.read_ms() % READ_EVERYMS) ) + cnt = WNCInterface::_pwnc->read(0, (uint8_t *)readBuf, (uint32_t) length); if( _is_blocking ) done = cnt; else @@ -94,7 +97,7 @@ M_ULOCK; if( WNCInterface::_pwnc->getWncStatus() == WNC_GOOD ) { - readBuf[cnt] = '\0'; + //readBuf[cnt] = '\0'; ret = (int)cnt; } else
--- a/WncControllerK64F.lib Fri Oct 07 13:54:09 2016 +0000 +++ b/WncControllerK64F.lib Mon Oct 31 13:54:21 2016 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/users/fkellermavnet/code/WncControllerK64F/#846140c6589f +https://developer.mbed.org/users/fkellermavnet/code/WncControllerK64F/#10cae290b2d1