Made the HCIEmulator Log Level settable inside the .yaml file

This commit is contained in:
2025-10-07 02:01:56 +02:00
parent 9d3930af59
commit 3b88f1e988
5 changed files with 29 additions and 5 deletions

View File

@@ -20,6 +20,7 @@ class HoermannMainComponent: public Component{
protected:
HCIEmulator* emulator;
TaskHandle_t modBusTask;
int log_level = 3; // Defaults to INFO
uart::UARTComponent* _uart;
InternalGPIOPin* _tx_on;
@@ -36,6 +37,11 @@ class HoermannMainComponent: public Component{
void set_tx_on_pin(InternalGPIOPin* pin){
this->_tx_on = pin;
}
void set_log_level(int level){
this->log_level = level;
}
HCIEmulator* getEmulator(){
return emulator;
}
@@ -44,6 +50,7 @@ class HoermannMainComponent: public Component{
this->_tx_on->setup();
this->emulator = new HCIEmulator(this->_tx_on, this->_uart);
this->emulator->setLogLevel(this->log_level);
this->_tx_on->digital_write(false);
this->set_continue_ = true;