support compile without lwm2m_bootstrap
@@ -174,8 +174,12 @@ int connection_connect_dtls(connection_t *connP, security_instance_t *targetP, c
memset(&info, 0, sizeof(info));
info.client_or_server = client_or_server;
info.finish_notify = NULL;
+ info.step_notify = NULL;
+#ifdef LWM2M_BOOTSTRAP
info.step_notify = (void(*)(void *))lwm2m_step_striger_server_initiated_bs;
info.param = (void(*)(void *))connP;
+#endif
+
if (MBEDTLS_SSL_IS_CLIENT == client_or_server)
{
info.u.c.host = host;
@@ -183,13 +187,17 @@ int connection_connect_dtls(connection_t *connP, security_instance_t *targetP, c
}
else
{
+#ifdef LWM2M_BOOTSTRAP
info.u.s.timeout = targetP->clientHoldOffTime;
info.u.s.local_port = port;
timer_init(&connP->server_triger_timer, LWM2M_TRIGER_SERVER_MODE_INITIATED_TIME, (void(*)(void*))connection_striger_server_initiated_bs, connP);
timer_start(&connP->server_triger_timer);
+#endif
}
ret = dtls_shakehand(connP->net_context, &info);
+#ifdef LWM2M_BOOTSTRAP
timer_stop(&connP->server_triger_timer);
+#endif
if (ret != 0)
{
ATINY_LOG(LOG_INFO, "ret is %d in connection_create", ret);
