mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
REPO: 1. Flash a repeater 2. Connect over lora 3. Set bw to 42.7 KHZ It will revert back due to converting a double to a float. REPO2: 1.Flash Repeater 2. Apply float fix 3. Set to say 20.8 4. try to get value via app or web cli repeater config It wil show blank because it doesnt return a good value. It would be something like 20.7999992 which the app and web apps dont like so the ftoa3 rounds it and returns a 3 decimal point float
18 lines
639 B
C++
18 lines
639 B
C++
#pragma once
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#define TXT_TYPE_PLAIN 0 // a plain text message
|
|
#define TXT_TYPE_CLI_DATA 1 // a CLI command
|
|
#define TXT_TYPE_SIGNED_PLAIN 2 // plain text, signed by sender
|
|
|
|
class StrHelper {
|
|
public:
|
|
static void strncpy(char* dest, const char* src, size_t buf_sz);
|
|
static void strzcpy(char* dest, const char* src, size_t buf_sz); // pads with trailing nulls
|
|
static const char* ftoa(float f);
|
|
static const char* ftoa3(float f); //Converts float to string with 3 decimal places
|
|
static bool isBlank(const char* str);
|
|
static uint32_t fromHex(const char* src);
|
|
};
|