Added encoding to morse - #61
Conversation
| help | ||
| Beacon repeat delay in seconds | ||
|
|
||
| config MORSE_CODE_BEACON_TEXT |
There was a problem hiding this comment.
That looks good! I'd welcome this feature as it has been on my TODO list.
One suggestion though is to have the text to morse code conversion done on the backend (C code) instead of frontend. This way you can remove:
config MORSE_CODE_BEACON_TEXT
and only keep:
config BEACON_TEXT
the C code should convert stored text, when needed to dots and dashes.
Front-end part could then remain unchanged.
There was a problem hiding this comment.
Thank for the suggestion! I will do as you say.
|
Hello, I got the morse enconding done on the backend so MORSE_CODE_BEACON_TEXT could be removed but I left the morse encoding in the frontend. It is possible to remove it entirely but I would like to show the user the morse string being transmitted. Please let me know if you have any suggestion on the code. I made use of chatGPT since I am not really confortable on C. |
| v-model="settingsStore['beacon.morse_code.text']" | ||
| label="Morse code" | ||
| disable | ||
| v-if="beaconMode != BeaconMode.OFF && beaconMode != BeaconMode.WAV" |
There was a problem hiding this comment.
Lets use:
beaconMode == BeaconMode.MORSE_CODE
| "beacon.text": "-..--.", | ||
| "beacon.text": "Default text", | ||
| "beacon.delay_seconds": 12, | ||
| "beacon.morse_code.text": "-.. . ..-. .- ..- .-.. - / - . -..- -", |
There was a problem hiding this comment.
beacon.morse_code.text should not be in the store as we need to have single source of truth. Instead in the Vue component you can use watch and calculate the morse code value dynamically based on the value of beacon.text.
| } | ||
|
|
||
|
|
||
| /*() => [settingsStore["beacon.morse_code.text"], settingsStore["beacon.text"]], |
| TRANSMIT_AfskParam_t afsk_param = { | ||
| .input = gSettings.beacon.text, | ||
| .len = strlen(gSettings.beacon.text), | ||
| .input = gSettings.beacon.morse_code.text, |
There was a problem hiding this comment.
this is wrong, these are afsk params
| @@ -0,0 +1,67 @@ | |||
| #include "morse.h" | |||
|
|
|||
| // Morse code representation for each letter, digit, space, and punctuation | |||
…the morse code dynamically
Instead of typing morse code directly, a translation is used to make it easier to send a message.