mqtt: Allow setting server port to connect

This is a mqtt client, so it does not make sense to determinate the server port
at compile time. Update mqtt_client_connect() function to allow setting server
port.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
Axel Lin
2016-12-23 08:52:28 +08:00
committed by Dirk Ziegelmeier
parent 2e4b368c8c
commit bfa0358a52
3 changed files with 5 additions and 11 deletions

View File

@@ -204,7 +204,7 @@ struct mqtt_client_t
/** Connect to server */
err_t mqtt_client_connect(mqtt_client_t *client, const ip_addr_t *ipaddr, mqtt_connection_cb_t cb, void *arg,
err_t mqtt_client_connect(mqtt_client_t *client, const ip_addr_t *ipaddr, u16_t port, mqtt_connection_cb_t cb, void *arg,
const struct mqtt_connect_client_info_t *client_info);
/** Disconnect from server */

View File

@@ -71,13 +71,6 @@ extern "C" {
#define MQTT_REQ_MAX_IN_FLIGHT 4
#endif
/**
* MQTT server port to connect to
*/
#ifndef MQTT_PORT
#define MQTT_PORT 1883
#endif
/**
* Seconds between each cyclic timer call.
*/