From 50acc63cb1aca4bb7ce48ed2103918eed07631ed Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 19 Jan 2012 01:04:41 +0000 Subject: [PATCH 1/1] wip multiplexer --- ttyacm-multiplex | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/ttyacm-multiplex b/ttyacm-multiplex index 727edf1..cdb4638 100755 --- a/ttyacm-multiplex +++ b/ttyacm-multiplex @@ -106,16 +106,7 @@ proc dchan-readable {args} { } } -proc async-notif-or-resp-varies {async_values asid l} { - set ll [llength [split $l ,]] - if {$ll == $async_values} { - async-notif $asid $l - } elseif {$ll == $async_values+1} { - sync-reply $l - } else { - bad-data $l "async-notif-or-resp-varies $ll" - } -} +proc async-notif fixme this has wrong arguments proc async-notif-or-resp-fixed {asid l} { global current_command_asid @@ -214,6 +205,10 @@ proc set-client-echo {c yn} { client-command-complete $c OK } +proc sync-reply + +proc client-command-complete + proc process-client-command {c nl} { switch -regexp $l { {^AT\+CREG\b} { async-control-max0 $c $l {{0 1 2}} } @@ -228,16 +223,13 @@ proc process-client-command {c nl} { proc dchan-line {l} { global cclient switch -regexp $l { - {\+CREG:} { async-notif-creg +CREG $l } - {\+CGREG:} { async-notif-creg +CGREG $l } - {\*ERINFO:} { async-notif-or-resp-fixed *ERINFO $l } + {\+CREG:} { async-notif-creg +CREG $l } + {\+CGREG:} { async-notif-creg +CGREG $l } + {\*ERINFO:} { async-notif-or-resp-fixed *ERINFO $l } {\+CGEV:} { async-notif +CGEREP $l } - - {\+CIEV:} { async-notif +CIEV $l } + {\+CIEV:} { async-notif +CMER $l } } - if {[info exists cclient - proc sendout-async proc logquote -- 2.30.2