|
CTS-SAT-1-OBC-Firmware
|

Functions | |
| int16_t | GEN_get_index_of_substring_in_array (const char *haystack_arr, int16_t haystack_arr_len, const char *needle_str) |
| Returns the index of the first character of the first occurrence of a substring in an array. | |
| int16_t | GEN_get_index_of_subarray_in_array (const uint8_t *haystack_arr, int16_t haystack_arr_len, const uint8_t *needle_arr, int16_t needle_arr_len) |
| Returns the index of the first element of the first occurrence of a sub-array in an array. | |
| void | GEN_uint64_to_str (uint64_t value, char *buffer) |
| Converts a uint64_t to a string. | |
| void | GEN_uint64_to_padded_str (uint64_t value, uint8_t padding_len, char *buffer) |
| Converts a uint64_t to a string, with leading zeros. | |
| void | GEN_int64_to_str (int64_t value, char *buffer) |
| Converts an int64_t to a string. | |
| uint8_t | GEN_hex_str_to_byte_array (const char *hex_str, uint8_t output_byte_array[], uint16_t output_byte_array_size, uint16_t *output_byte_array_len) |
| Converts a hex string to a byte array. | |
| void | GEN_byte_array_to_hex_str (const uint8_t *byte_array, uint32_t byte_array_len, char *dest_str, uint32_t dest_str_size) |
| Writes a byte array to a hex string (no spaces between bytes). | |
| void GEN_byte_array_to_hex_str | ( | const uint8_t * | byte_array, |
| uint32_t | byte_array_len, | ||
| char * | dest_str, | ||
| uint32_t | dest_str_size ) |
Writes a byte array to a hex string (no spaces between bytes).
| byte_array | Input byte array. |
| byte_array_len | Length of input byte_array. |
| dest_str | The destination to write a C-string to. |
| dest_str_size | The size of the dest_str array, allocated before calling. Must be at least byte_array_len * 3 + 1 to fit the entire string. |

| int16_t GEN_get_index_of_subarray_in_array | ( | const uint8_t * | haystack_arr, |
| int16_t | haystack_arr_len, | ||
| const uint8_t * | needle_arr, | ||
| int16_t | needle_arr_len ) |
Returns the index of the first element of the first occurrence of a sub-array in an array.
| haystack_arr | The array to search within. |
| haystack_arr_len | The length of the array to search within. |
| needle_arr | The substring/sub-array to search for. |
| needle_arr_len | The length of the substring/sub-array to search for. |
| int16_t GEN_get_index_of_substring_in_array | ( | const char * | haystack_arr, |
| int16_t | haystack_arr_len, | ||
| const char * | needle_str ) |
Returns the index of the first character of the first occurrence of a substring in an array.
| haystack_arr | The array to search within. |
| haystack_arr_len | The length of the array to search within. |
| needle_str | The substring to search for. Must be a null-terminated C-string. |

| uint8_t GEN_hex_str_to_byte_array | ( | const char * | hex_str, |
| uint8_t | output_byte_array[], | ||
| uint16_t | output_byte_array_size, | ||
| uint16_t * | output_byte_array_len ) |
Converts a hex string to a byte array.
| hex_str | The input hex string. Can be upper or lower case. Can contain spaces and underscores between bytes. |
| output_byte_array | Pointer to the output destination byte array. |
| output_byte_array_size | Maximum size of the output byte array. |
| output_byte_array_len | Pointer to the output variable that will be set to the length of the output byte array. |
| void GEN_int64_to_str | ( | int64_t | value, |
| char * | buffer ) |
Converts an int64_t to a string.
| value | The input value to convert. |
| buffer | The output buffer to write the string to. MUST BE AT LEAST 21 BYTES LONG. |


| void GEN_uint64_to_padded_str | ( | uint64_t | value, |
| uint8_t | padding_len, | ||
| char * | buffer ) |
Converts a uint64_t to a string, with leading zeros.
| value | The input value to convert. |
| padding_len | The expected length of the output string. |
| buffer | The output buffer to write the string to. Must be padding_len bytes long. |

| void GEN_uint64_to_str | ( | uint64_t | value, |
| char * | buffer ) |
Converts a uint64_t to a string.
| value | The input value to convert. |
| buffer | The output buffer to write the string to. MUST BE AT LEAST 21 BYTES LONG. |
