Why do you think that the global variable is “uncool”
It is the classic way to pass information between the “main” loop and an interrupt handler in microcontroller systems…
Instead of making the variable global, you could provide “getter” and “setter” functions, if you prefer…
Specifically for sending an additional parameter to an AT Command’s Response Handler, there is an API function which provides an additional “context” parameter…
Uncool … well I come from using micros with memory constraints, so for efficiency of memory use better to use locals? 2 bytes Irrelevant here really I guess!
What is the API function for passing additional information? Thanks