forked from espressif/esp-mqtt
Add const in funtions arguments
Added const to fce mqtt_subscribe and mqtt_publish
This commit is contained in:
4
include/mqtt.h
Executable file → Normal file
4
include/mqtt.h
Executable file → Normal file
@@ -92,7 +92,7 @@ typedef struct {
|
||||
mqtt_client *mqtt_start(mqtt_settings *mqtt_info);
|
||||
void mqtt_stop();
|
||||
void mqtt_task(void *pvParameters);
|
||||
void mqtt_subscribe(mqtt_client *client, char *topic, uint8_t qos);
|
||||
void mqtt_publish(mqtt_client* client, char *topic, char *data, int len, int qos, int retain);
|
||||
void mqtt_subscribe(mqtt_client *client, const char *topic, uint8_t qos);
|
||||
void mqtt_publish(mqtt_client* client, const char *topic, const char *data, int len, int qos, int retain);
|
||||
void mqtt_detroy();
|
||||
#endif
|
||||
|
4
mqtt.c
Executable file → Normal file
4
mqtt.c
Executable file → Normal file
@@ -509,7 +509,7 @@ mqtt_client *mqtt_start(mqtt_settings *settings)
|
||||
return client;
|
||||
}
|
||||
|
||||
void mqtt_subscribe(mqtt_client *client, char *topic, uint8_t qos)
|
||||
void mqtt_subscribe(mqtt_client *client, const char *topic, uint8_t qos)
|
||||
{
|
||||
client->mqtt_state.outbound_message = mqtt_msg_subscribe(&client->mqtt_state.mqtt_connection,
|
||||
topic, qos,
|
||||
@@ -518,7 +518,7 @@ void mqtt_subscribe(mqtt_client *client, char *topic, uint8_t qos)
|
||||
mqtt_queue(client);
|
||||
}
|
||||
|
||||
void mqtt_publish(mqtt_client* client, char *topic, char *data, int len, int qos, int retain)
|
||||
void mqtt_publish(mqtt_client* client, const char *topic, const char *data, int len, int qos, int retain)
|
||||
{
|
||||
|
||||
client->mqtt_state.outbound_message = mqtt_msg_publish(&client->mqtt_state.mqtt_connection,
|
||||
|
Reference in New Issue
Block a user