Host library for controlling a WiConnect enabled Wi-Fi module.
Dependents: wiconnect-ota_example wiconnect-web_setup_example wiconnect-test-console wiconnect-tcp_server_example ... more
Diff: types/QueuedCommand.h
- Revision:
- 0:ea85c4bb5e1f
- Child:
- 1:6ec9998427ad
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/types/QueuedCommand.h Mon Aug 11 09:58:24 2014 +0000 @@ -0,0 +1,66 @@ +/* + * Copyright 2014, ACKme Networks + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of ACKme Networks; + * the contents of this file may not be disclosed to third parties, copied + * or duplicated in any form, in whole or in part, without the prior + * written permission of ACKme Networks. + */ + +#pragma once + + +#include "WiconnectTypes.h" + + +namespace wiconnect +{ + +class QueuedCommand +{ +public: + void *userData; + + + QueuedCommand(int responseBufferLen, char *responseBuffer, int timeoutMs, const ReaderFunc &reader, void *user, const char *cmd, va_list vaList); + QueuedCommand(int responseBufferLen, char *responseBuffer, int timeoutMs, const char *cmd, ...); + QueuedCommand(int responseBufferLen, char *responseBuffer, const char *cmd, ...); + QueuedCommand(int timeoutMs_, const char *cmd, ...); + QueuedCommand(const char *cmd, ...); + ~QueuedCommand(); + + char *getResponseBuffer(); + int getResponseBufferLen(); + int getTimeoutMs(); + ReaderFunc getReader(); + void * getReaderUserData(); + char* getCommand(); + Callback getCompletedCallback(); + void setCompletedCallback(const Callback &cb); + + QueuedCommand& operator=( const QueuedCommand& other ); + void* operator new(size_t size); + void operator delete(void*); + +protected: + char *responseBuffer; + int responseBufferLen; + int timeoutMs; + ReaderFunc reader; + void *user; + char command[WICONNECT_MAX_CMD_SIZE]; + Callback completeCallback; +#ifdef WICONNECT_ENABLE_MALLOC + bool allocatedBuffer; +#endif + friend class NetworkInterface; + friend class Wiconnect; + + void initialize(int responseBufferLen, char *responseBuffer_, int timeoutMs_, const ReaderFunc &reader_, void *user_, const char *cmd_, va_list vaList); +}; + + + +} +