acerion / cwdaemon

Morse code daemon for unix systems
GNU General Public License v2.0
14 stars 5 forks source link

Tune zero time #13

Open OH1KH opened 3 months ago

OH1KH commented 3 months ago

Valid values for tuning time starts from 0 (zero) How ever c0 does not do anything because "void cwdaemon_tune" has "if (seconds > 0)"

If user expects that he can stop started long tuning by sending new command with c0 nothing happens.

"if (seconds > 0)" can be changed to "if (seconds >= 0)" that then stops started tuning, but if c0 is sent alone causes sending of letter "e".

Started tuning stops with ESC 4, but that has not been told in parameter descriptions nor man pages.

Third way is to add "else" code to "if (seconds >0)" in "void cwdaemon_tune". (damn I have forgotten most git commands to make a PR)

} else { /* needs this if tuning is stopped with 'c0'. Other way to stop is <ESC>4 */ cw_flush_tone_queue(); cw_wait_for_tone_queue(); if (ptt_flag) { cwdaemon_set_ptt_off(global_cwdevice, "PTT off"); } ptt_flag &= 0; }

acerion commented 2 months ago

Thank you for the message, and sorry for late response.

I will try to address this issue with the least amount of changes+tests that are possible in current development cycle (for v0.13.0). I'm right now in final tests phase so I can't guarantee that I will be able to squeeze something in.

If necessary changes will be non-trivial, I will have to postpone them till next development cycle (for v0.14.0).

Best regards, Kamil

On 10.06.2024 18:22, OH1KH wrote:

Valid values for tuning time starts from 0 (zero) How ever c0 does not do anything because "void cwdaemon_tune" has "if (seconds > 0)"

If user expects that he can stop started log tuning by sending new command with c0 nothing happens.

"if (seconds > 0)" can be changed to "if (seconds >= 0)" that then stops started tuning, but if c0 is sent alone causes sending of letter "e".

Started tuning stops with 4, but that has not been told in parameter descriptions nor man pages.

Third way is to add "else" code to "if (seconds >0)" in "void cwdaemon_tune". (damn I have forgotten most git commands to make a PR)

|} else { / needs this if tuning is stopped with 'c0'. Other way to stop is 4 /| |cw_flush_tone_queue();| |cw_wait_for_tone_queue();| |if (ptt_flag) {| |cwdaemon_set_ptt_off(global_cwdevice, "PTT off");| |}| |ptt_flag &= 0;| |}|

— Reply to this email directly, view it on GitHub https://github.com/acerion/cwdaemon/issues/13, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDWUVXNJ4V3L4IEDGK27YDZGXHEVAVCNFSM6AAAAABJCUOWGGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM2DIMZUHE4DQMA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

acerion commented 2 months ago

This issue is partially addressed in commit 518b4b6.

Perhaps in the future I will also implement terminating of the tuning through "0" value to "c" Escape request.

For now I will keep this ticket open to remind me about this possibility.