After I found out that the RxEnable primitive works beyond the CAP, I thought it was time for a redesign of the way the receiver “resource” is controlled. Originally my thought was to let the CapControl module handle the CAP period, let the CFP module handle the CFP period and so forth. But with RxEnable “crossing” over these boundaries, it thought it might be better to control the receiver in a dedicated module. So I did a little analysis work to find out, when we can expect to encounter receiver state changes. It looks like this:
CAP:
- When macRxOnWhenIdle is changed
- When the rxOnCount in the CAP module is changed
- When idle in CAP
Other:
- When explicitly requesting to enable/disable receiver (RxEnable, BeaconTracker, CFP)
- When idle in CFP or inactive period
So the conditions for turning on/off the receiver when encountering the above changes looks like this:
Turn on receiver (AND following conditions):
- NOT(Receiving) AND NOT(Transmitting)
- (CapActive AND (rxOnCount OR macRxOnWhenIdle)) OR globalRxEnabled
Turn off receiver (AND following conditions):
- Receiving
- NOT((CapActive AND (rxOnCount OR macRxOnWhenIdle)) OR globalRxEnabled)
All this logic will be put into one RxControl module and will hopefully work as intended