Skip to content

Commit be0d995

Browse files
committed
Add getReceivedRawdataList() method
1 parent 044ecf3 commit be0d995

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

RCSwitch.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,17 @@ unsigned int* RCSwitch::getReceivedRawdata() {
521521
return RCSwitch::timings;
522522
}
523523

524+
pulse_list_t RCSwitch::getReceivedRawdataList() {
525+
526+
if (!this->available()) return pulse_list_t();
527+
528+
pulse_list_t pulse_list = pulse_list_t(RCSwitch::timings+1, RCSwitch::timings+((RCSwitch::nReceivedBitlength+1)*2));
529+
530+
pulse_list.push_back(*RCSwitch::timings);
531+
532+
return pulse_list;
533+
}
534+
524535
/* helper function for the receiveProtocol method */
525536
static inline unsigned int diff(int A, int B) {
526537
return abs(A - B);

RCSwitch.h

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class RCSwitch {
7474
unsigned int getReceivedDelay();
7575
unsigned int getReceivedProtocol();
7676
unsigned int* getReceivedRawdata();
77+
pulse_list_t getReceivedRawdataList();
7778

7879
void setPulseLength(uint16_t nPulseLength);
7980
void setRepeatTransmit(int nRepeatTransmit);

0 commit comments

Comments
 (0)