cleanup: removed dead code, fixed small issues

This commit is contained in:
A.M. Rowsell 2026-06-24 11:20:16 -04:00
commit 06626f3349
4 changed files with 5 additions and 37 deletions

32
mqtt.c
View file

@ -122,36 +122,4 @@ err_t ensaht_mqtt_publish_client(ensaht_mqtt_t *mqtt, const char *topic,
return err;
}
err_t ensaht_mqtt_pingreq(mqtt_client_t *client) {
static const u8_t pingreq[] = {0xC0, 0x00};
err_t err;
LWIP_ASSERT_CORE_LOCKED();
if (client == NULL || client->conn == NULL ||
!mqtt_client_is_connected(client)) {
return ERR_CONN;
}
err =
altcp_write(client->conn, pingreq, sizeof(pingreq), TCP_WRITE_FLAG_COPY);
if (err == ERR_OK) {
client->cyclic_tick = 0;
err = altcp_output(client->conn);
}
return err;
}
err_t ensaht_mqtt_pingreq_client(ensaht_mqtt_t *mqtt) {
err_t err;
if (mqtt == NULL || mqtt->client == NULL) {
return ERR_CONN;
}
cyw43_arch_lwip_begin();
err = ensaht_mqtt_pingreq(mqtt->client);
cyw43_arch_lwip_end();
return err;
}