StephenBlackWasAlreadyTaken / xDrip-Experimental

Experimental Branches for Collaboration on DexDrip
GNU General Public License v3.0
25 stars 62 forks source link

Make the Handling of TransmitterData more consistent with rest of the… #316

Closed tzachi-dar closed 8 years ago

tzachi-dar commented 8 years ago

… code.

This is basicly code refactoring with no side effects.

One thing that has changed, is that keepAlive() will now be called even if the packet is duplicate. I believe that this is better this way. If this is not the case then the function processNewTransmitterData should return bool telling if this is a duplicate packet.

Not tested for obvious reasons....

AdrianLxM commented 8 years ago

Deduping is now done at another place or is there no deduping at all?

So basically the change is: Waking up to keep the device alive for 20 seconds now happens about 5 minutes after the last package of a number of duplicates arrives instead of about 5 minutes after the first package?

I think @urmc-costik (or @hackingtype1 ?) should decide if that makes sense.

tzachi-dar commented 8 years ago

Deduping now happens inside TransmitterData.create(). It also checks more things there. Also, even on the first time that we wake up, we know what was the last packet.

The real question is weather, keepAlive() logic depends on the fact that this is a duplicate packet or not.

hackingtype1 commented 8 years ago

Let me test it out tonight; if deduping is working - I'll verify the keep alive is still triggered appropriately

tzachi-dar commented 8 years ago

OK, let us know how it is going.

AdrianLxM commented 8 years ago

I'm closing this as it is already in https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental/pull/317