Knight KE
/
Game_Master
游戏王对战板,目前code还是空的
mbed-os/platform/ATCmdParser.h@0:9b3d4731edbb, 2018-06-21 (annotated)
- Committer:
- WFKnight
- Date:
- Thu Jun 21 13:51:43 2018 +0000
- Revision:
- 0:9b3d4731edbb
UART, RTOS, LED
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
WFKnight | 0:9b3d4731edbb | 1 | /* Copyright (c) 2017 ARM Limited |
WFKnight | 0:9b3d4731edbb | 2 | * |
WFKnight | 0:9b3d4731edbb | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
WFKnight | 0:9b3d4731edbb | 4 | * you may not use this file except in compliance with the License. |
WFKnight | 0:9b3d4731edbb | 5 | * You may obtain a copy of the License at |
WFKnight | 0:9b3d4731edbb | 6 | * |
WFKnight | 0:9b3d4731edbb | 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
WFKnight | 0:9b3d4731edbb | 8 | * |
WFKnight | 0:9b3d4731edbb | 9 | * Unless required by applicable law or agreed to in writing, software |
WFKnight | 0:9b3d4731edbb | 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
WFKnight | 0:9b3d4731edbb | 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
WFKnight | 0:9b3d4731edbb | 12 | * See the License for the specific language governing permissions and |
WFKnight | 0:9b3d4731edbb | 13 | * limitations under the License. |
WFKnight | 0:9b3d4731edbb | 14 | * |
WFKnight | 0:9b3d4731edbb | 15 | * @section DESCRIPTION |
WFKnight | 0:9b3d4731edbb | 16 | * |
WFKnight | 0:9b3d4731edbb | 17 | * Parser for the AT command syntax |
WFKnight | 0:9b3d4731edbb | 18 | * |
WFKnight | 0:9b3d4731edbb | 19 | */ |
WFKnight | 0:9b3d4731edbb | 20 | #ifndef MBED_ATCMDPARSER_H |
WFKnight | 0:9b3d4731edbb | 21 | #define MBED_ATCMDPARSER_H |
WFKnight | 0:9b3d4731edbb | 22 | |
WFKnight | 0:9b3d4731edbb | 23 | #include "mbed.h" |
WFKnight | 0:9b3d4731edbb | 24 | #include <cstdarg> |
WFKnight | 0:9b3d4731edbb | 25 | #include "Callback.h" |
WFKnight | 0:9b3d4731edbb | 26 | |
WFKnight | 0:9b3d4731edbb | 27 | namespace mbed { |
WFKnight | 0:9b3d4731edbb | 28 | |
WFKnight | 0:9b3d4731edbb | 29 | /** \addtogroup platform */ |
WFKnight | 0:9b3d4731edbb | 30 | /** @{*/ |
WFKnight | 0:9b3d4731edbb | 31 | /** |
WFKnight | 0:9b3d4731edbb | 32 | * \defgroup platform_ATCmdParser ATCmdParser class |
WFKnight | 0:9b3d4731edbb | 33 | * @{ |
WFKnight | 0:9b3d4731edbb | 34 | */ |
WFKnight | 0:9b3d4731edbb | 35 | |
WFKnight | 0:9b3d4731edbb | 36 | /** |
WFKnight | 0:9b3d4731edbb | 37 | * Parser class for parsing AT commands |
WFKnight | 0:9b3d4731edbb | 38 | * |
WFKnight | 0:9b3d4731edbb | 39 | * Here are some examples: |
WFKnight | 0:9b3d4731edbb | 40 | * @code |
WFKnight | 0:9b3d4731edbb | 41 | * UARTSerial serial = UARTSerial(D1, D0); |
WFKnight | 0:9b3d4731edbb | 42 | * ATCmdParser at = ATCmdParser(&serial, "\r\n"); |
WFKnight | 0:9b3d4731edbb | 43 | * int value; |
WFKnight | 0:9b3d4731edbb | 44 | * char buffer[100]; |
WFKnight | 0:9b3d4731edbb | 45 | * |
WFKnight | 0:9b3d4731edbb | 46 | * at.send("AT") && at.recv("OK"); |
WFKnight | 0:9b3d4731edbb | 47 | * at.send("AT+CWMODE=%d", 3) && at.recv("OK"); |
WFKnight | 0:9b3d4731edbb | 48 | * at.send("AT+CWMODE?") && at.recv("+CWMODE:%d\r\nOK", &value); |
WFKnight | 0:9b3d4731edbb | 49 | * at.recv("+IPD,%d:", &value); |
WFKnight | 0:9b3d4731edbb | 50 | * at.read(buffer, value); |
WFKnight | 0:9b3d4731edbb | 51 | * at.recv("OK"); |
WFKnight | 0:9b3d4731edbb | 52 | * @endcode |
WFKnight | 0:9b3d4731edbb | 53 | */ |
WFKnight | 0:9b3d4731edbb | 54 | |
WFKnight | 0:9b3d4731edbb | 55 | class ATCmdParser : private NonCopyable<ATCmdParser> |
WFKnight | 0:9b3d4731edbb | 56 | { |
WFKnight | 0:9b3d4731edbb | 57 | private: |
WFKnight | 0:9b3d4731edbb | 58 | // File handle |
WFKnight | 0:9b3d4731edbb | 59 | // Not owned by ATCmdParser |
WFKnight | 0:9b3d4731edbb | 60 | FileHandle *_fh; |
WFKnight | 0:9b3d4731edbb | 61 | |
WFKnight | 0:9b3d4731edbb | 62 | int _buffer_size; |
WFKnight | 0:9b3d4731edbb | 63 | char *_buffer; |
WFKnight | 0:9b3d4731edbb | 64 | int _timeout; |
WFKnight | 0:9b3d4731edbb | 65 | |
WFKnight | 0:9b3d4731edbb | 66 | // Parsing information |
WFKnight | 0:9b3d4731edbb | 67 | const char *_output_delimiter; |
WFKnight | 0:9b3d4731edbb | 68 | int _output_delim_size; |
WFKnight | 0:9b3d4731edbb | 69 | char _in_prev; |
WFKnight | 0:9b3d4731edbb | 70 | bool _dbg_on; |
WFKnight | 0:9b3d4731edbb | 71 | bool _aborted; |
WFKnight | 0:9b3d4731edbb | 72 | |
WFKnight | 0:9b3d4731edbb | 73 | struct oob { |
WFKnight | 0:9b3d4731edbb | 74 | unsigned len; |
WFKnight | 0:9b3d4731edbb | 75 | const char *prefix; |
WFKnight | 0:9b3d4731edbb | 76 | mbed::Callback<void()> cb; |
WFKnight | 0:9b3d4731edbb | 77 | oob *next; |
WFKnight | 0:9b3d4731edbb | 78 | }; |
WFKnight | 0:9b3d4731edbb | 79 | oob *_oobs; |
WFKnight | 0:9b3d4731edbb | 80 | |
WFKnight | 0:9b3d4731edbb | 81 | public: |
WFKnight | 0:9b3d4731edbb | 82 | |
WFKnight | 0:9b3d4731edbb | 83 | /** |
WFKnight | 0:9b3d4731edbb | 84 | * Constructor |
WFKnight | 0:9b3d4731edbb | 85 | * |
WFKnight | 0:9b3d4731edbb | 86 | * @param fh A FileHandle to a digital interface to use for AT commands |
WFKnight | 0:9b3d4731edbb | 87 | * @param output_delimiter end of command line termination |
WFKnight | 0:9b3d4731edbb | 88 | * @param buffer_size size of internal buffer for transaction |
WFKnight | 0:9b3d4731edbb | 89 | * @param timeout timeout of the connection |
WFKnight | 0:9b3d4731edbb | 90 | * @param debug turns on/off debug output for AT commands |
WFKnight | 0:9b3d4731edbb | 91 | */ |
WFKnight | 0:9b3d4731edbb | 92 | ATCmdParser(FileHandle *fh, const char *output_delimiter = "\r", |
WFKnight | 0:9b3d4731edbb | 93 | int buffer_size = 256, int timeout = 8000, bool debug = false) |
WFKnight | 0:9b3d4731edbb | 94 | : _fh(fh), _buffer_size(buffer_size), _in_prev(0), _oobs(NULL) |
WFKnight | 0:9b3d4731edbb | 95 | { |
WFKnight | 0:9b3d4731edbb | 96 | _buffer = new char[buffer_size]; |
WFKnight | 0:9b3d4731edbb | 97 | set_timeout(timeout); |
WFKnight | 0:9b3d4731edbb | 98 | set_delimiter(output_delimiter); |
WFKnight | 0:9b3d4731edbb | 99 | debug_on(debug); |
WFKnight | 0:9b3d4731edbb | 100 | } |
WFKnight | 0:9b3d4731edbb | 101 | |
WFKnight | 0:9b3d4731edbb | 102 | /** |
WFKnight | 0:9b3d4731edbb | 103 | * Destructor |
WFKnight | 0:9b3d4731edbb | 104 | */ |
WFKnight | 0:9b3d4731edbb | 105 | ~ATCmdParser() |
WFKnight | 0:9b3d4731edbb | 106 | { |
WFKnight | 0:9b3d4731edbb | 107 | while (_oobs) { |
WFKnight | 0:9b3d4731edbb | 108 | struct oob *oob = _oobs; |
WFKnight | 0:9b3d4731edbb | 109 | _oobs = oob->next; |
WFKnight | 0:9b3d4731edbb | 110 | delete oob; |
WFKnight | 0:9b3d4731edbb | 111 | } |
WFKnight | 0:9b3d4731edbb | 112 | delete[] _buffer; |
WFKnight | 0:9b3d4731edbb | 113 | } |
WFKnight | 0:9b3d4731edbb | 114 | |
WFKnight | 0:9b3d4731edbb | 115 | /** |
WFKnight | 0:9b3d4731edbb | 116 | * Allows timeout to be changed between commands |
WFKnight | 0:9b3d4731edbb | 117 | * |
WFKnight | 0:9b3d4731edbb | 118 | * @param timeout timeout of the connection |
WFKnight | 0:9b3d4731edbb | 119 | */ |
WFKnight | 0:9b3d4731edbb | 120 | void set_timeout(int timeout) |
WFKnight | 0:9b3d4731edbb | 121 | { |
WFKnight | 0:9b3d4731edbb | 122 | _timeout = timeout; |
WFKnight | 0:9b3d4731edbb | 123 | } |
WFKnight | 0:9b3d4731edbb | 124 | |
WFKnight | 0:9b3d4731edbb | 125 | /** |
WFKnight | 0:9b3d4731edbb | 126 | * For backwards compatibility. |
WFKnight | 0:9b3d4731edbb | 127 | * @deprecated Do not use this function. This function has been replaced with set_timeout for consistency. |
WFKnight | 0:9b3d4731edbb | 128 | * |
WFKnight | 0:9b3d4731edbb | 129 | * Please use set_timeout(int) API only from now on. |
WFKnight | 0:9b3d4731edbb | 130 | * Allows timeout to be changed between commands |
WFKnight | 0:9b3d4731edbb | 131 | * |
WFKnight | 0:9b3d4731edbb | 132 | * @param timeout timeout of the connection |
WFKnight | 0:9b3d4731edbb | 133 | */ |
WFKnight | 0:9b3d4731edbb | 134 | MBED_DEPRECATED_SINCE("mbed-os-5.5.0", "Replaced with set_timeout for consistency") |
WFKnight | 0:9b3d4731edbb | 135 | void setTimeout(int timeout) |
WFKnight | 0:9b3d4731edbb | 136 | { |
WFKnight | 0:9b3d4731edbb | 137 | set_timeout(timeout); |
WFKnight | 0:9b3d4731edbb | 138 | } |
WFKnight | 0:9b3d4731edbb | 139 | |
WFKnight | 0:9b3d4731edbb | 140 | /** |
WFKnight | 0:9b3d4731edbb | 141 | * Sets string of characters to use as line delimiters |
WFKnight | 0:9b3d4731edbb | 142 | * |
WFKnight | 0:9b3d4731edbb | 143 | * @param output_delimiter string of characters to use as line delimiters |
WFKnight | 0:9b3d4731edbb | 144 | */ |
WFKnight | 0:9b3d4731edbb | 145 | void set_delimiter(const char *output_delimiter) |
WFKnight | 0:9b3d4731edbb | 146 | { |
WFKnight | 0:9b3d4731edbb | 147 | _output_delimiter = output_delimiter; |
WFKnight | 0:9b3d4731edbb | 148 | _output_delim_size = strlen(output_delimiter); |
WFKnight | 0:9b3d4731edbb | 149 | } |
WFKnight | 0:9b3d4731edbb | 150 | |
WFKnight | 0:9b3d4731edbb | 151 | /** |
WFKnight | 0:9b3d4731edbb | 152 | * For backwards compatibility. |
WFKnight | 0:9b3d4731edbb | 153 | * @deprecated Do not use this function. This function has been replaced with set_delimiter for consistency. |
WFKnight | 0:9b3d4731edbb | 154 | * |
WFKnight | 0:9b3d4731edbb | 155 | * Please use set_delimiter(const char *) API only from now on. |
WFKnight | 0:9b3d4731edbb | 156 | * Sets string of characters to use as line delimiters |
WFKnight | 0:9b3d4731edbb | 157 | * |
WFKnight | 0:9b3d4731edbb | 158 | * @param output_delimiter string of characters to use as line delimiters |
WFKnight | 0:9b3d4731edbb | 159 | */ |
WFKnight | 0:9b3d4731edbb | 160 | MBED_DEPRECATED_SINCE("mbed-os-5.5.0", "Replaced with set_delimiter for consistency") |
WFKnight | 0:9b3d4731edbb | 161 | void setDelimiter(const char *output_delimiter) |
WFKnight | 0:9b3d4731edbb | 162 | { |
WFKnight | 0:9b3d4731edbb | 163 | set_delimiter(output_delimiter); |
WFKnight | 0:9b3d4731edbb | 164 | } |
WFKnight | 0:9b3d4731edbb | 165 | |
WFKnight | 0:9b3d4731edbb | 166 | /** |
WFKnight | 0:9b3d4731edbb | 167 | * Allows traces from modem to be turned on or off |
WFKnight | 0:9b3d4731edbb | 168 | * |
WFKnight | 0:9b3d4731edbb | 169 | * @param on set as 1 to turn on traces and vice versa. |
WFKnight | 0:9b3d4731edbb | 170 | */ |
WFKnight | 0:9b3d4731edbb | 171 | void debug_on(uint8_t on) |
WFKnight | 0:9b3d4731edbb | 172 | { |
WFKnight | 0:9b3d4731edbb | 173 | _dbg_on = (on) ? 1 : 0; |
WFKnight | 0:9b3d4731edbb | 174 | } |
WFKnight | 0:9b3d4731edbb | 175 | |
WFKnight | 0:9b3d4731edbb | 176 | /** |
WFKnight | 0:9b3d4731edbb | 177 | * For backwards compatibility. |
WFKnight | 0:9b3d4731edbb | 178 | * @deprecated Do not use this function. This function has been replaced with debug_on for consistency. |
WFKnight | 0:9b3d4731edbb | 179 | * |
WFKnight | 0:9b3d4731edbb | 180 | * Allows traces from modem to be turned on or off |
WFKnight | 0:9b3d4731edbb | 181 | * |
WFKnight | 0:9b3d4731edbb | 182 | * @param on set as 1 to turn on traces and vice versa. |
WFKnight | 0:9b3d4731edbb | 183 | */ |
WFKnight | 0:9b3d4731edbb | 184 | MBED_DEPRECATED_SINCE("mbed-os-5.5.0", "Replaced with debug_on for consistency") |
WFKnight | 0:9b3d4731edbb | 185 | void debugOn(uint8_t on) |
WFKnight | 0:9b3d4731edbb | 186 | { |
WFKnight | 0:9b3d4731edbb | 187 | debug_on(on); |
WFKnight | 0:9b3d4731edbb | 188 | } |
WFKnight | 0:9b3d4731edbb | 189 | |
WFKnight | 0:9b3d4731edbb | 190 | /** |
WFKnight | 0:9b3d4731edbb | 191 | * Sends an AT command |
WFKnight | 0:9b3d4731edbb | 192 | * |
WFKnight | 0:9b3d4731edbb | 193 | * Sends a formatted command using printf style formatting |
WFKnight | 0:9b3d4731edbb | 194 | * @see printf |
WFKnight | 0:9b3d4731edbb | 195 | * |
WFKnight | 0:9b3d4731edbb | 196 | * @param command printf-like format string of command to send which |
WFKnight | 0:9b3d4731edbb | 197 | * is appended with a newline |
WFKnight | 0:9b3d4731edbb | 198 | * @param ... all printf-like arguments to insert into command |
WFKnight | 0:9b3d4731edbb | 199 | * @return true only if command is successfully sent |
WFKnight | 0:9b3d4731edbb | 200 | */ |
WFKnight | 0:9b3d4731edbb | 201 | bool send(const char *command, ...) MBED_PRINTF_METHOD(1,2); |
WFKnight | 0:9b3d4731edbb | 202 | |
WFKnight | 0:9b3d4731edbb | 203 | bool vsend(const char *command, va_list args); |
WFKnight | 0:9b3d4731edbb | 204 | |
WFKnight | 0:9b3d4731edbb | 205 | /** |
WFKnight | 0:9b3d4731edbb | 206 | * Receive an AT response |
WFKnight | 0:9b3d4731edbb | 207 | * |
WFKnight | 0:9b3d4731edbb | 208 | * Receives a formatted response using scanf style formatting |
WFKnight | 0:9b3d4731edbb | 209 | * @see scanf |
WFKnight | 0:9b3d4731edbb | 210 | * |
WFKnight | 0:9b3d4731edbb | 211 | * Responses are parsed line at a time. |
WFKnight | 0:9b3d4731edbb | 212 | * Any received data that does not match the response is ignored until |
WFKnight | 0:9b3d4731edbb | 213 | * a timeout occurs. |
WFKnight | 0:9b3d4731edbb | 214 | * |
WFKnight | 0:9b3d4731edbb | 215 | * @param response scanf-like format string of response to expect |
WFKnight | 0:9b3d4731edbb | 216 | * @param ... all scanf-like arguments to extract from response |
WFKnight | 0:9b3d4731edbb | 217 | * @return true only if response is successfully matched |
WFKnight | 0:9b3d4731edbb | 218 | */ |
WFKnight | 0:9b3d4731edbb | 219 | bool recv(const char *response, ...) MBED_SCANF_METHOD(1,2); |
WFKnight | 0:9b3d4731edbb | 220 | |
WFKnight | 0:9b3d4731edbb | 221 | bool vrecv(const char *response, va_list args); |
WFKnight | 0:9b3d4731edbb | 222 | |
WFKnight | 0:9b3d4731edbb | 223 | /** |
WFKnight | 0:9b3d4731edbb | 224 | * Write a single byte to the underlying stream |
WFKnight | 0:9b3d4731edbb | 225 | * |
WFKnight | 0:9b3d4731edbb | 226 | * @param c The byte to write |
WFKnight | 0:9b3d4731edbb | 227 | * @return The byte that was written or -1 during a timeout |
WFKnight | 0:9b3d4731edbb | 228 | */ |
WFKnight | 0:9b3d4731edbb | 229 | int putc(char c); |
WFKnight | 0:9b3d4731edbb | 230 | |
WFKnight | 0:9b3d4731edbb | 231 | /** |
WFKnight | 0:9b3d4731edbb | 232 | * Get a single byte from the underlying stream |
WFKnight | 0:9b3d4731edbb | 233 | * |
WFKnight | 0:9b3d4731edbb | 234 | * @return The byte that was read or -1 during a timeout |
WFKnight | 0:9b3d4731edbb | 235 | */ |
WFKnight | 0:9b3d4731edbb | 236 | int getc(); |
WFKnight | 0:9b3d4731edbb | 237 | |
WFKnight | 0:9b3d4731edbb | 238 | /** |
WFKnight | 0:9b3d4731edbb | 239 | * Write an array of bytes to the underlying stream |
WFKnight | 0:9b3d4731edbb | 240 | * |
WFKnight | 0:9b3d4731edbb | 241 | * @param data the array of bytes to write |
WFKnight | 0:9b3d4731edbb | 242 | * @param size number of bytes to write |
WFKnight | 0:9b3d4731edbb | 243 | * @return number of bytes written or -1 on failure |
WFKnight | 0:9b3d4731edbb | 244 | */ |
WFKnight | 0:9b3d4731edbb | 245 | int write(const char *data, int size); |
WFKnight | 0:9b3d4731edbb | 246 | |
WFKnight | 0:9b3d4731edbb | 247 | /** |
WFKnight | 0:9b3d4731edbb | 248 | * Read an array of bytes from the underlying stream |
WFKnight | 0:9b3d4731edbb | 249 | * |
WFKnight | 0:9b3d4731edbb | 250 | * @param data the destination for the read bytes |
WFKnight | 0:9b3d4731edbb | 251 | * @param size number of bytes to read |
WFKnight | 0:9b3d4731edbb | 252 | * @return number of bytes read or -1 on failure |
WFKnight | 0:9b3d4731edbb | 253 | */ |
WFKnight | 0:9b3d4731edbb | 254 | int read(char *data, int size); |
WFKnight | 0:9b3d4731edbb | 255 | |
WFKnight | 0:9b3d4731edbb | 256 | /** |
WFKnight | 0:9b3d4731edbb | 257 | * Direct printf to underlying stream |
WFKnight | 0:9b3d4731edbb | 258 | * @see printf |
WFKnight | 0:9b3d4731edbb | 259 | * |
WFKnight | 0:9b3d4731edbb | 260 | * @param format format string to pass to printf |
WFKnight | 0:9b3d4731edbb | 261 | * @param ... arguments to printf |
WFKnight | 0:9b3d4731edbb | 262 | * @return number of bytes written or -1 on failure |
WFKnight | 0:9b3d4731edbb | 263 | */ |
WFKnight | 0:9b3d4731edbb | 264 | int printf(const char *format, ...) MBED_PRINTF_METHOD(1,2); |
WFKnight | 0:9b3d4731edbb | 265 | |
WFKnight | 0:9b3d4731edbb | 266 | int vprintf(const char *format, va_list args); |
WFKnight | 0:9b3d4731edbb | 267 | |
WFKnight | 0:9b3d4731edbb | 268 | /** |
WFKnight | 0:9b3d4731edbb | 269 | * Direct scanf on underlying stream |
WFKnight | 0:9b3d4731edbb | 270 | * @see scanf |
WFKnight | 0:9b3d4731edbb | 271 | * |
WFKnight | 0:9b3d4731edbb | 272 | * @param format format string to pass to scanf |
WFKnight | 0:9b3d4731edbb | 273 | * @param ... arguments to scanf |
WFKnight | 0:9b3d4731edbb | 274 | * @return number of bytes read or -1 on failure |
WFKnight | 0:9b3d4731edbb | 275 | */ |
WFKnight | 0:9b3d4731edbb | 276 | int scanf(const char *format, ...) MBED_SCANF_METHOD(1,2); |
WFKnight | 0:9b3d4731edbb | 277 | |
WFKnight | 0:9b3d4731edbb | 278 | int vscanf(const char *format, va_list args); |
WFKnight | 0:9b3d4731edbb | 279 | |
WFKnight | 0:9b3d4731edbb | 280 | /** |
WFKnight | 0:9b3d4731edbb | 281 | * Attach a callback for out-of-band data |
WFKnight | 0:9b3d4731edbb | 282 | * |
WFKnight | 0:9b3d4731edbb | 283 | * @param prefix string on when to initiate callback |
WFKnight | 0:9b3d4731edbb | 284 | * @param func callback to call when string is read |
WFKnight | 0:9b3d4731edbb | 285 | * @note out-of-band data is only processed during a scanf call |
WFKnight | 0:9b3d4731edbb | 286 | */ |
WFKnight | 0:9b3d4731edbb | 287 | void oob(const char *prefix, mbed::Callback<void()> func); |
WFKnight | 0:9b3d4731edbb | 288 | |
WFKnight | 0:9b3d4731edbb | 289 | /** |
WFKnight | 0:9b3d4731edbb | 290 | * Flushes the underlying stream |
WFKnight | 0:9b3d4731edbb | 291 | */ |
WFKnight | 0:9b3d4731edbb | 292 | void flush(); |
WFKnight | 0:9b3d4731edbb | 293 | |
WFKnight | 0:9b3d4731edbb | 294 | /** |
WFKnight | 0:9b3d4731edbb | 295 | * Abort current recv |
WFKnight | 0:9b3d4731edbb | 296 | * |
WFKnight | 0:9b3d4731edbb | 297 | * Can be called from oob handler to interrupt the current |
WFKnight | 0:9b3d4731edbb | 298 | * recv operation. |
WFKnight | 0:9b3d4731edbb | 299 | */ |
WFKnight | 0:9b3d4731edbb | 300 | void abort(); |
WFKnight | 0:9b3d4731edbb | 301 | |
WFKnight | 0:9b3d4731edbb | 302 | /** |
WFKnight | 0:9b3d4731edbb | 303 | * Process out-of-band data |
WFKnight | 0:9b3d4731edbb | 304 | * |
WFKnight | 0:9b3d4731edbb | 305 | * Process out-of-band data in the receive buffer. This function |
WFKnight | 0:9b3d4731edbb | 306 | * returns immediately if there is no data to process. |
WFKnight | 0:9b3d4731edbb | 307 | * |
WFKnight | 0:9b3d4731edbb | 308 | * @return true if oob data processed, false otherwise |
WFKnight | 0:9b3d4731edbb | 309 | */ |
WFKnight | 0:9b3d4731edbb | 310 | bool process_oob(void); |
WFKnight | 0:9b3d4731edbb | 311 | }; |
WFKnight | 0:9b3d4731edbb | 312 | |
WFKnight | 0:9b3d4731edbb | 313 | /**@}*/ |
WFKnight | 0:9b3d4731edbb | 314 | |
WFKnight | 0:9b3d4731edbb | 315 | /**@}*/ |
WFKnight | 0:9b3d4731edbb | 316 | |
WFKnight | 0:9b3d4731edbb | 317 | } //namespace mbed |
WFKnight | 0:9b3d4731edbb | 318 | |
WFKnight | 0:9b3d4731edbb | 319 | #endif //MBED_ATCMDPARSER_H |