AP_Beacon: Changed if statements to switch statement.

This commit is contained in:
murata 2016-12-31 19:35:56 +09:00 committed by Randy Mackay
parent bad1c879d9
commit dd0d09175b

View File

@ -68,13 +68,16 @@ void AP_Beacon_Pozyx::update(void)
case ParseState_WaitingForMsgId:
parse_msg_id = c;
if (parse_msg_id == AP_BEACON_POZYX_MSGID_BEACON_CONFIG ||
parse_msg_id == AP_BEACON_POZYX_MSGID_BEACON_DIST ||
parse_msg_id == AP_BEACON_POZYX_MSGID_POSITION) {
switch (parse_msg_id) {
case AP_BEACON_POZYX_MSGID_BEACON_CONFIG:
case AP_BEACON_POZYX_MSGID_BEACON_DIST:
case AP_BEACON_POZYX_MSGID_POSITION:
parse_state = ParseState_WaitingForLen;
} else {
break;
default:
// invalid message id
parse_state = ParseState_WaitingForHeader;
break;
}
break;