Skip to content

Commit 68bc537

Browse files
committed
write works
1 parent f4ef505 commit 68bc537

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/nrfcredstore/comms.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,9 @@ def expect_response(self, ok_str=None, error_str=None, store_str=None, timeout=1
341341
output = ''
342342
time_end = time.time() + timeout
343343
while time.time() < time_end:
344-
line = self.read_line().strip()
344+
line = self.read_line()
345345
if line:
346+
line = line.strip()
346347
if ok_str and ok_str == ansi_escape.sub('', line):
347348
return (True, output)
348349
if error_str and error_str == ansi_escape.sub('', line):

src/nrfcredstore/credstore.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def write(self, tag: int, type: CredType, file: io.TextIOBase):
8181
if type == CredType.ANY:
8282
raise ValueError
8383
cert = file.read().rstrip()
84-
return self.command_interface.at_command(f'AT%CMNG=0,{tag},{type.value},"{cert}"', wait_for_result=False)
84+
return self.command_interface.at_command(f'AT%CMNG=0,{tag},{type.value},"{cert}"', wait_for_result=True)
8585

8686
def delete(self, tag: int, type: CredType):
8787
"""Delete a credential from the modem
@@ -91,7 +91,7 @@ def delete(self, tag: int, type: CredType):
9191

9292
if type == CredType.ANY:
9393
raise ValueError
94-
return self.command_interface.at_command(f'AT%CMNG=3,{tag},{type.value}', wait_for_result=False)
94+
return self.command_interface.at_command(f'AT%CMNG=3,{tag},{type.value}', wait_for_result=True)
9595

9696
def keygen(self, tag: int, file: io.BufferedIOBase, attributes: str = ''):
9797
"""Generate a new private key and return a certificate signing request in DER format"""

0 commit comments

Comments
 (0)