String token) {
Init(number, ip, relay, state, miner, token);
strcpy(cfg.pwd,"");
strcpy(cfg.token, token.c_str());
}
Farm::Farm(int number, IPAddress ip, int relay, ts_STATE state, ts_MINER miner, String pwd, String token) {
Init(number, ip, relay, state, miner, token);
strcpy(cfg.pwd,pwd.c_str());
strcpy(cfg.token, token.c_str());
}
//------------------------------------------------------------------------------
void Farm::Init(int number, IPAddress ip, int relay, ts_STATE state, ts_MINER miner, String token) {
cfg.number = number;
cfg.ip = ip;
cfg.relay = relay;
cfg.miner = miner;
cfg.state = (state==OFF) ? OFF : ONLINE;
//cfg.state = ONLINE;
//_lastAnswer = millis();
lastReboot = lastReply.ping = lastReply.miner = millis();
nAttempts = 0;
_lastCheck = 0;
seqReboots = 1;
UniversalTelegramBot bot(token.c_str(), tclient);
}
а бот точно должен умирать после выхода из функции?
Обсуждают сегодня