mirror of
https://github.com/meshtastic/python.git
synced 2026-09-14 14:28:24 -04:00
raise exception if data payload is too big
This commit is contained in:
1 parent
fa2f0bdc60
commit
6e1e6efbf9
1 file changed
+2
@@ -146,6 +146,8 @@ class MeshInterface:
|
||||
if getattr(data, "SerializeToString", None):
|
||||
data = data.SerializeToString()
|
||||
|
||||
if len(data) > mesh_pb2.Constants.DATA_PAYLOAD_LEN:
|
||||
raise Exception("Data payload too big")
|
||||
meshPacket = mesh_pb2.MeshPacket()
|
||||
meshPacket.decoded.data.payload = data
|
||||
meshPacket.decoded.data.portnum = portNum
|
||||
|
||||
Reference in new issue
Block a user