Can you please highlight Problem with the following code

In reply to dave_59:

Added tag, apology for not doing it earlier.
My concern about the implementation of tag,as it says tag will be incrementing for each packet from 0 to 127 and then rollover.
However I am not sure how it will be assigned to each packet type which is enum type.
I hope my question makes sense to you.