File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,6 +66,11 @@ fn get_channel_args() -> Vec<clap::Arg> {
6666 let serial_args_ids = get_serial_args_ids ( ) . into_iter ( ) ;
6767
6868 vec ! [
69+ arg!( --protocol <PROTOCOL > "Choose between legacy and pconsole protocol" )
70+ . default_value( "legacy" )
71+ . hide_default_value( true )
72+ . value_parser( [ "legacy" , "pconsole" ] )
73+ . hide_possible_values( true ) ,
6974 arg!( --serial "Use the serial bootloader to flash" )
7075 . action( clap:: ArgAction :: SetTrue )
7176 . conflicts_with_all( probe_args_ids. clone( ) . collect:: <Vec <_>>( ) ) ,
Original file line number Diff line number Diff line change @@ -133,9 +133,22 @@ async fn main() -> Result<()> {
133133 match matches. subcommand ( ) {
134134 Some ( ( "listen" , sub_matches) ) => {
135135 cli:: validate ( & mut cmd, sub_matches) ;
136- tock_process_console:: run ( )
137- . await
138- . context ( "Failed to run console." ) ?;
136+ let protocol = sub_matches
137+ . get_one :: < String > ( "protocol" )
138+ . map ( String :: as_str)
139+ . unwrap_or ( "legacy" ) ;
140+ match protocol {
141+ "legacy" => {
142+ // start process for legacy mode
143+ tock_process_console:: run ( )
144+ . await
145+ . context ( "Failed to run console." ) ?;
146+ }
147+ "pconsole" => {
148+ // TODO
149+ }
150+ _ => { }
151+ }
139152 }
140153 Some ( ( "list" , sub_matches) ) => {
141154 cli:: validate ( & mut cmd, sub_matches) ;
You can’t perform that action at this time.
0 commit comments