AmendHub

Download:

jcs

/

subtext

/

amendments

/

309

sysop: Add an option in the sysop menu to hang up the modem


jcs made amendment 309 about 1 year ago
--- serial.c Sun Feb 5 10:38:19 2023 +++ serial.c Thu Feb 23 07:23:51 2023 @@ -236,6 +236,9 @@ serial_hangup(void) { long m; + if (db->config.modem_port == 0) + return; + logger_printf("[modem] Hanging up"); /* de-assert DTR */ @@ -243,6 +246,9 @@ serial_hangup(void) Delay(TICKS_PER_SEC * 1, &m); /* assert DTR */ Control(serial_out_refnum, 17, NULL); + + if (the_serial_node.session != NULL) + the_serial_node.session->ending = true; } void --- sysop.c Wed Feb 22 21:28:42 2023 +++ sysop.c Thu Feb 23 07:26:16 2023 @@ -19,6 +19,7 @@ #include "subtext.h" #include "ansi.h" #include "board.h" +#include "serial_local.h" #include "session.h" #include "sysop.h" @@ -38,6 +39,7 @@ sysop_menu(struct session *s) { static const struct session_menu_option opts[] = { { 'm', "Mm", "Edit Message of the Day" }, + { 'h', "Hh", "Hang Up Modem" }, { 'b', "Bb", "Manage Boards" }, { 'f', "Ff", "Manage File Folders" }, { 'u', "Uu", "Manage Users" }, @@ -65,6 +67,11 @@ sysop_menu(struct session *s) break; case 'f': sysop_edit_folders(s); + break; + case 'h': + session_printf(s, "Hanging up modem...\r\n"); + session_flush(s); + serial_hangup(); break; case 'm': sysop_edit_motd(s);