mirror of
https://github.com/espressif/openthread.git
synced 2026-07-27 22:37:45 +00:00
[mle] add enhanced keep-alive (#4325)
This commit introduces the first Thread 1.2 feature - enhanced keep alive. This commit also introduces the build config OPENTHREAD_CONFIG_THREAD_VERSION to include/exclude Thread 1.2 code.
This commit is contained in:
@@ -354,6 +354,10 @@ class Message(object):
|
||||
ipv6.UDPDatagram)
|
||||
return self.ipv6_packet.upper_layer_protocol.header.dst_port
|
||||
|
||||
def is_data_poll(self):
|
||||
return self._type == MessageType.COMMAND and \
|
||||
self._mac_header.command_type == mac802154.MacHeader.CommandIdentifier.DATA_REQUEST
|
||||
|
||||
def __repr__(self):
|
||||
if (self.type == MessageType.DTLS and
|
||||
self.dtls.content_type == dtls.ContentType.HANDSHAKE):
|
||||
@@ -375,6 +379,14 @@ class MessagesSet(object):
|
||||
def commissioning_messages(self):
|
||||
return self._commissioning_messages
|
||||
|
||||
def next_data_poll(self):
|
||||
while True:
|
||||
message = self.next_message_of(MessageType.COMMAND, False)
|
||||
if not message:
|
||||
break
|
||||
elif message.is_data_poll():
|
||||
return message
|
||||
|
||||
def next_coap_message(self, code, uri_path=None, assert_enabled=True):
|
||||
message = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user