text: #include "BTConnManager.h"
  #include "Arduino.h"
  
  BTConnManager::BTConnManager(SoftwareSerial* mobileAppConn, int LM){
      this->mobileAppConn = mobileAppConn;
      this->pin = LM;
  }
  
  void BTConnManager::init(int period){
    Task::init(period);
    content.reserve(256);
    this->led = new Led(pin);
  }
  
  void BTConnManager::tick(State* state, Humidity* hum){
    /*state = MANUAL*/
    if(state->getState() == 1){
      led->switchOn();
      /*invio umidità al Green House Mobile App*/
      mobileAppConn->println(String(hum->getHum()));
  
      /*ricezione msg Green House Mobile App*/
      while(mobileAppConn->available()){
        char ch = mobileAppConn->read();
        if(ch == '\n'){
          hum->setActionM(content.toInt());
          content = "";
        } else {
          content += ch;
        }
      }
    } else {
      led->switchOff();
    }
  }
  