@@ -59,7 +59,7 @@ static void prv_close_client(void) {
5959 if (rv ) {
6060 ESP_LOGW (TAG , "Failed to destroy client[%d]" , rv );
6161 }
62- memfault_metrics_heartbeat_timer_stop ( MEMFAULT_METRICS_KEY ( mqtt_conn_uptime ) );
62+ MEMFAULT_HEARTBEAT_TIMER_STOP ( mqtt_conn_uptime );
6363
6464 s_mqtt_client = NULL ;
6565}
@@ -91,14 +91,14 @@ static int prv_create_client(void) {
9191 rv = xSemaphoreTake (s_mqtt_connected , (1000 * 10 ) / portTICK_PERIOD_MS );
9292 if (rv != pdTRUE ) {
9393 ESP_LOGE (TAG , "MQTT client failed to connect[%d]" , rv );
94- memfault_metrics_heartbeat_timer_start ( MEMFAULT_METRICS_KEY ( mqtt_conn_downtime ) );
94+ MEMFAULT_HEARTBEAT_TIMER_START ( mqtt_conn_downtime );
9595 prv_close_client ();
9696 return -1 ;
9797 }
9898
9999 // Update connection metrics when connected
100- memfault_metrics_heartbeat_timer_stop ( MEMFAULT_METRICS_KEY ( mqtt_conn_downtime ) );
101- memfault_metrics_heartbeat_timer_start ( MEMFAULT_METRICS_KEY ( mqtt_conn_uptime ) );
100+ MEMFAULT_HEARTBEAT_TIMER_STOP ( mqtt_conn_downtime );
101+ MEMFAULT_HEARTBEAT_TIMER_START ( mqtt_conn_uptime );
102102
103103 // Set topic alias before publishing
104104 rv = esp_mqtt5_client_set_publish_property (s_mqtt_client , & s_publish_property );
@@ -161,8 +161,8 @@ int app_memfault_transport_send_chunks(void) {
161161 break ;
162162 }
163163
164- memfault_metrics_heartbeat_add ( MEMFAULT_METRICS_KEY ( mqtt_publish_bytes ) , chunk_size );
165- memfault_metrics_heartbeat_add ( MEMFAULT_METRICS_KEY ( mqtt_publish_count ) , 1 );
164+ MEMFAULT_HEARTBEAT_ADD ( mqtt_publish_bytes , chunk_size );
165+ MEMFAULT_HEARTBEAT_ADD ( mqtt_publish_count , 1 );
166166 ESP_LOGD (TAG , "chunk[%d], len[%zu] published to %s" , rv , chunk_size , s_topic_string );
167167 }
168168
0 commit comments