add position to sim info
This commit is contained in:
+3
-1
@@ -65,8 +65,10 @@ class ModemPool:
|
||||
response = str(self._send_command(cmd, ser))
|
||||
ccid_group = re.search("[0-9F]+", response)
|
||||
ccid = ccid_group.group(0)
|
||||
sim_position = index + 1
|
||||
position = (slot_position - 1) * 15 + sim_position
|
||||
if phone_number:
|
||||
self._db_manager.save_sim_info(SimInfoPojo(phone=phone_number, ccid=ccid))
|
||||
self._db_manager.save_sim_info(SimInfoPojo(phone=phone_number, ccid=ccid, position=position))
|
||||
# write the number to sim card's phonebook
|
||||
cmd = f'AT+CPBW={self.phone_number_position},\"{phone_number}\"\r'
|
||||
self._send_command(cmd, ser, wait_time_in_s=2)
|
||||
|
||||
Reference in New Issue
Block a user