mirror of
https://github.com/meshtastic/python.git
synced 2026-02-28 20:50:11 -05:00
raise exception if data payload is too big
This commit is contained in:
@@ -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