How to count undelived uplink?

I’m using a simple LoRaWAN library, and I want to add a feature to it: counting how many uplinks were not delivered and displaying that value in the console. I think this feature might help me later on when I build a data logger.

My idea is to first check if the ACK (acknowledgment) was not delivered. If I can figure out how to do that, I will store the undelivered data in a buffer. When the next scheduled uplink is successfully delivered, I want to send the stored data in the buffer as well.

Does this make sense? :smiley: