Skip to content

Commit 63485bd

Browse files
Amanda ButlerAri Parkkila
authored andcommitted
Copy edit ATHandler.h
Copy edit for clarity, grammar and spelling.
1 parent cc3835e commit 63485bd

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

features/cellular/framework/AT/ATHandler.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class FileHandle;
3636
/**
3737
* If application calls associated FileHandle only from single thread context
3838
* then locking between AT command and response is not needed. However,
39-
* note that many cellular functions are called indirectly e.g. via socket API.
40-
* If you are unsure then AT_HANDLER_MUTEX must be defined.
39+
* note that many cellular functions are called indirectly, for example with the socket API.
40+
* If you are unsure, then AT_HANDLER_MUTEX must be defined.
4141
*/
4242
#define AT_HANDLER_MUTEX
4343

@@ -84,7 +84,7 @@ class ATHandler
8484
*/
8585
FileHandle *get_file_handle();
8686

87-
/** Set file handle which is used for reading AT responses and writing AT commands
87+
/** Set file handle, which is used for reading AT responses and writing AT commands
8888
*
8989
* @param fh file handle used for reading AT responses and writing AT commands
9090
*/
@@ -100,14 +100,14 @@ class ATHandler
100100

101101
/** Locks the mutex for file handle if AT_HANDLER_MUTEX is defined and returns the last error.
102102
*
103-
* @return last error which happened when parsing AT responses
103+
* @return last error that happened when parsing AT responses
104104
*/
105105
nsapi_error_t unlock_return_error();
106106

107-
/** Set the urc callback for urc. If urc is found when parsing AT responses then call if called.
107+
/** Set the urc callback for urc. If urc is found when parsing AT responses, then call if called.
108108
*
109109
* @param prefix Register urc prefix for callback. Urc could be for example "+CMTI: "
110-
* @param callback Callback which is called if urc is found in AT response
110+
* @param callback Callback, which is called if urc is found in AT response
111111
*/
112112
void set_urc_handler(const char *prefix, mbed::Callback<void()> callback);
113113

@@ -150,7 +150,7 @@ class ATHandler
150150
*/
151151
void restore_at_timeout();
152152

153-
/** Clear pending error flag. By default error is cleared only in lock().
153+
/** Clear pending error flag. By default, error is cleared only in lock().
154154
*/
155155
void clear_error();
156156

@@ -205,34 +205,34 @@ class ATHandler
205205
public:
206206

207207
/** Starts the command writing by clearing the last error and writing the given command.
208-
* In case of failure when writing the last error is set to NSAPI_ERROR_DEVICE_ERROR.
208+
* In case of failure when writing, the last error is set to NSAPI_ERROR_DEVICE_ERROR.
209209
*
210210
* @param cmd AT command to be written to modem
211211
*/
212212
void cmd_start(const char* cmd);
213213

214214
/** Writes integer type AT command subparameter. Starts with the delimiter if not the first param after cmd_start.
215-
* In case of failure when writing the last error is set to NSAPI_ERROR_DEVICE_ERROR.
215+
* In case of failure when writing, the last error is set to NSAPI_ERROR_DEVICE_ERROR.
216216
*
217217
* @param param int to be written to modem as AT command subparameter
218218
*/
219219
void write_int(int32_t param);
220220

221221
/** Writes string type AT command subparamater. Quotes are added to surround the given string.
222222
* Starts with the delimiter if not the first param after cmd_start.
223-
* In case of failure when writing the last error is set to NSAPI_ERROR_DEVICE_ERROR.
223+
* In case of failure when writing, the last error is set to NSAPI_ERROR_DEVICE_ERROR.
224224
*
225225
* @param param string to be written to modem as AT command subparameter
226-
* @param useQuotations flag indicating if the string should be or not included in quotation marks
226+
* @param useQuotations flag indicating whether the string should be included in quotation marks
227227
*/
228228
void write_string(const char* param, bool useQuotations = true);
229229

230-
/** Stops the AT command by writing command line terminator CR to mark command as finished.
230+
/** Stops the AT command by writing command-line terminator CR to mark command as finished.
231231
*/
232232
void cmd_stop();
233233

234234
/** Write bytes without any subparameter delimiters, such as comma.
235-
* In case of failure when writing the last error is set to NSAPI_ERROR_DEVICE_ERROR.
235+
* In case of failure when writing, the last error is set to NSAPI_ERROR_DEVICE_ERROR.
236236
*
237237
* @param data bytes to be written to modem
238238
* @param len length of data string
@@ -241,7 +241,7 @@ class ATHandler
241241
*/
242242
size_t write_bytes(const uint8_t *data, size_t len);
243243

