Skip to content

Commit 983e464

Browse files
committed
cellular: fix creation of IMEI when reading device information
Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
1 parent 2813c3e commit 983e464

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

digi/xbee/devices.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6827,7 +6827,9 @@ def _read_device_info(self, reason, init=True, fire_event=True):
68276827

68286828
# Generate the IMEI address.
68296829
if init or self._imei_addr is None:
6830-
imei_addr = XBeeIMEIAddress(self._64bit_addr.address)
6830+
imei_val = str(self.get_parameter(ATStringCommand.IM, apply=False),
6831+
encoding='utf8', errors='ignore')
6832+
imei_addr = XBeeIMEIAddress.from_string(imei_val)
68316833
if self._imei_addr != imei_addr:
68326834
updated = True
68336835
self._imei_addr = imei_addr

digi/xbee/models/atcomm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class ATStringCommand(Enum):
7777
HP = ("HP", "Preamble ID")
7878
IC = ("IC", "Digital change detection")
7979
ID = ("ID", "Network PAN ID/Network ID/SSID")
80+
IM = ("IM", "IMEI")
8081
IR = ("IR", "I/O sample rate")
8182
IS = ("IS", "Force sample")
8283
JN = ("JN", "Join notification")

0 commit comments

Comments
 (0)