Copy edit CellularUtil.h

Copy edit file for consistent capitalization and correct which/that.
pull/6082/head
Amanda Butler 2018-02-28 21:41:43 -06:00 committed by Ari Parkkila
parent 00b1341297
commit 6dd0723dff
1 changed files with 15 additions and 15 deletions

View File

@ -31,32 +31,32 @@ namespace mbed_cellular_util {
static const char hex_values[] = "0123456789ABCDEF"; static const char hex_values[] = "0123456789ABCDEF";
/** Converts the given ip address to proper IPv6 address if needed. /** Converts the given IP address to proper IPv6 address if needed.
* Conversion is done only if it's NOT IPv4 and separated with colons. * Conversion is done only if it's NOT IPv4 and separated with colons.
* AT command +CGPADDR can give IP address in format of a1.a2.a3.a4.a5.a6.a7.a8.a9.a10.a11.a12.a13.a14.a15.a16 for IPv6 * AT command +CGPADDR can give IP address in format of a1.a2.a3.a4.a5.a6.a7.a8.a9.a10.a11.a12.a13.a14.a15.a16 for IPv6
* where ax are in decimal format. In this case function converts decimals to hex with separated with colons. * where ax are in decimal format. In this case, function converts decimals to hex with separated with colons.
* *
* @param ip ip address which can be IPv4 or IPv6 in different formats from AT command +CGPADDR. Converted result uses same buffer. * @param ip IP address that can be IPv4 or IPv6 in different formats from AT command +CGPADDR. Converted result uses same buffer.
*/ */
void convert_ipv6(char* ip); void convert_ipv6(char* ip);
/** Separates ip addresses from the given 'orig' string. 'orig' may contain zero, one or two ip addresses in various formats. /** Separates IP addresses from the given 'orig' string. 'orig' may contain zero, one or two IP addresses in various formats.
* See AT command +CGPIAF from 3GPP TS 27.007 for details. Does also needed conversions for ipv6 addresses. * See AT command +CGPIAF from 3GPP TS 27.007 for details. Does also needed conversions for IPv6 addresses.
* *
* @param orig original string which contains zero, one or two ip addressees in various formats * @param orig original string that contains zero, one or two IP addressees in various formats
* @param ip preallocated buffer which might contain ip address after return * @param ip preallocated buffer that might contain IP address after return
* @param ip_size size of preallocated buffer ip * @param ip_size size of preallocated buffer IP
* @param ip2 preallocated buffer which might contain ip address after return * @param ip2 preallocated buffer that might contain IP address after return
* @param ip2_size size of preallocated buffer ip2 * @param ip2_size size of preallocated buffer ip2
* *
*/ */
void separate_ip_addresses(char* orig, char* ip, size_t ip_size, char* ip2, size_t ip2_size); void separate_ip_addresses(char* orig, char* ip, size_t ip_size, char* ip2, size_t ip2_size);
/** Swaps the arrays if param ip does not contain ipv6 address but param ip2 does. /** Swaps the arrays if param IP does not contain IPv6 address but param ip2 does.
* *
* @param ip ip address * @param ip IP address
* @param ip_size size of buffer ip * @param ip_size size of buffer ip
* @param ip2 ip address * @param ip2 IP address
* @param ip2_size size of buffer ip2 * @param ip2_size size of buffer ip2
*/ */
void prefer_ipv6(char* ip, size_t ip_size, char* ip2, size_t ip2_size); void prefer_ipv6(char* ip, size_t ip_size, char* ip2, size_t ip2_size);
@ -64,13 +64,13 @@ void prefer_ipv6(char* ip, size_t ip_size, char* ip2, size_t ip2_size);
/** Converts the given int to two hex characters /** Converts the given int to two hex characters
* *
* @param num number to be converted to hex string * @param num number to be converted to hex string
* @param buf preallocated buffer which will contain 2 char length hex value * @param buf preallocated buffer that will contain 2 char length hex value
*/ */
void int_to_hex_str(uint8_t num, char* buf); void int_to_hex_str(uint8_t num, char* buf);
/** Converts the given buffer 'str' to hex buffer 'buf. First 'len' char's are converted to two hex bytes. /** Converts the given buffer 'str' to hex buffer 'buf. First 'len' char's are converted to two hex bytes.
* *
* @param str char buffer which is to be converted to hex * @param str char buffer that is to be converted to hex
* @param len how many chars from str are to be converted * @param len how many chars from str are to be converted
* @param buf destination buffer for hex converted chars. Buffer should be double the size of str to fit hex-encoded string. * @param buf destination buffer for hex converted chars. Buffer should be double the size of str to fit hex-encoded string.
* @param omit_leading_zero if true then possible leading zeroes are omitted * @param omit_leading_zero if true then possible leading zeroes are omitted
@ -87,7 +87,7 @@ int hex_str_to_int(const char *hex_string, int hex_string_length);
/** Converts the given hex string str to char string to buf /** Converts the given hex string str to char string to buf
* *
* @param str hex string which is converted to char string to buf * @param str hex string that is converted to char string to buf
* @param len length of the param str/how many hex are converted * @param len length of the param str/how many hex are converted
* @param buf preallocated buffer where result conversion is stored * @param buf preallocated buffer where result conversion is stored
* @return length of the buf * @return length of the buf