This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF51: Extending the IoT-MQTT example

Hello,

I need a little help regarding IoT-SDK 0.8.0 on nRF51. In the MQTT-Example connection to the broker is established only when I press the button (callback), but not when I call mqtt_connect() directly with same set of parameters after recognizing IPV6_UP (absuing m_display_state for that, because I still need some time to get familiar with the firmware).

Can anyone help me with this?

if(false == m_connection_state)
{
  if(LEDS_IPV6_IF_UP == m_display_state)
  {
    mqtt_connect_t param;
                
    param.broker_addr    = m_broker_addr;
    param.broker_port    = APP_MQTT_BROKER_PORT;
    param.evt_cb         = app_mqtt_evt_handler;
    param.device_id      = m_device_id;
    param.p_password     = NULL;
    param.p_user_name    = NULL;

    UNUSED_VARIABLE(mqtt_connect(&m_app_mqtt_id, &param));
  }
}

Thank you very much in advance!

Regards

Parents Reply Children
No Data
Related