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:
A.M. Rowsell 2019-02-27 02:28:00 -05:00
commit 8acff6e880
Signed by: amr
GPG key ID: 0B6E2D8375CF79A9
4 changed files with 32 additions and 21 deletions

6
mqtt.h
View file

@ -20,13 +20,13 @@
#include "espconn.h"
#include "os_type.h"
#define DEBUG 1 /**< This define enables or disables serial debug output in most places */
//#define DEBUG 1 /**< This define enables or disables serial debug output in most places */
/**
* @typedef
* This is the enum for message types.
*
* This enum was taken from the NodeMCU mqtt headers. Credit is given to "zeroday" of nodemcu.com. This enum gives us both easily readable names for each message type, but also the correct value for each type. These are used in mqtt_send() to construct the correct packet type.
* This enum was taken from the NodeMCU mqtt headers. Credit is given to "zeroday" of nodemcu.com. This enum gives us both easily readable names for each message type, but also the correct value for each type. These are used in mqttSend() to construct the correct packet type.
*/
typedef enum mqtt_message_enum
{
@ -138,4 +138,4 @@ uint8_t ICACHE_FLASH_ATTR *encodeLength(uint32_t trueLength);
* @param msgType the type of message to be send, one of the mqtt_message_type
* @return -1 in case of error, 0 otherwise
*/
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);