Mistake on this page?
Report an issue in GitHub or email us
ATHandler.h
1 /*
2  * Copyright (c) 2017, Arm Limited and affiliates.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef AT_HANDLER_H_
19 #define AT_HANDLER_H_
20 
21 #include "platform/mbed_retarget.h"
22 
23 #include "events/EventQueue.h"
24 #include "nsapi_types.h"
25 
26 #include "Callback.h"
27 
28 #include <cstdarg>
29 
30 #include "UARTSerial.h"
31 
32 /**
33  * If application calls associated FileHandle only from single thread context
34  * then locking between AT command and response is not needed. However,
35  * note that many cellular functions are called indirectly, for example with the socket API.
36  * If you are unsure, then AT_HANDLER_MUTEX must be defined.
37  */
38 #define AT_HANDLER_MUTEX
39 
40 #if defined AT_HANDLER_MUTEX && defined MBED_CONF_RTOS_PRESENT
41 #include "ConditionVariable.h"
42 #endif
43 
44 namespace mbed {
45 
46 class FileHandle;
47 
48 extern const char *OK;
49 extern const char *CRLF;
50 
51 #define BUFF_SIZE 32
52 
53 /* AT Error types enumeration */
54 enum DeviceErrorType {
55  DeviceErrorTypeNoError = 0,
56  DeviceErrorTypeError, // AT ERROR
57  DeviceErrorTypeErrorCMS, // AT ERROR CMS
58  DeviceErrorTypeErrorCME // AT ERROR CME
59 };
60 
61 /** AT response error with error code and type */
62 struct device_err_t {
63  DeviceErrorType errType;
64  int errCode;
65 };
66 
67 /// Class for sending AT commands and parsing AT responses.
68 class ATHandler {
69 
70 public:
71  /** Constructor
72  *
73  * @param fh file handle used for reading AT responses and writing AT commands
74  * @param queue Event queue used to transfer sigio events to this thread
75  * @param timeout Timeout when reading for AT response
76  * @param output_delimiter delimiter used when parsing at responses, "\r" should be used as output_delimiter
77  * @param send_delay the minimum delay in ms between the end of last response and the beginning of a new command
78  */
79  ATHandler(FileHandle *fh, events::EventQueue &queue, uint32_t timeout, const char *output_delimiter, uint16_t send_delay = 0);
80  virtual ~ATHandler();
81 
82  /** Return used file handle.
83  *
84  * @return used file handle
85  */
86  FileHandle *get_file_handle();
87 
88  /** Get a new ATHandler instance, and update the linked list. Once the use of the ATHandler
89  * has finished, call to close() has to be made
90  *
91  * @param fileHandle filehandle used for reading AT responses and writing AT commands.
92  * If there is already an ATHandler with the same fileHandle pointer,
93  * then a pointer to that ATHandler instance will be returned with
94  * that ATHandler's queue, timeout, delimiter, send_delay and debug_on
95  * values
96  * @param queue Event queue used to transfer sigio events to this thread
97  * @param timeout Timeout when reading for AT response
98  * @param delimiter delimiter used when parsing at responses, "\r" should be used as output_delimiter
99  * @param send_delay the minimum delay in ms between the end of last response and the beginning of a new command
100  * @param debug_on Set true to enable debug traces
101  * @return NULL, if fileHandle is not set, or a pointer to an existing ATHandler, if the fileHandle is
102  * already in use. Otherwise a pointer to a new ATHandler instance is returned
103  */
104  static ATHandler *get_instance(FileHandle *fileHandle, events::EventQueue &queue, uint32_t timeout,
105  const char *delimiter, uint16_t send_delay, bool debug_on);
106 
107  /** Close and delete the current ATHandler instance, if the reference count to it is 0.
108  * Close() can be only called, if the ATHandler was opened with get_instance()
109  *
110  * @return NSAPI_ERROR_OK on success, NSAPI_ERROR_PARAMETER on failure
111  */
112  nsapi_error_t close();
113 
114  /** Locks the mutex for file handle if AT_HANDLER_MUTEX is defined.
115  */
116  void lock();
117 
118  /** Unlocks the mutex for file handle if AT_HANDLER_MUTEX is defined.
119  */
120  void unlock();
121 
122  /** Locks the mutex for file handle if AT_HANDLER_MUTEX is defined and returns the last error.
123  *
124  * @return last error that happened when parsing AT responses
125  */
126  nsapi_error_t unlock_return_error();
127 
128  /** Set callback function for URC
129  *
130  * @param prefix URC text to look for, e.g. "+CMTI:". Maximum length is BUFF_SIZE.
131  * @param callback function to call on prefix, or 0 to remove callback
132  */
133  void set_urc_handler(const char *prefix, Callback<void()> callback);
134 
135  ATHandler *_nextATHandler; // linked list
136 
137  /** returns the last error while parsing AT responses.
138  *
139  * @return last error
140  */
141  nsapi_error_t get_last_error() const;
142 
143  /** returns the last device error while parsing AT responses. Actually AT error (CME/CMS).
144  *
145  * @return last error struct device_err_t
146  */
147  device_err_t get_last_device_error() const;
148 
149  /** Increase reference count. Used for counting references to this instance.
150  * Note that this should be used with care, if the ATHandler was taken into use
151  * with get_instance()
152  */
153  void inc_ref_count();
154 
155  /** Decrease reference count. Used for counting references to this instance.
156  * Note that this should be used with care, if the ATHandler was taken into use
157  * with get_instance()
158  */
159  void dec_ref_count();
160 
161  /** Get the current reference count. Used for counting references to this instance.
162  *
163  * @return current reference count
164  */
165  int get_ref_count();
166 
167  /** Set timeout in milliseconds for AT commands
168  *
169  * @param timeout_milliseconds Timeout in milliseconds
170  * @param default_timeout Store as default timeout
171  */
172  void set_at_timeout(uint32_t timeout_milliseconds, bool default_timeout = false);
173 
174  /** Set timeout in milliseconds for all ATHandlers in the _atHandlers list
175  *
176  * @param timeout_milliseconds Timeout in milliseconds
177  * @param default_timeout Store as default timeout
178  */
179  static void set_at_timeout_list(uint32_t timeout_milliseconds, bool default_timeout = false);
180 
181  /** Restore timeout to previous timeout. Handy if there is a need to change timeout temporarily.
182  */
183  void restore_at_timeout();
184 
185  /** Clear pending error flag. By default, error is cleared only in lock().
186  */
187  void clear_error();
188 
189  /**
190  * Flushes the underlying stream
191  */
192  void flush();
193 
194  /** Tries to find oob's from the AT response. Call the urc callback if one is found.
195  */
196  void process_oob();
197 
198  /** Set file handle, which is used for reading AT responses and writing AT commands
199  *
200  * @param fh file handle used for reading AT responses and writing AT commands
201  */
202  void set_file_handle(FileHandle *fh);
203 
204  /** Set is file handle usable. Some situations like after going to data mode, file handle is not usable anymore.
205  * Any items in queue are not to be processed.
206  *
207  * @param usable true for usable filehandle
208  */
209  void set_is_filehandle_usable(bool usable);
210 
211  /** Synchronize AT command and response handling to modem.
212  *
213  * @param timeout_ms ATHandler timeout when trying to sync. Will be restored when function returns.
214  * @return true is synchronization was successful, false in case of failure
215  */
216  bool sync(int timeout_ms);
217 
218  /** Sets the delay to be applied before sending any AT command.
219  *
220  * @param send_delay the minimum delay in ms between the end of last response and the beginning of a new command
221  */
222  void set_send_delay(uint16_t send_delay);
223 
224  /** Sets UARTSerial filehandle to given baud rate
225  *
226  * @param baud_rate
227  */
228  void set_baud(int baud_rate);
229 
230 protected:
231  void event();
232 #if defined AT_HANDLER_MUTEX && defined MBED_CONF_RTOS_PRESENT
233  rtos::Mutex _fileHandleMutex;
235 #endif
236  FileHandle *_fileHandle;
237 private:
238  /** Remove urc handler from linked list of urc's
239  *
240  * @param prefix Register urc prefix for callback. Urc could be for example "+CMTI: "
241  */
242  void remove_urc_handler(const char *prefix);
243 
244  void set_error(nsapi_error_t err);
245 
246  events::EventQueue &_queue;
247  nsapi_error_t _last_err;
248  int _last_3gpp_error;
249  device_err_t _last_at_err;
250  uint16_t _oob_string_max_length;
251  char *_output_delimiter;
252 
253  struct oob_t {
254  const char *prefix;
255  int prefix_len;
256  Callback<void()> cb;
257  oob_t *next;
258  };
259  oob_t *_oobs;
260  uint32_t _at_timeout;
261  uint32_t _previous_at_timeout;
262 
263  uint16_t _at_send_delay;
264  uint64_t _last_response_stop;
265 
266  int32_t _ref_count;
267  bool _is_fh_usable;
268 
269  static ATHandler *_atHandlers;
270 
271  //*************************************
272 public:
273 
274  /** Starts the command writing by clearing the last error and writing the given command.
275  * In case of failure when writing, the last error is set to NSAPI_ERROR_DEVICE_ERROR.
276  *
277  * @param cmd AT command to be written to modem
278  */
279  virtual void cmd_start(const char *cmd);
280 
281  /**
282  * @brief cmd_start_stop Starts an AT command, writes given variadic arguments and stops the command. Use this
283  * command when you need multiple response parameters to be handled.
284  * NOTE: Does not lock ATHandler for process!
285  *
286  * @param cmd AT command in form +<CMD> (will be used also in response reading, no extra chars allowed)
287  * @param cmd_chr Char to be added to specific AT command: '?', '=' or ''. Will be used as such so '=1' is valid as well.
288  * @param format Format string for variadic arguments to be added to AT command; No separator needed.
289  * Use %d for integer, %s for string and %b for byte string (requires 2 arguments: string and length)
290  */
291  void cmd_start_stop(const char *cmd, const char *cmd_chr, const char *format = "", ...);
292 
293  /**
294  * @brief at_cmd_str Send an AT command and read a single string response. Locks and unlocks ATHandler for operation
295  * @param cmd AT command in form +<CMD> (will be used also in response reading, no extra chars allowed)
296  * @param cmd_chr Char to be added to specific AT command: '?', '=' or ''. Will be used as such so '=1' is valid as well.
297  * @param resp_buf Response buffer
298  * @param resp_buf_size Response buffer size
299  * @param format Format string for variadic arguments to be added to AT command; No separator needed.
300  * Use %d for integer, %s for string and %b for byte string (requires 2 arguments: string and length)
301  * @return last error that happened when parsing AT responses
302  */
303  nsapi_error_t at_cmd_str(const char *cmd, const char *cmd_chr, char *resp_buf, size_t resp_buf_size, const char *format = "", ...);
304 
305  /**
306  * @brief at_cmd_int Send an AT command and read a single integer response. Locks and unlocks ATHandler for operation
307  * @param cmd AT command in form +<CMD> (will be used also in response reading, no extra chars allowed)
308  * @param cmd_chr Char to be added to specific AT command: '?', '=' or ''. Will be used as such so '=1' is valid as well.
309  * @param resp Integer to hold response
310  * @param format Format string for variadic arguments to be added to AT command; No separator needed.
311  * Use %d for integer, %s for string and %b for byte string (requires 2 arguments: string and length)
312  * @return last error that happened when parsing AT responses
313  */
314  nsapi_error_t at_cmd_int(const char *cmd, const char *cmd_chr, int &resp, const char *format = "", ...);
315 
316  /**
317  * @brief at_cmd_discard Send an AT command and read and discard a response. Locks and unlocks ATHandler for operation
318  * @param cmd AT command in form +<CMD> (will be used also in response reading, no extra chars allowed)
319  * @param cmd_chr Char to be added to specific AT command: '?', '=' or ''. Will be used as such so '=1' is valid as well.
320  * @param format Format string for variadic arguments to be added to AT command; No separator needed.
321  * Use %d for integer, %s for string and %b for byte string (requires 2 arguments: string and length)
322  * @return last error that happened when parsing AT responses
323  */
324  nsapi_error_t at_cmd_discard(const char *cmd, const char *cmd_chr, const char *format = "", ...);
325 
326 public:
327 
328  /** Writes integer type AT command subparameter. Starts with the delimiter if not the first param after cmd_start.
329  * In case of failure when writing, the last error is set to NSAPI_ERROR_DEVICE_ERROR.
330  *
331  * @param param int to be written to modem as AT command subparameter
332  */
333  void write_int(int32_t param);
334 
335  /** Writes string type AT command subparamater. Quotes are added to surround the given string.
336  * Starts with the delimiter if not the first param after cmd_start.
337  * In case of failure when writing, the last error is set to NSAPI_ERROR_DEVICE_ERROR.
338  *
339  * @param param string to be written to modem as AT command subparameter
340  * @param useQuotations flag indicating whether the string should be included in quotation marks
341  */
342  void write_string(const char *param, bool useQuotations = true);
343 
344  /** Stops the AT command by writing command-line terminator CR to mark command as finished.
345  */
346  void cmd_stop();
347 
348  /** Stops the AT command by writing command-line terminator CR to mark command as finished and reads the OK/ERROR response.
349  *
350  */
351  void cmd_stop_read_resp();
352 
353  /** Write bytes without any subparameter delimiters, such as comma.
354  * In case of failure when writing, the last error is set to NSAPI_ERROR_DEVICE_ERROR.
355  *
356  * @param data bytes to be written to modem
357  * @param len length of data string
358  *
359  * @return number of characters successfully written
360  */
361  size_t write_bytes(const uint8_t *data, size_t len);
362 
363  /** Sets the stop tag for the current scope (response/information response/element)
364  * Parameter's reading routines will stop the reading when such tag is found and will set the found flag.
365  * Consume routines will read everything until such tag is found.
366  *
367  * @param stop_tag_seq string to be set as stop tag
368  */
369  void set_stop_tag(const char *stop_tag_seq);
370 
371  /** Sets the delimiter between parameters or between elements of the information response.
372  * Parameter's reading routines will stop when such char is read.
373  *
374  * @param delimiter char to be set as _delimiter
375  */
376  void set_delimiter(char delimiter);
377 
378  /** Sets the delimiter to default value defined by DEFAULT_DELIMITER.
379  */
380  void set_default_delimiter();
381 
382  /** Defines behaviour for using or ignoring the delimiter within an AT command
383  *
384  * @param use_delimiter indicating if delimiter should be used or not
385  */
386  void use_delimiter(bool use_delimiter);
387 
388  /** Consumes the reading buffer up to the delimiter or stop_tag
389  *
390  * @param count number of parameters to be skipped
391  */
392  void skip_param(uint32_t count = 1);
393 
394  /** Consumes the given length from the reading buffer
395  *
396  * @param len length to be consumed from reading buffer
397  * @param count number of parameters to be skipped
398  */
399  void skip_param(ssize_t len, uint32_t count);
400 
401  /** Reads given number of bytes from receiving buffer without checking any subparameter delimiters, such as comma.
402  *
403  * @param buf output buffer for the read
404  * @param len maximum number of bytes to read
405  * @return number of successfully read bytes or -1 in case of error
406  */
407  ssize_t read_bytes(uint8_t *buf, size_t len);
408 
409  /** Reads chars from reading buffer. Terminates with null. Skips the quotation marks.
410  * Stops on delimiter or stop tag.
411  *
412  * @param str output buffer for the read
413  * @param size maximum number of chars to output including NULL
414  * @param read_even_stop_tag if true then try to read even if the stop tag was found previously
415  * @return length of output string or -1 in case of read timeout before delimiter or stop tag is found
416  */
417  ssize_t read_string(char *str, size_t size, bool read_even_stop_tag = false);
418 
419  /** Reads chars representing hex ascii values and converts them to the corresponding chars.
420  * For example: "4156" to "AV".
421  * Terminates with null. Skips the quotation marks.
422  * Stops on delimiter or stop tag.
423  *
424  * @param str output buffer for the read
425  * @param size maximum number of chars to output
426  * @return length of output string or -1 in case of read timeout before delimiter or stop tag is found
427  */
428  ssize_t read_hex_string(char *str, size_t size);
429 
430  /** Converts contained chars to their hex ascii value and writes the resulting string to the file handle
431  * For example: "AV" to "4156".
432  *
433  * @param str input buffer to be converted to hex ascii
434  * @param size of the input param str
435  */
436  void write_hex_string(char *str, size_t size);
437 
438  /** Reads as string and converts result to integer. Supports only non-negative integers.
439  *
440  * @return the non-negative integer or -1 in case of error.
441  */
442  int32_t read_int();
443 
444  /** This looks for necessary matches: prefix, OK, ERROR, URCs and sets the correct scope.
445  *
446  * @param prefix string to be matched from receiving buffer. If not NULL and match succeeds, then scope
447  * will be set as information response(info_type)
448  * @param stop flag to indicate if we go to information response scope or not.
449  * (needed when nothing is expected to be received anymore after the prefix match:
450  * sms case: "> ", bc95 reboot case)
451  */
452  void resp_start(const char *prefix = NULL, bool stop = false);
453 
454  /** Ends all scopes starting from current scope.
455  * Consumes everything until the scope's stop tag is found, then
456  * goes to next scope until response scope is ending.
457  * URC match is checked during response scope ending,
458  * for every new line / CRLF.
459  *
460  *
461  * Possible sequence:
462  * element scope -> information response scope -> response scope
463  */
464  void resp_stop();
465 
466  /** Looks for matching the prefix given to resp_start() call.
467  * If needed, it ends the scope of a previous information response.
468  * Sets the information response scope if new prefix is found and response scope if prefix is not found.
469  *
470  * @return true if prefix defined for information response is not empty string and is found,
471  * false otherwise.
472  */
473  bool info_resp();
474 
475  /** Looks for matching the start tag.
476  * If needed, it ends the scope of a previous element.
477  * Sets the element scope if start tag is found and information response scope if start tag is not found.
478  *
479  * @param start_tag tag to be matched to begin parsing an element of an information response
480  * @return true if new element is found, false otherwise
481  */
482  bool info_elem(char start_tag);
483 
484  /** Consumes the received content until current stop tag is found.
485  *
486  * @return true if stop tag is found, false otherwise
487  */
488  bool consume_to_stop_tag();
489 
490  /** Return the last 3GPP error code.
491  * @return last 3GPP error code
492  */
493  int get_3gpp_error();
494 
495 public: // just for debugging
496  /**
497  * AT debugging, when enabled will print all data read and written,
498  * non-printable chars are printed as "[%d]".
499  *
500  * AT debug can be enabled at compile time using MBED_CONF_CELLULAR_DEBUG_AT flag or at runtime
501  * calling set_debug(). Note that MBED_CONF_MBED_TRACE_ENABLE must also be enabled.
502  *
503  * @param debug_on Enable/disable debugging
504  */
505  void set_debug(bool debug_on);
506 
507  /**
508  * Get degug state set by @ref set_debug
509  *
510  * @return current state of debug
511  */
512  bool get_debug() const;
513 
514  /** Set debug_on for all ATHandlers in the _atHandlers list
515  *
516  * @param debug_on Set true to enable debug traces
517  */
518  static void set_debug_list(bool debug_on);
519 
520 private:
521 
522  // should fit any prefix and int
523  char _recv_buff[BUFF_SIZE];
524  // reading position
525  size_t _recv_len;
526  // reading length
527  size_t _recv_pos;
528 
529  // resp_type: the part of the response that doesn't include the information response (+CMD1,+CMD2..)
530  // ends with OK or (CME)(CMS)ERROR
531  // info_type: the information response part of the response: starts with +CMD1 and ends with CRLF
532  // information response contains parameters or subsets of parameters (elements), both separated by comma
533  // elem_type: subsets of parameters that are part of information response, its parameters are separated by comma
534  enum ScopeType {RespType, InfoType, ElemType, NotSet};
535  void set_scope(ScopeType scope_type);
536  ScopeType _current_scope;
537 
538  struct tag_t {
539  char tag[7];
540  size_t len;
541  bool found;
542  };
543 
544  // tag to stop response scope
545  tag_t _resp_stop;
546  // tag to stop information response scope
547  tag_t _info_stop;
548  // tag to stop element scope
549  tag_t _elem_stop;
550  // reference to the stop tag of current scope (resp/info/elem)
551  tag_t *_stop_tag;
552 
553  // delimiter between parameters and also used for delimiting elements of information response
554  char _delimiter;
555  // set true on prefix match -> indicates start of an information response or of an element
556  bool _prefix_matched;
557  // set true on urc match
558  bool _urc_matched;
559  // set true on (CME)(CMS)ERROR
560  bool _error_found;
561  // Max length of OK,(CME)(CMS)ERROR and URCs
562  size_t _max_resp_length;
563 
564  // prefix set during resp_start and used to try matching possible information responses
565  char _info_resp_prefix[BUFF_SIZE];
566  bool _debug_on;
567  bool _cmd_start;
568  bool _use_delimiter;
569 
570  // time when a command or an URC processing was started
571  uint64_t _start_time;
572  // eventqueue event id
573  int _event_id;
574 
575  char _cmd_buffer[BUFF_SIZE];
576 
577 private:
578  //Handles the arguments from given variadic list
579  void handle_args(const char *format, std::va_list list);
580 
581  //Starts an AT command based on given parameters
582  void handle_start(const char *cmd, const char *cmd_chr);
583 
584  //Checks that ATHandler does not have a pending error condition and filehandle is usable
585  bool ok_to_proceed();
586 
587 private:
588  // Gets char from receiving buffer.
589  // Resets and fills the buffer if all are already read (receiving position equals receiving length).
590  // Returns a next char or -1 on failure (also sets error flag)
591  int get_char();
592  // Sets to 0 the reading position, reading length and the whole buffer content.
593  void reset_buffer();
594  // Reading position set to 0 and buffer's unread content moved to beginning
595  void rewind_buffer();
596  // Calculate remaining time for polling based on request start time and AT timeout.
597  // Returns 0 or time in ms for polling.
598  int poll_timeout(bool wait_for_timeout = true);
599  // Reads from serial to receiving buffer.
600  // Returns true on successful read OR false on timeout.
601  bool fill_buffer(bool wait_for_timeout = true);
602 
603  void set_tag(tag_t *tag_dest, const char *tag_seq);
604 
605  // Rewinds the receiving buffer and compares it against given str.
606  bool match(const char *str, size_t size);
607  // Iterates URCs and checks if they match the receiving buffer content.
608  // If URC match sets the scope to information response and after urc's cb returns
609  // finishes the information response scope(consumes to CRLF).
610  bool match_urc();
611  // Checks if any of the error strings are matching the receiving buffer content.
612  bool match_error();
613  // Checks if current char in buffer matches ch and consumes it,
614  // if no match lets the buffer unchanged.
615  bool consume_char(char ch);
616  // Consumes the received content until tag is found.
617  // Consumes the tag only if consume_tag flag is true.
618  bool consume_to_tag(const char *tag, bool consume_tag);
619  // Checks if receiving buffer contains OK, ERROR, URC or given prefix.
620  void resp(const char *prefix, bool check_urc);
621 
622 
623  ScopeType get_scope();
624 
625  // Consumes to information response stop tag which is CRLF. Sets scope to response.
626  void information_response_stop();
627  // Consumes to element stop tag. Sets scope to information response
628  void information_response_element_stop();
629 
630  // Reads the error code if expected and sets it as last error.
631  void at_error(bool error_code, DeviceErrorType error_type);
632 
633  /** Convert AT error code to 3GPP error codes
634  * @param err AT error code read from CME/CMS ERROR responses
635  * @param error_type error type (CMS/CME/ERROR)
636  */
637  void set_3gpp_error(int err, DeviceErrorType error_type);
638 
639  bool check_cmd_send();
640  size_t write(const void *data, size_t len);
641 
642  /** Finds occurrence of one char buffer inside another char buffer.
643  *
644  * @param dest destination char buffer
645  * @param dest_len length of dest
646  * @param src string to be searched for
647  * @param src_len length of string to be searched for
648  *
649  * @return pointer to first occurrence of src in dest
650  */
651  const char *mem_str(const char *dest, size_t dest_len, const char *src, size_t src_len);
652 
653  // check is urc is already added
654  bool find_urc_handler(const char *prefix);
655 
656  // print contents of a buffer to trace log
657  enum ATType {
658  AT_ERR,
659  AT_RX,
660  AT_TX
661  };
662  void debug_print(const char *p, int len, ATType type);
663 };
664 
665 } // namespace mbed
666 
667 #endif //AT_HANDLER_H_
EventQueue.
Definition: EventQueue.h:60
signed int nsapi_error_t
Type used to represent error codes.
Definition: nsapi_types.h:95
Class FileHandle.
Definition: FileHandle.h:46
The Mutex class is used to synchronize the execution of threads.
Definition: Mutex.h:68
Callback< R(ArgTs...)> callback(R(*func)(ArgTs...)=0)
Create a callback class with type inferred from the arguments.
Definition: Callback.h:709
AT response error with error code and type.
Definition: ATHandler.h:62
The ConditionVariable class is a synchronization primitive that allows threads to wait until a partic...
Callback class based on template specialization.
Definition: Callback.h:39
Class for sending AT commands and parsing AT responses.
Definition: ATHandler.h:68
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.