From 00cedd5e6adc409ca8a0c7efe99e6748b797f1aa Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Tue, 10 Nov 2020 16:06:23 +0100 Subject: [PATCH] fixes --- cube/User/Src/main2.c | 2 +- cube/User/Src/mqttComm.c | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/cube/User/Src/main2.c b/cube/User/Src/main2.c index 19de58a..fdce2f2 100644 --- a/cube/User/Src/main2.c +++ b/cube/User/Src/main2.c @@ -214,7 +214,7 @@ void SYSTICK_Callback() { schUpdate(); // MQTT Interface - MilliTimer_Handler() + MilliTimer_Handler(); } void HAL_GPIO_EXTI_Callback(uint16_t pin) { diff --git a/cube/User/Src/mqttComm.c b/cube/User/Src/mqttComm.c index 2f663f0..937fe7d 100644 --- a/cube/User/Src/mqttComm.c +++ b/cube/User/Src/mqttComm.c @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -31,10 +32,10 @@ struct opts_struct enum QoS qos; char* username; char* password; - char* host; - int port; + uint8_t *host; + uint16_t port; int showtopics; -} opts ={ (char*)"stdout-subscriber", 0, (char*)"\n", QOS0, NULL, NULL, targetIP, targetPort, 0 }; +} opts ={ (char*)"stdout-subscriber", 0, (char*)"\n", QOS0, NULL, NULL, NULL, 0, 0 }; MQTTPacket_connectData data = MQTTPacket_connectData_initializer; @@ -86,14 +87,14 @@ void mqttCommInit(void *handle) { data.cleansession = 1; int rc = MQTTConnect(&mqttClient, &data); - printf("Connected %d\r\n", rc); + logMsg("Connected %d\r\n", rc); - opts.showtopics = 1; +// opts.showtopics = 1; - printf("Subscribing to %s\r\n", "hello/wiznet"); - rc = MQTTSubscribe(&mqttClient, "hello/wiznet", opts.qos, messageArrived); - printf("Subscribed %d\r\n", rc); +// logMsg("Subscribing to %s\r\n", "hello/wiznet"); +// rc = MQTTSubscribe(&mqttClient, "hello/wiznet", opts.qos, messageArrived); +// logMsg("Subscribed %d\r\n", rc); - schAdd(mqttHandler, NULL, 0, 10); +// schAdd(mqttHandler, NULL, 0, 10); } -} \ No newline at end of file +}