piermesh/docs/Sponge/base.md

69 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a id="base-primary-filtering-functionality"></a>
# base: Primary filtering functionality
### *class* Sponge.base.Filter(cache, onodeID, todo, cryptographyInfo)
Packet filtering orchestration
[🔗 Source](https://git.utopic.work/PierMesh/piermesh/src/branch/main/Sponge/base.py)
#### cache
Reference to our Daisy Cache instance
* **Type:**
[Daisy.Cache.Cache](/PierMesh/piermesh/src/branch/main/docs/Daisy/Cache.md#Daisy.Cache.Cache)
#### onodeID
PierMesh node ID
#### todo
Reference to list of actions to do in the Node
#### cryptographyInfo
Cryptography instance for encrypting message
* **Type:**
[Cryptography.WhaleSong.Transport](/PierMesh/piermesh/src/branch/main/docs/Cryptography/WhaleSong.md#Cryptography.WhaleSong.Transport)
#### messages
Temporary storage for unfinished messages
* **Type:**
dict
#### submessages
Temporary storage for unfinished submessages
* **Type:**
dict
#### completed
List of finished message ids so we dont reprocess messages
* **Type:**
list
#### mCheck(payload: bytes)
Check if payload bytes are msgpack encoded, otherwise skip
#### *async* protoMap(protocolID: int, packetsID, packetCount, sourceNode, submessagesIDs=[], pAction=None)
Get protocol from protocol ID using the mlookup table
#### selfCheck(packet)
Check if this is a self packet, if so skip
#### *async* sieve(packet)
Base filtering logic, takes a single MeshTastic packet