Tue, 03 Oct 2023 17:24:06 +0200
Version 0.3.0. Backported network code from experimental roaming project. Will now connect after reset to the strongest AP. Id the signal level drops below -67, extra scans are done to see for a better AP. Nothing is done yet. Removed config.conf file, all info is taken from the project menu and live tests. Better log the board type and send it via json mqtt. Send bssid and current channel too.
18
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
1 | /** |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
2 | * @file xutil.h |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
3 | * @brief In memory string manipulation. |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
4 | */ |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
5 | |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
6 | |
0
88d965579617
Initial import of the CO2 meter application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | #ifndef XUTIL_H |
88d965579617
Initial import of the CO2 meter application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | #define XUTIL_H |
88d965579617
Initial import of the CO2 meter application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | |
18
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
10 | /** |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
11 | * @brief Safe memory allocation. Abort if not enough. |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
12 | * @param size The amount of memory to allocate. |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
13 | * @return A pointer to the allocated memory. |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
14 | */ |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
15 | char *xmalloc(size_t size); |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
16 | |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
17 | /** |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
18 | * @brief Copy string in memory. |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
19 | * @param src The source string to copy. |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
20 | * @return A pointer to the string with the copied string. |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
21 | */ |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
22 | char *xstrcpy(char *src); |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
23 | |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
24 | /** |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
25 | * @brief Add data to a string in memory. |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
26 | * @param src The original string. |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
27 | * @param add The string to append to src. |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
28 | * @return A pointer to the combined string. |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
29 | */ |
d969e0fe05dc
Added splash screen and unit zero set menu.
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
30 | char *xstrcat(char *src, char *add); |
0
88d965579617
Initial import of the CO2 meter application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
31 | |
88d965579617
Initial import of the CO2 meter application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
32 | #endif |