Commit | Line | Data |
---|---|---|
4eb9c745 AW |
1 | #ifndef utils_h |
2 | #define utils_h | |
3 | ||
423df6df AW |
4 | #include <stdint.h> |
5 | using namespace std; | |
4eb9c745 | 6 | #include <string> |
5efaa1b1 | 7 | #include <vector> |
4eb9c745 | 8 | using std::string; |
4eb9c745 | 9 | |
4df07f88 MM |
10 | extern volatile bool _isr_context; |
11 | ||
4eb9c745 AW |
12 | string lc(string str); |
13 | ||
a2970685 MM |
14 | bool is_alpha( int ); |
15 | bool is_digit( int ); | |
16 | bool is_numeric( int ); | |
17 | bool is_alphanum( int ); | |
18 | bool is_whitespace( int ); | |
19 | ||
a699b669 AW |
20 | string remove_non_number( string str ); |
21 | ||
d5d3d675 JM |
22 | uint16_t get_checksum(const string& to_check); |
23 | uint16_t get_checksum(const char* to_check); | |
4eb9c745 | 24 | |
35e773a4 | 25 | void get_checksums(uint16_t check_sums[], const string key); |
5efaa1b1 | 26 | |
4eb9c745 AW |
27 | string shift_parameter( string ¶meters ); |
28 | ||
cebe90b6 AW |
29 | string get_arguments( string possible_command ); |
30 | ||
35e773a4 | 31 | bool file_exists( const string file_name ); |
8d857d2e | 32 | |
2742fca9 | 33 | void system_reset( bool dfu= false ); |
4eb9c745 | 34 | |
75f4581c | 35 | string absolute_from_relative( string path ); |
4eb9c745 AW |
36 | |
37 | ||
38 | #endif |