mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-22 01:37:52 +00:00
add a .clang-format file (#9154)
This commit is contained in:
@@ -10,8 +10,9 @@ typedef uint32_t NodeNum;
|
||||
typedef uint32_t PacketId; // A packet sequence number
|
||||
|
||||
#define NODENUM_BROADCAST UINT32_MAX
|
||||
#define NODENUM_BROADCAST_NO_LORA \
|
||||
1 // Reserved to only deliver packets over high speed (non-lora) transports, such as MQTT or BLE mesh (not yet implemented)
|
||||
#define NODENUM_BROADCAST_NO_LORA \
|
||||
1 // Reserved to only deliver packets over high speed (non-lora) transports, such as MQTT or BLE mesh (not yet
|
||||
// implemented)
|
||||
#define ERRNO_OK 0
|
||||
#define ERRNO_NO_INTERFACES 33
|
||||
#define ERRNO_UNKNOWN 32 // pick something that doesn't conflict with RH_ROUTER_ERROR_UNABLE_TO_DELIVER
|
||||
@@ -23,17 +24,17 @@ typedef uint32_t PacketId; // A packet sequence number
|
||||
* Source of a received message
|
||||
*/
|
||||
enum RxSource {
|
||||
RX_SRC_LOCAL, // message was generated locally
|
||||
RX_SRC_RADIO, // message was received from radio mesh
|
||||
RX_SRC_USER // message was received from end-user device
|
||||
RX_SRC_LOCAL, // message was generated locally
|
||||
RX_SRC_RADIO, // message was received from radio mesh
|
||||
RX_SRC_USER // message was received from end-user device
|
||||
};
|
||||
|
||||
/**
|
||||
* the max number of hops a message can pass through, used as the default max for hop_limit in MeshPacket.
|
||||
*
|
||||
* We reserve 3 bits in the header so this could be up to 7, but given the high range of lora and typical usecases, keeping
|
||||
* maxhops to 3 should be fine for a while. This also serves to prevent routing/flooding attempts to be attempted for
|
||||
* too long.
|
||||
* We reserve 3 bits in the header so this could be up to 7, but given the high range of lora and typical usecases,
|
||||
*keeping maxhops to 3 should be fine for a while. This also serves to prevent routing/flooding attempts to be
|
||||
*attempted for too long.
|
||||
**/
|
||||
#define HOP_MAX 7
|
||||
|
||||
@@ -52,8 +53,8 @@ extern Allocator<meshtastic_MeshPacket> &packetPool;
|
||||
using UniquePacketPoolPacket = Allocator<meshtastic_MeshPacket>::UniqueAllocation;
|
||||
|
||||
/**
|
||||
* Most (but not always) of the time we want to treat packets 'from' the local phone (where from == 0), as if they originated on
|
||||
* the local node. If from is zero this function returns our node number instead
|
||||
* Most (but not always) of the time we want to treat packets 'from' the local phone (where from == 0), as if they
|
||||
* originated on the local node. If from is zero this function returns our node number instead
|
||||
*/
|
||||
NodeNum getFrom(const meshtastic_MeshPacket *p);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user