File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 7070 }
7171
7272 /// Retrieves the current WiFi network connection status.
73- ///
73+ ///
7474 /// NOTE: A future version will provide a enumerated type instead of the raw integer values
7575 /// from the NINA firmware.
7676 pub fn get_connection_status ( & mut self ) -> Result < u8 , Error > {
@@ -147,8 +147,14 @@ where
147147 fn execute < P : NinaParam > ( & mut self , operation : & Operation < P > ) -> Result < ( ) , Error > {
148148 let mut param_size: u16 = 0 ;
149149 self . control_pins . wait_for_esp_select ( ) ;
150-
151- self . send_cmd ( & operation. command , operation. params . len ( ) as u8 ) . ok ( ) . unwrap ( ) ;
150+ let number_of_params: u8 = if operation. has_params {
151+ operation. params . len ( ) as u8
152+ } else {
153+ 0
154+ } ;
155+ self . send_cmd ( & operation. command , number_of_params)
156+ . ok ( )
157+ . unwrap ( ) ;
152158
153159 // Only send params if they are present
154160 if operation. has_params {
You can’t perform that action at this time.
0 commit comments