Add autoconnect deprecation warning to MQTT code

This commit is contained in:
Marcel Stör 2017-04-04 22:52:51 +02:00
parent 66ffa6cdc4
commit b645100d28
1 changed files with 3 additions and 0 deletions

View File

@ -1073,6 +1073,9 @@ static int mqtt_socket_connect( lua_State* L )
if ( (stack<=top) && lua_isnumber(L, stack) ) if ( (stack<=top) && lua_isnumber(L, stack) )
{ {
auto_reconnect = lua_tointeger(L, stack); auto_reconnect = lua_tointeger(L, stack);
if ( auto_reconnect == RECONNECT_POSSIBLE ) {
platform_print_deprecation_note("autoreconnect == 1 is deprecated", "in the next version");
}
stack++; stack++;
if ( auto_reconnect != RECONNECT_OFF && auto_reconnect != RECONNECT_POSSIBLE ){ if ( auto_reconnect != RECONNECT_OFF && auto_reconnect != RECONNECT_POSSIBLE ){
auto_reconnect = RECONNECT_OFF; // default to 0 auto_reconnect = RECONNECT_OFF; // default to 0