Updated to v0.3.1
Renamed mqtt_send to mqttSend to better follow my usual naming convention. Made a few other small changes, including disabling the debug macro by default. Just uncomment to add it again. This is the version that will be used with the first release of Part 3 of the SDK tutorials on hackaday.io. Signed-off-by: A.M. Rowsell <amrowsell@frozenelectronics.ca>
This commit is contained in:
parent
049573ad4b
commit
8acff6e880
4 changed files with 32 additions and 21 deletions
9
mqtt.c
9
mqtt.c
|
@ -89,7 +89,10 @@ void ftoa(float n, char *res, int afterpoint)
|
|||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR data_sent_callback(void *arg) {
|
||||
#ifdef DEBUG
|
||||
os_printf("Data sent!\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR data_recv_callback(void *arg, char *pdata, unsigned short len) {
|
||||
|
@ -266,14 +269,14 @@ uint8_t ICACHE_FLASH_ATTR *encodeLength(uint32_t trueLength) {
|
|||
|
||||
void ICACHE_FLASH_ATTR pingAlive(void *arg) {
|
||||
mqtt_session_t *pSession = (mqtt_session_t *)arg;
|
||||
mqtt_send(pSession, NULL, 0, MQTT_MSG_TYPE_PINGREQ);
|
||||
mqttSend(pSession, NULL, 0, MQTT_MSG_TYPE_PINGREQ);
|
||||
}
|
||||
|
||||
uint8_t ICACHE_FLASH_ATTR mqtt_send(mqtt_session_t *session, uint8_t *data, uint32_t len, mqtt_message_type msgType) {
|
||||
uint8_t ICACHE_FLASH_ATTR mqttSend(mqtt_session_t *session, uint8_t *data, uint32_t len, mqtt_message_type msgType) {
|
||||
if(session->validConnection == 1) {
|
||||
os_timer_disarm(&MQTT_KeepAliveTimer); // disable timer if we are called
|
||||
#ifdef DEBUG
|
||||
os_printf("Entering mqtt_send!\n");
|
||||
os_printf("Entering mqttSend!\n");
|
||||
#endif
|
||||
LOCAL mqtt_packet_t packet;
|
||||
LOCAL mqtt_packet_t *pPacket = &packet;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue