|
IoT-MBBR (masterthesis)
Masterthesis upgrading a Moving Bed BioReactor with extra sensors and cloud connectivity.
|
String (char array) conversion functionality. More...
Go to the source code of this file.
Functions | |
| void | charASCII_to_charHex (char *inbuf, char *outbuf) |
| Convert an ASCII char array (string) to a hexadecimal char array. More... | |
| void | uint32_to_charDec (uint32_t value, char *outbuf) |
Convert a uint32_t value to a decimal char array (string). More... | |
| void | uint32_to_charHex (uint32_t value, char *outbuf) |
Convert a uint32_t value to a hexadecimal char array (string). More... | |
| bool | stringStartsWith (char *inbuf, char *sequence) |
| Check if a given char array (string) starts with a given sequence. More... | |
| uint8_t | stringLength (char *inbuf) |
| Returns the length of the given null-terminated byte string. More... | |
String (char array) conversion functionality.
Copyright (C) 2020 - Brecht Van Eeckhoudt
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
A copy of the GNU General Public License can be found in the LICENSE file along with this source code.
Some methods use code obtained from examples from Silicon Labs' GitHub. These sections are licensed under the Silabs License Agreement. See the file "Silabs_License_Agreement.txt" for details. Before using this software for any purpose, you must agree to the terms of that agreement.
Definition in file util_string.c.
| void charASCII_to_charHex | ( | char * | inbuf, |
| char * | outbuf | ||
| ) |
Convert an ASCII char array (string) to a hexadecimal char array.
"Hello world!") but a char array, the input message (array) needs to end with NULL ("\0")!| [in] | inbuf | The given ASCII string to convert to a hexadecimal string. |
| [out] | outbuf | The buffer to put the resulting string in. This needs to have twice the length of the input message + 1! (two HEX characters for one ASCII character + NULL termination) |
Definition at line 63 of file util_string.c.
| uint8_t stringLength | ( | char * | inbuf | ) |
Returns the length of the given null-terminated byte string.
| [in] | inbuf | The given char array (string). |
Definition at line 224 of file util_string.c.
| bool stringStartsWith | ( | char * | inbuf, |
| char * | sequence | ||
| ) |
Check if a given char array (string) starts with a given sequence.
"Hello world!") but a char array, the input message (array) needs to end with NULL ("\0")!| [in] | inbuf | The given char array (string) to check a sequence in. |
| [in] | sequence | The sequence to check in the given char array. |
true - The given sequence is found in the char array. false -The given sequence is not found in the char array. Definition at line 203 of file util_string.c.
| void uint32_to_charDec | ( | uint32_t | value, |
| char * | outbuf | ||
| ) |
Convert a uint32_t value to a decimal char array (string).
| [in] | value | The uint32_t value to convert to a string. |
| [out] | outbuf | The buffer to put the resulting string in. This needs to have a length of 10: char buf[10];! |
Definition at line 95 of file util_string.c.
| void uint32_to_charHex | ( | uint32_t | value, |
| char * | outbuf | ||
| ) |
Convert a uint32_t value to a hexadecimal char array (string).
| [in] | value | The uint32_t value to convert to a string. |
| [out] | outbuf | The buffer to put the resulting string in. This needs to have a length of 9: char buf[9];! |
Definition at line 150 of file util_string.c.