use strlen instead of sizeof to determine command length
This commit is contained in:
		
							parent
							
								
									db74ecbfb9
								
							
						
					
					
						commit
						32926c30de
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -68,8 +68,10 @@ static void uart_event_task(void *pvParameters) {
 | 
			
		|||
            struct Cmd *handler;
 | 
			
		||||
            uint8_t match = ucmdr_match((char *)dtmp, &handler);
 | 
			
		||||
 | 
			
		||||
            ESP_LOGD(TAG, "command size: %d", strlen(handler->cmd));
 | 
			
		||||
 | 
			
		||||
            if(match) {
 | 
			
		||||
              handler->callback(dtmp + sizeof(handler->cmd));
 | 
			
		||||
              handler->callback(dtmp + strlen(handler->cmd));
 | 
			
		||||
            } else {
 | 
			
		||||
              printf("command not found\n");
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue