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
types/QueuedCommand.h@13:2b51f5267c92, 2014-08-13 (annotated)
- Committer:
- dan_ackme
- Date:
- Wed Aug 13 03:14:30 2014 -0700
- Revision:
- 13:2b51f5267c92
- Parent:
- 11:ea484e1b7fc4
- Child:
- 16:7f1d6d359787
doc updates
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dan_ackme | 0:ea85c4bb5e1f | 1 | /* |
dan_ackme | 0:ea85c4bb5e1f | 2 | * Copyright 2014, ACKme Networks |
dan_ackme | 0:ea85c4bb5e1f | 3 | * All Rights Reserved. |
dan_ackme | 0:ea85c4bb5e1f | 4 | * |
dan_ackme | 0:ea85c4bb5e1f | 5 | * This is UNPUBLISHED PROPRIETARY SOURCE CODE of ACKme Networks; |
dan_ackme | 0:ea85c4bb5e1f | 6 | * the contents of this file may not be disclosed to third parties, copied |
dan_ackme | 0:ea85c4bb5e1f | 7 | * or duplicated in any form, in whole or in part, without the prior |
dan_ackme | 0:ea85c4bb5e1f | 8 | * written permission of ACKme Networks. |
dan_ackme | 0:ea85c4bb5e1f | 9 | */ |
dan_ackme | 0:ea85c4bb5e1f | 10 | |
dan_ackme | 0:ea85c4bb5e1f | 11 | #pragma once |
dan_ackme | 0:ea85c4bb5e1f | 12 | |
dan_ackme | 0:ea85c4bb5e1f | 13 | |
dan_ackme | 0:ea85c4bb5e1f | 14 | #include "WiconnectTypes.h" |
dan_ackme | 0:ea85c4bb5e1f | 15 | |
dan_ackme | 0:ea85c4bb5e1f | 16 | |
dan_ackme | 0:ea85c4bb5e1f | 17 | namespace wiconnect |
dan_ackme | 0:ea85c4bb5e1f | 18 | { |
dan_ackme | 11:ea484e1b7fc4 | 19 | /** |
dan_ackme | 13:2b51f5267c92 | 20 | * @ingroup api_core_types |
dan_ackme | 11:ea484e1b7fc4 | 21 | * |
dan_ackme | 11:ea484e1b7fc4 | 22 | * @brief Class which contains command for asynchronous processing. |
dan_ackme | 11:ea484e1b7fc4 | 23 | */ |
dan_ackme | 0:ea85c4bb5e1f | 24 | |
dan_ackme | 0:ea85c4bb5e1f | 25 | class QueuedCommand |
dan_ackme | 0:ea85c4bb5e1f | 26 | { |
dan_ackme | 0:ea85c4bb5e1f | 27 | public: |
dan_ackme | 0:ea85c4bb5e1f | 28 | void *userData; |
dan_ackme | 0:ea85c4bb5e1f | 29 | |
dan_ackme | 0:ea85c4bb5e1f | 30 | |
dan_ackme | 0:ea85c4bb5e1f | 31 | QueuedCommand(int responseBufferLen, char *responseBuffer, int timeoutMs, const ReaderFunc &reader, void *user, const char *cmd, va_list vaList); |
dan_ackme | 0:ea85c4bb5e1f | 32 | QueuedCommand(int responseBufferLen, char *responseBuffer, int timeoutMs, const char *cmd, ...); |
dan_ackme | 0:ea85c4bb5e1f | 33 | QueuedCommand(int responseBufferLen, char *responseBuffer, const char *cmd, ...); |
dan_ackme | 0:ea85c4bb5e1f | 34 | QueuedCommand(int timeoutMs_, const char *cmd, ...); |
dan_ackme | 0:ea85c4bb5e1f | 35 | QueuedCommand(const char *cmd, ...); |
dan_ackme | 0:ea85c4bb5e1f | 36 | ~QueuedCommand(); |
dan_ackme | 0:ea85c4bb5e1f | 37 | |
dan_ackme | 0:ea85c4bb5e1f | 38 | char *getResponseBuffer(); |
dan_ackme | 0:ea85c4bb5e1f | 39 | int getResponseBufferLen(); |
dan_ackme | 0:ea85c4bb5e1f | 40 | int getTimeoutMs(); |
dan_ackme | 0:ea85c4bb5e1f | 41 | ReaderFunc getReader(); |
dan_ackme | 0:ea85c4bb5e1f | 42 | void * getReaderUserData(); |
dan_ackme | 0:ea85c4bb5e1f | 43 | char* getCommand(); |
dan_ackme | 0:ea85c4bb5e1f | 44 | Callback getCompletedCallback(); |
dan_ackme | 0:ea85c4bb5e1f | 45 | void setCompletedCallback(const Callback &cb); |
dan_ackme | 0:ea85c4bb5e1f | 46 | |
dan_ackme | 0:ea85c4bb5e1f | 47 | QueuedCommand& operator=( const QueuedCommand& other ); |
dan_ackme | 0:ea85c4bb5e1f | 48 | void* operator new(size_t size); |
dan_ackme | 0:ea85c4bb5e1f | 49 | void operator delete(void*); |
dan_ackme | 0:ea85c4bb5e1f | 50 | |
dan_ackme | 0:ea85c4bb5e1f | 51 | protected: |
dan_ackme | 0:ea85c4bb5e1f | 52 | char *responseBuffer; |
dan_ackme | 0:ea85c4bb5e1f | 53 | int responseBufferLen; |
dan_ackme | 0:ea85c4bb5e1f | 54 | int timeoutMs; |
dan_ackme | 0:ea85c4bb5e1f | 55 | ReaderFunc reader; |
dan_ackme | 0:ea85c4bb5e1f | 56 | void *user; |
dan_ackme | 0:ea85c4bb5e1f | 57 | char command[WICONNECT_MAX_CMD_SIZE]; |
dan_ackme | 0:ea85c4bb5e1f | 58 | Callback completeCallback; |
dan_ackme | 0:ea85c4bb5e1f | 59 | #ifdef WICONNECT_ENABLE_MALLOC |
dan_ackme | 0:ea85c4bb5e1f | 60 | bool allocatedBuffer; |
dan_ackme | 0:ea85c4bb5e1f | 61 | #endif |
dan_ackme | 0:ea85c4bb5e1f | 62 | friend class NetworkInterface; |
dan_ackme | 0:ea85c4bb5e1f | 63 | friend class Wiconnect; |
dan_ackme | 0:ea85c4bb5e1f | 64 | |
dan_ackme | 0:ea85c4bb5e1f | 65 | void initialize(int responseBufferLen, char *responseBuffer_, int timeoutMs_, const ReaderFunc &reader_, void *user_, const char *cmd_, va_list vaList); |
dan_ackme | 0:ea85c4bb5e1f | 66 | }; |
dan_ackme | 0:ea85c4bb5e1f | 67 | |
dan_ackme | 0:ea85c4bb5e1f | 68 | |
dan_ackme | 0:ea85c4bb5e1f | 69 | |
dan_ackme | 0:ea85c4bb5e1f | 70 | } |