//#include "FHT8V_Wireless_Rad_Valve.h" // Send a CC1 Alert message with this unit's house code via the RFM23B. bool sendCC1AlertByRFM23B() { OTProtocolCC::CC1Alert a = OTProtocolCC::CC1Alert::make(FHT8VGetHC1(), FHT8VGetHC2()); if(a.isValid()) // Might be invalid if house codes are, eg if house codes not set. { uint8_t txbuf[STATS_MSG_START_OFFSET + OTProtocolCC::CC1Alert::primary_frame_bytes+1]; // More than large enough for preamble + sync + alert message. uint8_t *const bptr = RFM22RXPreambleAdd(txbuf); const uint8_t bodylen = a.encodeSimple(bptr, sizeof(txbuf) - STATS_MSG_START_OFFSET, true); const uint8_t buflen = STATS_MSG_START_OFFSET + bodylen; #if 0 && defined(DEBUG) OTRadioLink::printRXMsg(p, txbuf, buflen); #endif // Send loud since the hub may be relatively far away, // there is no 'ACK', and these messages should not be sent very often. // Should be consistent with automatically-generated alerts to help with diagnosis. return(PrimaryRadio.sendRaw(txbuf, buflen, 0, OTRadioLink::OTRadioLink::TXmax)); } return(false); // Failed. }
// Load EEPROM house codes into primary FHT8V instance at start-up or once cleared in FHT8V instance. void FHT8VLoadHCFromEEPROM() { // Uses side-effect to cache/save in FHT8V instance. FHT8VGetHC1(); FHT8VGetHC2(); }