15 lines
510 B
C
15 lines
510 B
C
#include <mbed.h>
|
|
#include "MQTTClient.h"
|
|
#include "MQTTEthernet.h"
|
|
|
|
|
|
// Configuration values needed to connect to IBM IoT Cloud
|
|
#define HOSTNAME "10.0.2.15"
|
|
#define MQTT_MAX_PACKET_SIZE 250
|
|
#define MQTT_MAX_PAYLOAD_SIZE 300
|
|
#define MQTT_PORT 1883
|
|
|
|
void attemptConnect(MQTT::Client<MQTTEthernet, Countdown, MQTT_MAX_PACKET_SIZE>* client, MQTTEthernet* ipstack);
|
|
int publish(MQTT::Client<MQTTEthernet, Countdown, MQTT_MAX_PACKET_SIZE>* client, MQTTEthernet* ipstack, char* topic, char* msg);
|
|
|