CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
arrays.h
Go to the documentation of this file.
1#ifndef INCLUDE_GUARD__TRANSFORMS_ARRAYS_H__
2#define INCLUDE_GUARD__TRANSFORMS_ARRAYS_H__
3
4#include <stdint.h>
5
6int16_t GEN_get_index_of_substring_in_array(const char *haystack_arr, int16_t haystack_arr_len, const char *needle_str);
8 const uint8_t *haystack_arr, int16_t haystack_arr_len,
9 const uint8_t *needle_arr, int16_t needle_arr_len
10);
11
12void GEN_uint64_to_str(uint64_t value, char *buffer);
13void GEN_uint64_to_padded_str(uint64_t value, uint8_t padding_len, char *buffer);
14
15void GEN_int64_to_str(int64_t value, char *buffer);
16
17uint8_t GEN_hex_str_to_byte_array(const char *hex_str, uint8_t output_byte_array[],
18 uint16_t output_byte_array_size, uint16_t *output_byte_array_len);
19
21 const uint8_t *byte_array, uint32_t byte_array_len, char *dest_str, uint32_t dest_str_size
22);
23
24#endif // INCLUDE_GUARD__TRANSFORMS_ARRAYS_H__
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.
Definition arrays.c:100
void GEN_uint64_to_str(uint64_t value, char *buffer)
Converts a uint64_t to a string.
Definition arrays.c:66
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.
Definition arrays.c:163
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).
Definition arrays.c:227
void GEN_int64_to_str(int64_t value, char *buffer)
Converts an int64_t to a string.
Definition arrays.c:136
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.
Definition arrays.c:40
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.
Definition arrays.c:12