244-
/** Sets the stop tag for the current scope(response/information response/element)
244+
/** Sets the stop tag for the current scope (response/information response/element)
245245
* Parameter's reading routines will stop the reading when such tag is found and will set the found flag.
246246
* Consume routines will read everything until such tag is found.
247247
*
@@ -286,7 +286,7 @@ class ATHandler
286286
*
287287
* @param str output buffer for the read
288288
* @param size maximum number of chars to output
289-
* @param read_even_stop_tag if true then try to read even the stop tag was found previously
289+
* @param read_even_stop_tag if true then try to read even if the stop tag was found previously
290290
* @return length of output string or -1 in case of read timeout before delimiter or stop tag is found
291291
*/
292292
ssize_t read_string(char *str, size_t size, bool read_even_stop_tag = false);
@@ -309,22 +309,22 @@ class ATHandler
309309

310310
/** Ends all scopes starting from current scope.
311311
* Consumes everything until the scope's stop tag is found, then
312-
* goes to next scope, until response scope is ending.
312+
* goes to next scope until response scope is ending.
313313
* Possible sequence:
314314
* element scope -> information response scope -> response scope
315315
*/
316316
void resp_stop();
317317

318318
/** Looks for matching the prefix given to resp_start() call.
319-
* If needed it ends the scope of a previous information response.
319+
* If needed, it ends the scope of a previous information response.
320320
* Sets the information response scope if new prefix is found and response scope if prefix is not found.
321321
*
322322
* @return true if new information response is found, false otherwise
323323
*/
324324
bool info_resp();
325325

326326
/** Looks for matching the start tag.
327-
* If needed it ends the scope of a previous element.
327+
* If needed, it ends the scope of a previous element.
328328
* Sets the element scope if start tag is found and information response scope if start tag is not found.
329329
*
330330
* @param start_tag tag to be matched to begin parsing an element of an information response
@@ -358,10 +358,10 @@ class ATHandler
358358
// reading length
359359
size_t _recv_pos;
360360

361-
// resp_type: the part of the response that doesn't include the information response(+CMD1,+CMD2..)
361+
// resp_type: the part of the response that doesn't include the information response (+CMD1,+CMD2..)
362362
// ends with OK or (CME)(CMS)ERROR
363363
// info_type: the information response part of the response: starts with +CMD1 and ends with CRLF
364-
// information response contains parameters or subsets of parameters(elements), both separated by comma
364+
// information response contains parameters or subsets of parameters (elements), both separated by comma
365365
// elem_type: subsets of parameters that are part of information response, its parameters are separated by comma
366366
enum ScopeType {RespType, InfoType, ElemType, NotSet};
367367
void set_scope(ScopeType scope_type);
@@ -379,7 +379,7 @@ class ATHandler
379379
tag_t _info_stop;
380380
// tag to stop element scope
381381
tag_t _elem_stop;
382-
// reference to the stop tag of current scope(resp/info/elem)
382+
// reference to the stop tag of current scope (resp/info/elem)
383383
tag_t *_stop_tag;
384384

385385
// delimiter between parameters and also used for delimiting elements of information response
@@ -413,13 +413,13 @@ class ATHandler
413413

414414
// Rewinds the receiving buffer and compares it against given str.
415415
bool match(const char* str, size_t size);
416-
// Iterates URCs and check if they match the receiving buffer content.
416+
// Iterates URCs and checks if they match the receiving buffer content.
417417
// If URC match sets the scope to information response and after urc's cb returns
418418
// finishes the information response scope(consumes to CRLF).
419419
bool match_urc();
420420
// Checks if any of the error strings are matching the receiving buffer content.
421421
bool match_error();
422-
// Checks is current char in buffer matches ch and consumes it,
422+
// Checks if current char in buffer matches ch and consumes it,
423423
// if no match lets the buffer unchanged.
424424
bool consume_char(char ch);
425425
// Consumes the received content until tag is found.
@@ -457,7 +457,7 @@ class ATHandler
457457
*/
458458
void set_string(char *dest, const char *src, size_t src_len);
459459

460-
/** Finds occurence of one char buffer inside another char buffer.
460+
/** Finds occurrence of one char buffer inside another char buffer.
461461
*
462462
* @param dest destination char buffer
463463
* @param dest_len length of dest

0 commit comments

Comments
 (0)