Files
MeshCore-Evo/src/helpers/TxtDataHelpers.h

20 lines
772 B
C
Raw Normal View History

#pragma once
#include <stddef.h>
#include <stdint.h>
2026-03-19 09:25:42 +01:00
#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
2026-03-19 09:35:02 +01:00
#define DATA_TYPE_DEV 0xFFFF // developer namespace for experimenting with group/channel datagrams and building apps
2025-02-22 19:41:24 +11:00
class StrHelper {
public:
static void strncpy(char* dest, const char* src, size_t buf_sz);
2025-02-22 20:10:31 +11:00
static void strzcpy(char* dest, const char* src, size_t buf_sz); // pads with trailing nulls
2025-02-27 18:02:47 +11:00
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);
2025-11-09 16:17:49 +11:00
static uint32_t fromHex(const char* src);
2025-02-22 19:41:24 +11:00
};