Removed the incomplete feature in LWM2M RD client to "guess" a LWM2M
server if none has been specified. This does not belong in the LWM2M RD client and does not work well with multiple server support.
This commit is contained in:
parent
962aa01d30
commit
82b7b74165
|
@ -300,31 +300,6 @@ lwm2m_rd_client_register_with_server(lwm2m_session_info_t *session_info,
|
|||
list_add(session_info_list, session_info); /* Add to the list of sessions */
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
update_registration_server(lwm2m_session_info_t *session_info)
|
||||
{
|
||||
if(session_info->has_registration_server_info) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if UIP_CONF_IPV6_RPL
|
||||
{
|
||||
rpl_dag_t *dag;
|
||||
|
||||
/* Use the DAG id as server address if no other has been specified */
|
||||
dag = rpl_get_any_dag();
|
||||
if(dag != NULL) {
|
||||
/* create coap-endpoint? */
|
||||
/* uip_ipaddr_copy(&server_ipaddr, &dag->dag_id); */
|
||||
/* server_port = REMOTE_PORT; */
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#endif /* UIP_CONF_IPV6_RPL */
|
||||
|
||||
return 0;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
lwm2m_rd_client_deregister(lwm2m_session_info_t *session_info)
|
||||
{
|
||||
|
@ -359,31 +334,6 @@ lwm2m_rd_client_update_triggered(const coap_endpoint_t *server_ep)
|
|||
/* Here we need to do an CoAP timer poll - to get a quick request transmission! */
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
update_bootstrap_server(lwm2m_session_info_t *session_info)
|
||||
{
|
||||
if(session_info->has_bs_server_info) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if UIP_CONF_IPV6_RPL
|
||||
{
|
||||
rpl_dag_t *dag;
|
||||
|
||||
/* Use the DAG id as server address if no other has been specified */
|
||||
dag = rpl_get_any_dag();
|
||||
if(dag != NULL) {
|
||||
/* create coap endpoint */
|
||||
/* uip_ipaddr_copy(&bs_server_ipaddr, &dag->dag_id); */
|
||||
/* bs_server_port = REMOTE_PORT; */
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#endif /* UIP_CONF_IPV6_RPL */
|
||||
|
||||
return 0;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* A client initiated bootstrap starts with a POST to /bs?ep={session_info.ep},
|
||||
* on the bootstrap server. The server should reply with 2.04.
|
||||
|
@ -676,8 +626,8 @@ periodic_process(coap_timer_t *timer)
|
|||
break;
|
||||
case DO_BOOTSTRAP:
|
||||
if(session_info->use_server_type == LWM2M_RD_CLIENT_BOOTSTRAP_SERVER &&
|
||||
session_info->bootstrapped == 0) {
|
||||
if(update_bootstrap_server(session_info)) {
|
||||
session_info->bootstrapped == 0 &&
|
||||
session_info->has_bs_server_info) {
|
||||
|
||||
/* prepare request, TID is set by COAP_BLOCKING_REQUEST() */
|
||||
coap_init_message(session_info->request, COAP_TYPE_CON, COAP_POST, 0);
|
||||
|
@ -695,7 +645,6 @@ periodic_process(coap_timer_t *timer)
|
|||
session_info->rd_state = BOOTSTRAP_SENT;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case BOOTSTRAP_SENT:
|
||||
/* Just wait for bootstrap to be done... */
|
||||
|
@ -770,7 +719,7 @@ periodic_process(coap_timer_t *timer)
|
|||
|
||||
if(session_info->use_server_type == LWM2M_RD_CLIENT_LWM2M_SERVER &&
|
||||
!lwm2m_rd_client_is_registered(session_info) &&
|
||||
update_registration_server(session_info)) {
|
||||
session_info->has_registration_server_info) {
|
||||
int len;
|
||||
|
||||
/* prepare request, TID was set by COAP_BLOCKING_REQUEST() */
|
||||
|
|
Loading…
Reference in New Issue