I shamelessly copied and heavily rewrote your code.
Mainly cause I had a new hamptonbay fan (dawnsun remote) and fanimation fans. They are not clean in their rf protocol like your hamptonbay is that transmits the complete state each transmission.
I modified the code mostly so I could actually control all the fans at the same time. The frequencies are close enough, and the cc1101 doesn't have enough frontend filters that tuning to an exact freq isn't needed and it can receive codes even being way off. I do switch it to the correct freq on transmit. I had to add the rc-switch protocols for these fans as they where not detected.
I shamelessly copied and heavily rewrote your code. Mainly cause I had a new hamptonbay fan (dawnsun remote) and fanimation fans. They are not clean in their rf protocol like your hamptonbay is that transmits the complete state each transmission.
I modified the code mostly so I could actually control all the fans at the same time. The frequencies are close enough, and the cc1101 doesn't have enough frontend filters that tuning to an exact freq isn't needed and it can receive codes even being way off. I do switch it to the correct freq on transmit. I had to add the rc-switch protocols for these fans as they where not detected.