|
HF-TMC51x0 Driver (TMC5130 & TMC5160) 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC51x0 (TMC5130 & TMC5160)
|
Functions | |
| void | Init (SecuritySettings &sec, const uint8_t *preconfigured_mac=nullptr, DeviceType preconfigured_type=DeviceType::Unknown, const char *preconfigured_name=nullptr) noexcept |
| Initialize peer storage and load approved peers from NVS. | |
| bool | AddPeer (SecuritySettings &sec, const uint8_t mac[6], DeviceType type, const char *name) noexcept |
| Add a new approved peer to storage. | |
| bool | RemovePeer (SecuritySettings &sec, const uint8_t mac[6]) noexcept |
| Remove a peer by MAC address. | |
| bool | IsPeerApproved (const SecuritySettings &sec, const uint8_t mac[6]) noexcept |
| Check if a MAC address is in the approved peer list. | |
| const ApprovedPeer * | GetPeer (const SecuritySettings &sec, const uint8_t mac[6]) noexcept |
| Get peer information by MAC address. | |
| bool | GetFirstPeerOfType (const SecuritySettings &sec, DeviceType type, uint8_t mac_out[6]) noexcept |
| Get the first valid peer MAC of a specific device type. | |
| void | Save (const SecuritySettings &sec) noexcept |
| Save the current peer list to NVS. | |
| size_t | GetPeerCount (const SecuritySettings &sec) noexcept |
| Get the number of valid approved peers. | |
| void | ClearAll (SecuritySettings &sec) noexcept |
| Clear all approved peers (factory reset). | |
| void | LogPeers (const SecuritySettings &sec) noexcept |
| Log all approved peers (for debugging). | |
|
noexcept |
Add a new approved peer to storage.
If the peer already exists (by MAC), updates the existing entry.
| sec | Security settings structure |
| mac | Peer's MAC address |
| type | Peer's device type |
| name | Human-readable name for the peer |
|
noexcept |
Clear all approved peers (factory reset).
| sec | Security settings structure |
|
noexcept |
Get the first valid peer MAC of a specific device type.
Useful for getting the default target MAC when sending messages.
| sec | Security settings structure |
| type | Device type to find |
| mac_out | Output buffer for MAC address (6 bytes) |
|
noexcept |
Get peer information by MAC address.
| sec | Security settings structure |
| mac | MAC address to look up |
|
noexcept |
Get the number of valid approved peers.
| sec | Security settings structure |
|
noexcept |
Initialize peer storage and load approved peers from NVS.
| sec | Security settings structure to populate |
| preconfigured_mac | Optional pre-configured MAC from compile-time config. If non-zero, this MAC is always trusted (backward compatibility). |
| preconfigured_type | DeviceType of the pre-configured MAC |
| preconfigured_name | Name for the pre-configured peer |
|
noexcept |
Check if a MAC address is in the approved peer list.
| sec | Security settings structure |
| mac | MAC address to check |
|
noexcept |
Log all approved peers (for debugging).
| sec | Security settings structure |
|
noexcept |
Remove a peer by MAC address.
| sec | Security settings structure |
| mac | MAC address of peer to remove |
|
noexcept |
Save the current peer list to NVS.
Called automatically by AddPeer/RemovePeer, but can be called manually if needed.
| sec | Security settings structure |