示例#1
0
/**
 * @brief HM event controller
 */
void cmMyBlind::hmEventCol(uint8_t by3, uint8_t by10, uint8_t by11, uint8_t *data, uint8_t len) {
//	dbg << "hmEventCol >>>>>>> by3:" << by3 << " by10:" << by10 << " d:" << _HEX(data, len) << '\n'; _delay_ms(100);
	if      ((by3 == 0x00) && (by10 == 0x00)) poll();
	else if ((by3 == 0x00) && (by10 == 0x01)) setToggle();
	else if ((by3 == 0x00) && (by10 == 0x02)) firstStart();
	else if ((by3 == 0x01) && (by11 == 0x06)) configCngEvent();
	else if ((by3 == 0x11) && (by10 == 0x02)) pairSetEvent(data, len);			// set
	else if ((by3 == 0x11) && (by10 == 0x03)) pairSetEvent(data, 0);			// stop
	else if ((by3 == 0x01) && (by11 == 0x0E)) pairStatusReq();
	else if ((by3 == 0x01) && (by11 == 0x01)) peerAddEvent(data, len);
	else if  (by3 >= 0x3E)                    peerMsgEvent(by3, data, len);
	else return;
}
示例#2
0
文件: Dummy.cpp 项目: LineF/AskSin
void Dummy::hmEventCol(uint8_t by3, uint8_t by10, uint8_t by11, uint8_t *data, uint8_t len) {
	if       (by3 == 0x00)                    poll();
	else if ((by3 == 0x01) && (by11 == 0x06)) configCngEvent();
	else if ((by3 == 0x11) && (by10 == 0x02)) pairSetEvent(data, len);
	else if ((by3 == 0x01) && (by11 == 0x0E)) pairStatusReq();
	else if ((by3 == 0x01) && (by11 == 0x01)) peerAddEvent(data, len);
	else if  (by3 >= 0x3E)                    peerMsgEvent(by3, data, len);
	else return;
}
示例#3
0
void Relay::hmEventCol(uint8_t by3, uint8_t by10, uint8_t by11, uint8_t *data, uint8_t len) {
	if  (by3 == 0x00)                    poll();
	if ((by3 == 0x01) && (by11 == 0x06)) configCngEvent();
	if ((by3 == 0x11) && (by10 == 0x02)) pairSetEvent(data, len);
	if ((by3 == 0x01) && (by11 == 0x0E)) pairStatusReq();
	if ((by3 == 0x01) && (by11 == 0x01)) peerAddEvent(data, len);
	if  (by3 >= 0x3E)                    peerMsgEvent(by3, data, len);

	if ((by3 == 0x11) && (by10 == 0x02)) trigger11(data[0], &data[1], &data[3]);	
	if  (by3 == 0x40)                    trigger40((by10 & 0x40), data[0]);
}