Skip to content

Commit 5a8f03e

Browse files
committed
filesystem: xbee blu: do not include FS API support
While on it avoid a possible 'KeyError' if a protocol is not defined in the minimum and/or maximum versions dictionary. Related to commit 'Add support for the new XBee BLU device/product.' (187afbf) https://onedigi.atlassian.net/browse/XBPL-391 https://onedigi.atlassian.net/browse/XBPL-396 Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
1 parent cdbfb8e commit 5a8f03e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

digi/xbee/filesystem.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,20 @@
9595
XB3_MIN_FW_VERSION_FS_API_SUPPORT = {
9696
XBeeProtocol.ZIGBEE: 0x10FF,
9797
XBeeProtocol.DIGI_MESH: 0x30FF,
98-
XBeeProtocol.RAW_802_15_4: 0x20FF
98+
XBeeProtocol.RAW_802_15_4: 0x20FF,
99+
# XBeeProtocol.BLE, specify so:
100+
# * FileSystemManager() is NOT supported until FS API frames are added
101+
XBeeProtocol.BLE: 0x40FF
99102
}
100103

101104
# Update this values when the File System OTA support is deprecated
102105
XB3_MAX_FW_VERSION_FS_OTA_SUPPORT = {
103106
XBeeProtocol.ZIGBEE: 0x10FF,
104107
XBeeProtocol.DIGI_MESH: 0x30FF,
105108
XBeeProtocol.RAW_802_15_4: 0x20FF
109+
# XBeeProtocol.BLE, do not specify so:
110+
# * LocalXBeeFileSystemManager() is SUPPORTED
111+
# * update_remote_filesystem_image() is NOT supported (remotes do not exist)
106112
}
107113

108114
_DEFAULT_BLOCK_SIZE = 64
@@ -3385,8 +3391,8 @@ def check_fs_support(xbee, min_fw_vers=None, max_fw_vers=None):
33853391
if not fw_version:
33863392
return True
33873393

3388-
min_fw_version = min_fw_vers[xbee.get_protocol()] if min_fw_vers else None
3389-
max_fw_version = max_fw_vers[xbee.get_protocol()] if max_fw_vers else None
3394+
min_fw_version = min_fw_vers.get(xbee.get_protocol(), None) if min_fw_vers else None
3395+
max_fw_version = max_fw_vers.get(xbee.get_protocol(), None) if max_fw_vers else None
33903396

33913397
version = utils.bytes_to_int(fw_version)
33923398
if min_fw_version and version < min_fw_version:

0 commit comments

Comments
 (0)