diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index cf9009ce..e35a60b7 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -411,7 +411,8 @@ def sendText( wantResponse: bool = False, onResponse: Optional[Callable[[dict], Any]] = None, channelIndex: int = 0, - portNum: portnums_pb2.PortNum.ValueType = portnums_pb2.PortNum.TEXT_MESSAGE_APP + portNum: portnums_pb2.PortNum.ValueType = portnums_pb2.PortNum.TEXT_MESSAGE_APP, + replyId: Optional[int]=None, ): """Send a utf8 string to some other node, if the node has a display it will also be shown on the device. @@ -428,6 +429,7 @@ def sendText( send an application layer response portNum -- the application portnum (similar to IP port numbers) of the destination, see portnums.proto for a list + replyId -- the ID of the message that this packet is a response to Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks. @@ -441,6 +443,7 @@ def sendText( wantResponse=wantResponse, onResponse=onResponse, channelIndex=channelIndex, + replyId=replyId ) @@ -451,7 +454,7 @@ def sendAlert( onResponse: Optional[Callable[[dict], Any]] = None, channelIndex: int = 0, ): - """Send an alert text to some other node. This is similar to a text message, + """Send an alert text to some other node. This is similar to a text message, but carries a higher priority and is capable of generating special notifications on certain clients. @@ -503,6 +506,7 @@ def sendData( pkiEncrypted: Optional[bool]=False, publicKey: Optional[bytes]=None, priority: mesh_pb2.MeshPacket.Priority.ValueType=mesh_pb2.MeshPacket.Priority.RELIABLE, + replyId: Optional[int]=None, ): # pylint: disable=R0913 """Send a data packet to some other node @@ -527,6 +531,7 @@ def sendData( will implicitly be true. channelIndex -- channel number to use hopLimit -- hop limit to use + replyId -- the ID of the message that this packet is a response to Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks. @@ -554,6 +559,8 @@ def sendData( meshPacket.decoded.portnum = portNum meshPacket.decoded.want_response = wantResponse meshPacket.id = self._generatePacketId() + if replyId is not None: + meshPacket.decoded.reply_id = replyId if priority is not None: meshPacket.priority = priority @@ -884,7 +891,7 @@ def deleteWaypoint( Send a waypoint deletion packet to some other node (normally a broadcast) NB: The id must be the waypoint's id and not the id of the packet creation. - + Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks. """