Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
As found by SonarCloud.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
  • Loading branch information
rettichschnidi committed Apr 14, 2021
1 parent 32a6b93 commit c778bba
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 17 deletions.
1 change: 0 additions & 1 deletion coap/er-coap-13/er-coap-13.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,6 @@ coap_parse_message(void *packet, uint8_t *data, uint16_t data_len)
PRINTF("Proxy-Uri NOT IMPLEMENTED [%.*s]\n", coap_pkt->proxy_uri_len, coap_pkt->proxy_uri);
coap_error_message = "This is a constrained server (Contiki)";
return PROXYING_NOT_SUPPORTED_5_05;
break;

case COAP_OPTION_OBSERVE:
coap_pkt->observe = coap_parse_int_option(current_option, option_length);
Expand Down
3 changes: 0 additions & 3 deletions core/liblwm2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ int lwm2m_step(lwm2m_context_t * contextP,
contextP->state = STATE_BOOTSTRAP_REQUIRED;
}
goto next_step;
break;

case STATE_BOOTSTRAP_REQUIRED:
#ifdef LWM2M_BOOTSTRAP
Expand All @@ -425,7 +424,6 @@ int lwm2m_step(lwm2m_context_t * contextP,
case STATE_BS_FINISHED:
contextP->state = STATE_INITIAL;
goto next_step;
break;

case STATE_BS_FAILED:
return COAP_503_SERVICE_UNAVAILABLE;
Expand Down Expand Up @@ -457,7 +455,6 @@ int lwm2m_step(lwm2m_context_t * contextP,
// TODO avoid infinite loop by checking the bootstrap info is different
contextP->state = STATE_BOOTSTRAP_REQUIRED;
goto next_step;
break;

case STATE_REG_PENDING:
default:
Expand Down
5 changes: 1 addition & 4 deletions examples/client/object_access_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,10 @@ static uint8_t prv_set_tlv(lwm2m_data_t* dataP, acc_ctrl_oi_t* accCtrlOiP)
if (dataP->type == LWM2M_TYPE_MULTIPLE_RESOURCE) return COAP_404_NOT_FOUND;
lwm2m_data_encode_int(accCtrlOiP->objectId, dataP);
return COAP_205_CONTENT;
break;
case RES_M_OBJECT_INSTANCE_ID:
if (dataP->type == LWM2M_TYPE_MULTIPLE_RESOURCE) return COAP_404_NOT_FOUND;
lwm2m_data_encode_int(accCtrlOiP->objectInstId, dataP);
return COAP_205_CONTENT;
break;
case RES_O_ACL:
{
size_t count;
Expand Down Expand Up @@ -128,12 +126,11 @@ static uint8_t prv_set_tlv(lwm2m_data_t* dataP, acc_ctrl_oi_t* accCtrlOiP)
}
return COAP_205_CONTENT;
}
} break;
}
case RES_M_ACCESS_CONTROL_OWNER:
if (dataP->type == LWM2M_TYPE_MULTIPLE_RESOURCE) return COAP_404_NOT_FOUND;
lwm2m_data_encode_int(accCtrlOiP->accCtrlOwner, dataP);
return COAP_205_CONTENT;
break;
default:
return COAP_404_NOT_FOUND ;
}
Expand Down
3 changes: 0 additions & 3 deletions examples/client/object_connectivity_moni.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ static uint8_t prv_set_value(lwm2m_data_t * dataP,
}
return COAP_205_CONTENT ;
}
break;

case RES_O_ROUTER_IP_ADDRESS:
{
Expand Down Expand Up @@ -197,7 +196,6 @@ static uint8_t prv_set_value(lwm2m_data_t * dataP,
}
return COAP_205_CONTENT ;
}
break;

case RES_O_LINK_UTILIZATION:
if (dataP->type == LWM2M_TYPE_MULTIPLE_RESOURCE) return COAP_404_NOT_FOUND;
Expand Down Expand Up @@ -232,7 +230,6 @@ static uint8_t prv_set_value(lwm2m_data_t * dataP,
}
return COAP_205_CONTENT;
}
break;

case RES_O_CELL_ID:
if (dataP->type == LWM2M_TYPE_MULTIPLE_RESOURCE) return COAP_404_NOT_FOUND;
Expand Down
6 changes: 0 additions & 6 deletions examples/client/object_connectivity_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,27 +65,21 @@ static uint8_t prv_set_tlv(lwm2m_data_t * dataP, conn_s_data_t * connStDataP)
case RES_O_SMS_TX_COUNTER:
lwm2m_data_encode_int(connStDataP->smsTxCounter, dataP);
return COAP_205_CONTENT;
break;
case RES_O_SMS_RX_COUNTER:
lwm2m_data_encode_int(connStDataP->smsRxCounter, dataP);
return COAP_205_CONTENT;
break;
case RES_O_TX_DATA:
lwm2m_data_encode_int(connStDataP->txDataByte/1024, dataP);
return COAP_205_CONTENT;
break;
case RES_O_RX_DATA:
lwm2m_data_encode_int(connStDataP->rxDataByte/1024, dataP);
return COAP_205_CONTENT;
break;
case RES_O_MAX_MESSAGE_SIZE:
lwm2m_data_encode_int(connStDataP->maxMessageSize, dataP);
return COAP_205_CONTENT;
break;
case RES_O_AVERAGE_MESSAGE_SIZE:
lwm2m_data_encode_int(connStDataP->avrMessageSize, dataP);
return COAP_205_CONTENT;
break;
default:
return COAP_404_NOT_FOUND ;
}
Expand Down

0 comments on commit c778bba

Please sign in to comment.