mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* setting up framework for Regions, TransportKeys, etc
This commit is contained in:
parent
5b4544b9fe
commit
03fc949014
6 changed files with 166 additions and 2 deletions
23
src/helpers/TransportKeyStore.h
Normal file
23
src/helpers/TransportKeyStore.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#pragma once
|
||||
|
||||
#include <Arduino.h> // needed for PlatformIO
|
||||
#include <Packet.h>
|
||||
#include <helpers/IdentityStore.h>
|
||||
|
||||
struct TransportKey {
|
||||
uint8_t key[16];
|
||||
|
||||
uint16_t calcTransportCode(const mesh::Packet* packet) const;
|
||||
};
|
||||
|
||||
#define MAX_TKS_ENTRIES 16
|
||||
|
||||
class TransportKeyStore {
|
||||
uint16_t cache_ids[MAX_TKS_ENTRIES];
|
||||
TransportKey cache_keys[MAX_TKS_ENTRIES];
|
||||
int num_cache;
|
||||
|
||||
public:
|
||||
TransportKeyStore() { num_cache = 0; }
|
||||
int loadKeysFor(const char* name, uint16_t id, TransportKey keys[], int max_num);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue