From 18bf58e094af41759b4f30f99f6c8477ca9c1f52 Mon Sep 17 00:00:00 2001 From: Patrick Zysset Date: Tue, 29 Jan 2019 15:43:02 +0100 Subject: [PATCH] board-descriptor: allow 0xffff as end tag with latest nmhw21 boards 0xffff have been introduced as a new end tag (with or without intention). Tag 65535 is now handled the same way as Tag 0 (aka end-tag). BugzId: 55411 Signed-off-by: Patrick Zysset --- .../board-descriptor/board-descriptor/descriptor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes-core/board-descriptor/board-descriptor/descriptor.py b/recipes-core/board-descriptor/board-descriptor/descriptor.py index 922e9ba..88e1b48 100644 --- a/recipes-core/board-descriptor/board-descriptor/descriptor.py +++ b/recipes-core/board-descriptor/board-descriptor/descriptor.py @@ -155,10 +155,10 @@ class _BdRaw: j = 0 self.tlvs = [] while i < self.buffer_len + 8: - # Zero means end of bd + # Zero or 0xffff means end of bd tag = self._get_hw(data[i:i + 2]) i += 2 - if tag == 0: + if tag == 0 or tag == 0xffff: i -= 2 break length = self._get_hw(data[i:i + 2]) @@ -175,7 +175,7 @@ class _BdRaw: data_length = self._read_binary(data) - if self.checksum != 0: + if self.checksum != 0 and self.checksum != 0xffff: self._verify_checksum(data[8:data_length], self.checksum) else: self.is_writable = True