16 void init(uint8_t msgcnt,int16_t temp,uint8_t humidity,
bool batlow) {
17 uint8_t t1 = (temp >> 8) & 0x7f;
18 uint8_t t2 = temp & 0xff;
19 if( batlow ==
true ) {
22 Message::init(0xc,msgcnt,AS_MESSAGE_WEATHER_EVENT,BIDI,t1,t2);
27 template <
class HAL,
class CLOCKTYPE,
class SENSORSTYPE,
int PEERS_PER_CHANNEL,
int EXTRADELAY,
class LIST0,
class LIST1=List1,
class LIST4=List4>
37 virtual void trigger (__attribute__ ((unused))
AlarmClock& clock) {
39 if( delayMillis() ==
false ) {
40 uint8_t msgcnt = this->device().nextcount();
43 msg.init(msgcnt,sens.temperature(),sens.humidity(),this->device().battery().low());
44 this->device().broadcastEvent(msg);
50 void reactivate (
Message& msg) {
52 CLOCKTYPE::instance().add(*
this,nextsend);
54 CLOCKTYPE::instance().add(sens,nextsend-sens.before());
60 CLOCKTYPE::instance().add(sens,1000);
61 CLOCKTYPE::instance().add(*
this,sens.before()+1000);
64 uint8_t status ()
const {
return 0; }
66 uint8_t flags ()
const {
return this->device().battery().low() ? 0x80 : 0x00; }
68 SENSORSTYPE& sensors () {
return sens; }