|
GPS Device
|
Functions | |
| uint32_t | get_str_len (char const *str) |
| Returns the length of a string, excluding the null terminator. | |
| void | int_to_str (int num, char *str) |
| Converts an integer to its decimal string representation. | |
| int | str_to_int (const char *str) |
| Converts a decimal string to an integer. | |
| void | double_to_str (double num, char *str, int8_t frac_digits) |
| Converts a double to a decimal string with a fixed number of fractional digits. | |
| void | hex_byte_to_str (uint8_t byte, char *str) |
| Converts a single byte to a two-character uppercase hexadecimal string. | |
| void | str_set (char *target_str, char const *host_str, uint32_t host_str_len, uint32_t pos) |
| Overwrites a region of a target string with the contents of a source string. | |
| int32_t | get_pow (int32_t base, int32_t exponent) |
| Computes an integer power. | |
| void | arr_cmprs (char *arr, uint8_t len) |
| Compresses an array by removing null bytes and shifting remaining elements left. | |
| bool | str_cmp (const char *str1, const char *str2) |
| Compares two null-terminated strings for equality. | |
| uint8_t | ascii_hex_to_byte (char high, char low) |
| Converts two ASCII hex characters into a single byte value. | |
| int | str_tokenize (char *str, const char *separator, uint16_t max_tokens, char **tokens, uint16_t *num_tokens) |
| Splits a string into tokens separated by a given delimiter. | |
| bool | str_to_bool (char const *str) |
| Converts a string representation of a boolean to a bool value. | |
| int | str_cpy (char *str_to, const char *str_from, uint32_t len) |
| Copies a null-terminated string into a destination buffer. | |
| int | txt_cpy (char *txt_to, const char *txt_from, uint32_t len) |
| Copies a fixed-length block of text into a destination buffer. | |
| bool | is_pow (uint32_t num) |
| Checks whether a number is a power of two. | |
| uint32_t | extract_bits (const uint8_t *data, uint16_t start_bit, uint8_t num_bits) |
| Extracts a range of bits from a big-endian byte array. | |
| uint32_t get_str_len | ( | char const * | str | ) |
Returns the length of a string, excluding the null terminator.
Definition at line 22 of file common.c.

| void int_to_str | ( | int | num, |
| char * | str ) |
Converts an integer to its decimal string representation.
Definition at line 33 of file common.c.

| int str_to_int | ( | const char * | str | ) |
Converts a decimal string to an integer.
Definition at line 69 of file common.c.

| void double_to_str | ( | double | num, |
| char * | str, | ||
| int8_t | frac_digits ) |
Converts a double to a decimal string with a fixed number of fractional digits.
Definition at line 102 of file common.c.


| void hex_byte_to_str | ( | uint8_t | byte, |
| char * | str ) |
Converts a single byte to a two-character uppercase hexadecimal string.
Definition at line 175 of file common.c.
| void str_set | ( | char * | target_str, |
| char const * | host_str, | ||
| uint32_t | host_str_len, | ||
| uint32_t | pos ) |
Overwrites a region of a target string with the contents of a source string.
Definition at line 195 of file common.c.

| int32_t get_pow | ( | int32_t | base, |
| int32_t | exponent ) |
| void arr_cmprs | ( | char * | arr, |
| uint8_t | len ) |
Compresses an array by removing null bytes and shifting remaining elements left.
Definition at line 231 of file common.c.

| bool str_cmp | ( | const char * | str1, |
| const char * | str2 ) |
Compares two null-terminated strings for equality.
Definition at line 248 of file common.c.

| uint8_t ascii_hex_to_byte | ( | char | high, |
| char | low ) |
Converts two ASCII hex characters into a single byte value.
Definition at line 265 of file common.c.

| int str_tokenize | ( | char * | str, |
| const char * | separator, | ||
| uint16_t | max_tokens, | ||
| char ** | tokens, | ||
| uint16_t * | num_tokens ) |
Splits a string into tokens separated by a given delimiter.
Definition at line 287 of file common.c.

| bool str_to_bool | ( | char const * | str | ) |
Converts a string representation of a boolean to a bool value.
Definition at line 320 of file common.c.

| int str_cpy | ( | char * | str_to, |
| const char * | str_from, | ||
| uint32_t | len ) |
Copies a null-terminated string into a destination buffer.
Definition at line 333 of file common.c.

| int txt_cpy | ( | char * | txt_to, |
| const char * | txt_from, | ||
| uint32_t | len ) |
Copies a fixed-length block of text into a destination buffer.
Definition at line 350 of file common.c.

| bool is_pow | ( | uint32_t | num | ) |
| uint32_t extract_bits | ( | const uint8_t * | data, |
| uint16_t | start_bit, | ||
| uint8_t | num_bits ) |
Extracts a range of bits from a big-endian byte array.
Definition at line 369 of file common.c.
