LWM2M: replace space with dash in endpoint name

This commit is contained in:
Joakim Eriksson 2017-10-26 16:45:57 +02:00 committed by Niclas Finne
parent e7edd147a9
commit 725e426c61

View File

@ -511,8 +511,14 @@ lwm2m_engine_init(void)
if(len > sizeof(endpoint) - 13) {
len = sizeof(endpoint) - 13;
}
memcpy(endpoint, LWM2M_ENGINE_CLIENT_ENDPOINT_PREFIX, len);
for(i = 0; i < len; i++) {
if(LWM2M_ENGINE_CLIENT_ENDPOINT_PREFIX[i] == ' ') {
endpoint[i] = '-';
} else {
endpoint[i] = LWM2M_ENGINE_CLIENT_ENDPOINT_PREFIX[i];
}
}
/* pick an IP address that is PREFERRED or TENTATIVE */
ipaddr = NULL;
for(i = 0; i < UIP_DS6_ADDR_NB; i++) {