Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW
Diff: SnCommWin.h
- Revision:
- 21:ce51bb0ba4a5
- Parent:
- 18:55f1581f2ee4
- Child:
- 23:ccf39298f205
diff -r e5857b287b3b -r ce51bb0ba4a5 SnCommWin.h
--- a/SnCommWin.h Wed Oct 03 00:22:27 2012 +0000
+++ b/SnCommWin.h Wed Oct 10 05:54:12 2012 +0000
@@ -3,6 +3,7 @@
#include "mbed.h"
#include <stdint.h>
+#include <string>
#include "SnConfigFrame.h"
class SnEventFrame;
@@ -27,7 +28,23 @@
kOkWithMsg, // successfully received message
kOkWthMsgNoConf // successfully received message and it says to stick with the same config
};
-
+
+ private:
+ SnCommWin::ECommWinResult GetFilename(const uint32_t timeout,
+ char* const buf,
+ const uint32_t namelen);
+ SnCommWin::ECommWinResult GetLocalFile(std::string fname,
+ char* const buf,
+ const uint32_t bsize,
+ const uint32_t timeout);
+ int16_t LoopLocalDirBinFiles(const bool doRemove,
+ const std::string& fname);
+ SnCommWin::ECommWinResult GetHeader(const uint32_t timeOut,
+ char* const buf,
+ const uint32_t bsize,
+ uint8_t& mcode,
+ uint32_t& mlen);
+
protected:
virtual int SendFileBlock(FILE* inf,
@@ -44,6 +61,8 @@
uint32_t nevts,
const uint32_t timeout_clock);
+ // send and receive must not kick the watchdog, or a bad timeout
+ // could block a station forever!
virtual int32_t ReceiveAll(char* const buf, const uint32_t mlen,
const uint32_t timeout_clock)=0;
virtual int32_t SendAll(char* const data, const uint32_t length,
@@ -75,7 +94,8 @@
virtual bool CloseConn(const uint32_t timeout)=0;
virtual uint32_t GetConnectTimeout() const;
virtual uint32_t GetListenTimeout() const;
- virtual ECommWinResult WaitHandshake(const uint32_t timeout,
+ virtual ECommWinResult WaitHandshake(const SnConfigFrame& conf,
+ const uint32_t timeout,
char* const buf,
const uint32_t bsize,
uint8_t& hndShkCode);