Avoid routing table update if nothing changed.
Switch screen on/off always trigger tech route and protocol route update.
This will rewrite entire routing table even if there is no change at all.
Change-Id: I8d7e1cb0dff5b81a48f21eb2fa9e38c4839811b7
diff --git a/src/nfa/ee/nfa_ee_act.c b/src/nfa/ee/nfa_ee_act.c
index b7561b4..bce6ffb 100644
--- a/src/nfa/ee/nfa_ee_act.c
+++ b/src/nfa/ee/nfa_ee_act.c
@@ -537,6 +537,16 @@
tNFA_TECHNOLOGY_MASK old_tech_battery_off = p_cb->tech_battery_off;
UINT8 old_size_mask = p_cb->size_mask;
+ if ( (p_cb->tech_switch_on == p_data->set_tech.technologies_switch_on)
+ && (p_cb->tech_switch_off == p_data->set_tech.technologies_switch_off)
+ && (p_cb->tech_battery_off == p_data->set_tech.technologies_battery_off))
+ {
+ /* nothing to change */
+ evt_data.status = NFA_STATUS_OK;
+ nfa_ee_report_event (p_cb->p_ee_cback, NFA_EE_SET_TECH_CFG_EVT, &evt_data);
+ return;
+ }
+
p_cb->tech_switch_on = p_data->set_tech.technologies_switch_on;
p_cb->tech_switch_off = p_data->set_tech.technologies_switch_off;
p_cb->tech_battery_off = p_data->set_tech.technologies_battery_off;
@@ -583,6 +593,16 @@
tNFA_PROTOCOL_MASK old_proto_battery_off = p_cb->proto_battery_off;
UINT8 old_size_mask = p_cb->size_mask;
+ if ( (p_cb->proto_switch_on == p_data->set_proto.protocols_switch_on)
+ && (p_cb->proto_switch_off == p_data->set_proto.protocols_switch_off)
+ && (p_cb->proto_battery_off == p_data->set_proto.protocols_battery_off) )
+ {
+ /* nothing to change */
+ evt_data.status = NFA_STATUS_OK;
+ nfa_ee_report_event (p_cb->p_ee_cback, NFA_EE_SET_PROTO_CFG_EVT, &evt_data);
+ return;
+ }
+
p_cb->proto_switch_on = p_data->set_proto.protocols_switch_on;
p_cb->proto_switch_off = p_data->set_proto.protocols_switch_off;
p_cb->proto_battery_off = p_data->set_proto.protocols_battery_off;