Skip to content

Commit 36463cf

Browse files
committed
fix two bugs about publish
1 parent 962f3c3 commit 36463cf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mqtt_sdk/mqtt/mqtt.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extern "C" {
1111
#include "config.h"
1212
#include "mqtt_buffer.h"
1313

14-
#define MQTTSAVEDPTOPICNAME "Sdp"
14+
#define MQTTSAVEDPTOPICNAME "$dp"
1515

1616
/** MQTT错误码 */
1717
enum MqttError {
@@ -566,4 +566,4 @@ int Mqtt_AppendFloatDP(char *data, size_t *len, int16_t dsid, float *datapoint,
566566
} // extern "C"
567567
#endif // __cplusplus
568568

569-
#endif // ONENET_MQTT_H
569+
#endif // ONENET_MQTT_H

mqtt_sdk/src/mqtt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2045,7 +2045,7 @@ int Mqtt_PackDataPointByString(struct MqttBuffer *buf, uint16_t pkt_id, int64_t
20452045
char payload[payload_size];
20462046

20472047
//填充payload
2048-
payload[0] = kTypeString & 0xFF;
2048+
payload[0] = type & 0xFF;
20492049
payload[1] = (size>>8)&0xFF;
20502050
payload[2] = size&0xFF;
20512051
memcpy(payload+3, str, size);

0 commit comments

Comments
 (0)