Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Digoo DG-HOSA PIR sensor support and modified protocol definition for Digoo DG-R8H for advanced sniffing mode #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 49 additions & 1 deletion inc/RF_Protocols.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,28 @@ SI_SEGMENT_VARIABLE(PROTOCOL_BIT0(DG_HOSA)[], static uint8_t, SI_SEG_CODE) = { H
SI_SEGMENT_VARIABLE(PROTOCOL_BIT1(DG_HOSA)[], static uint8_t, SI_SEG_CODE) = { HIGH(1), LOW(0) };
#endif

/*
* Digoo DG-HOSA PIR DETECTOR
*/
#if EFM8BB1_SUPPORT_DG_HOSA_PIR_PROTOCOL == 1
#define DG_HOSA_PIR
SI_SEGMENT_VARIABLE(PROTOCOL_BUCKETS(DG_HOSA_PIR)[], static uint16_t, SI_SEG_CODE) = { 420, 1220, 12400 };
SI_SEGMENT_VARIABLE(PROTOCOL_START(DG_HOSA_PIR)[], static uint8_t, SI_SEG_CODE) = { HIGH(0), LOW(2) };
SI_SEGMENT_VARIABLE(PROTOCOL_BIT0(DG_HOSA_PIR)[], static uint8_t, SI_SEG_CODE) = { HIGH(0), LOW(1) };
SI_SEGMENT_VARIABLE(PROTOCOL_BIT1(DG_HOSA_PIR)[], static uint8_t, SI_SEG_CODE) = { HIGH(1), LOW(0) };
#endif

/*
* Digoo DG-R8H Outdoor Humidity Sensor, Issue #119
*/
#if EFM8BB1_SUPPORT_DG_R8H_PROTOCOL == 1
#define DG_R8H
SI_SEGMENT_VARIABLE(PROTOCOL_BUCKETS(DG_R8H)[], static uint16_t, SI_SEG_CODE) = { 500, 1000, 2000, 4000 };
SI_SEGMENT_VARIABLE(PROTOCOL_START(DG_R8H)[], static uint8_t, SI_SEG_CODE) = { LOW(3), HIGH(0) };
SI_SEGMENT_VARIABLE(PROTOCOL_BIT0(DG_R8H)[], static uint8_t, SI_SEG_CODE) = { LOW(1), HIGH(0) };
SI_SEGMENT_VARIABLE(PROTOCOL_BIT1(DG_R8H)[], static uint8_t, SI_SEG_CODE) = { LOW(2), HIGH(0) };
#endif

/*
* KaKu wall sockets
*/
Expand Down Expand Up @@ -488,6 +510,32 @@ SI_SEGMENT_VARIABLE(PROTOCOL_DATA[], static struct BUCKET_PROTOCOL_DATA, SI_SEG_
24
},
#endif
#if EFM8BB1_SUPPORT_DG_HOSA_PIR_PROTOCOL == 1
/*
* Digoo DG-HOSA PIR DETECTOR
*/
{
{ &PROTOCOL_BUCKETS(DG_HOSA_PIR), ARRAY_LENGTH(PROTOCOL_BUCKETS(DG_HOSA_PIR)) },
{ &PROTOCOL_START(DG_HOSA_PIR), ARRAY_LENGTH(PROTOCOL_START(DG_HOSA_PIR)) },
{ &PROTOCOL_BIT0(DG_HOSA_PIR), ARRAY_LENGTH(PROTOCOL_BIT0(DG_HOSA_PIR)) },
{ &PROTOCOL_BIT1(DG_HOSA_PIR), ARRAY_LENGTH(PROTOCOL_BIT1(DG_HOSA_PIR)) },
{ NULL, 0 },
24
},
#endif
#if EFM8BB1_SUPPORT_DG_R8H_PROTOCOL == 1
/*
* Digoo DG-R8H Outdoor Humidity Sensor, Issue #119
*/
{
{ &PROTOCOL_BUCKETS(DG_R8H), ARRAY_LENGTH(PROTOCOL_BUCKETS(DG_R8H)) },
{ &PROTOCOL_START(DG_R8H), ARRAY_LENGTH(PROTOCOL_START(DG_R8H)) },
{ &PROTOCOL_BIT0(DG_R8H), ARRAY_LENGTH(PROTOCOL_BIT0(DG_R8H)) },
{ &PROTOCOL_BIT1(DG_R8H), ARRAY_LENGTH(PROTOCOL_BIT1(DG_R8H)) },
{ NULL, 0 },
36
},
#endif
#if EFM8BB1_SUPPORT_Kaku_PROTOCOL == 1
/*
* KaKu wall sockets
Expand Down Expand Up @@ -595,4 +643,4 @@ SI_SEGMENT_VARIABLE(PROTOCOL_DATA[], static struct BUCKET_PROTOCOL_DATA, SI_SEG_
};

#define PROTOCOLCOUNT (sizeof(PROTOCOL_DATA) / sizeof(PROTOCOL_DATA[0]))
#endif /* INC_RF_PROTOCOLS_H_ */
#endif /* INC_RF_PROTOCOLS_H_ */