static bool ATGPS_cb(void *cb_arg, bool ok, struct mg_str data) {
if (!ok) {
return false;
}
// Want to see the value of nSomeNum here
// you passed nSomeNum to the callback as cb_arg
// assuming nSomeNum is a pointer to int
int *nSomeNum=(int*)cb_arg;
printf("nSomeNum=%d\n", *nSomeNum);
return true;
}
It looks like the cb_arg set in {.cmd = "AT$GPSACP", .cb = ATGPS_cb, .cb_arg=(nSomeNum)} is used only if it is set in the last line of struct mgos_pppos_cmd ATCmd[].
Otherwise cb_arg is a pointer to an internal struct mgos_pppos_data structure and the first member is int if_instance which is 0.
You can add some logging in getGPS and ATGPS_cb and compare the displayed values.
In getGPS:
LOG(LL_INFO, ("nSomeNum: %p", nSomeNum));
In ATGPS_cb:
LOG(LL_INFO, ("cb_arg: %p", cb_arg));
My guess is that cb_arg was not intended to be used with mgos_pppos_run_cmds.