Skip to content

Commit

Permalink
decode was completely not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Dawid SQ6EMM committed Dec 14, 2023
1 parent 682818b commit 9435312
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions python/mopp/src/mopp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,22 @@ def decode(buffer):
outcode = ""
outchars = ""
for el in buffer:
if el == "01":
outcode += "."
elif el == "10":
outcode += "-"
elif el == "00":

for letter, code in morse.items():
if code == outcode:
outchars += letter
outcode = ""
elif el =="11":
for letter, code in morse.items():
if code == outcode:
outchars += letter
outcode = ""
outchars = outchars + " "
return outchars
if el == "01":
outcode += "."
elif el == "10":
outcode += "-"
elif el == "00":
for letter, code in morse.items():
if code == outcode:
outchars += letter
outcode = ""
elif el == "11":
for letter, code in morse.items():
if code == outcode:
outchars += letter
outcode = ""
outchars = outchars + " "
return outchars


#make own zfill for uPython
Expand Down Expand Up @@ -244,4 +243,5 @@ def return_duration_json(self, message):
data['durations'].append(-self.eow_duration)

updated_json_string = json.dumps(data, indent=2)
return updated_json_string
return updated_json_string

0 comments on commit 9435312

Please sign in to comment.