Made the HCIEmulator Log Level settable inside the .yaml file
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user