Closed markterrill closed 2 years ago
we have MGOS_EVENT_CLOUD_DISCONNECTED, why is this needed?
Hey Rojer. cloud_disconnected is a different event, MG_EV_CLOSE. MG_EV_CONNECT has a logging call but didn't raise a system event. MG_EV_CONNECT can actually result in a TCP connection error that didn't have a correlating event trigger. However a success would be picked up elsewhere (ie in GCP) as cloud connected.
LOG(LL_INFO, ("MQTT%d TCP connect %s (%d)", c->conn_id,
(status == 0 ? "ok" : "error"), status));
PS, I was actually the one who added cloud_disconnected. During testing I changed the port number of the GCP service so it couldn't connect and it's how I found out about this TCP error logic path.
Can we please get this committed? Having key PR's still hanging is causing us headaches.
I've closed the other PR as this one includes cloud error and cloud connecting. Have added the code note re MQTT.
superseded by #598
This will have a related update in MQTT library, will post the related PR