Skip to content

Commit

Permalink
backend: modem: at: Change fetch IMEI impl
Browse files Browse the repository at this point in the history
* Change to use by default AT+CGSN instead of AT+CGSN=1 as provided in
  manual since some modems does not implement it, and only use AT+CGSN=1
  to fallback
  • Loading branch information
JoaoMario109 committed Dec 17, 2024
1 parent bc6ebd8 commit 02bc556
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/modem/at.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@ async def get_serial_number(self) -> ATResponse:
return await self.command(ATCommand.IMEI_SN, ATDivider.EQ, '0')

async def get_imei(self) -> ATResponse:
return await self.command(ATCommand.IMEI_SN, ATDivider.EQ, '1')
try:
return await self.command(ATCommand.IMEI_SN, cmd_id_response=False)
except SerialSafeReadFailed:
return await self.command(ATCommand.IMEI_SN, ATDivider.EQ, '1')

async def get_international_mobile_subscriber_id(self) -> ATResponse:
return await self.command(ATCommand.IMSI, cmd_id_response=False)
Expand Down

0 comments on commit 02bc556

Please sign in to comment.