emulator: Implement new API
authorDenis Kenzior <denkenz@gmail.com>
Sat, 1 Feb 2014 15:04:52 +0000 (09:04 -0600)
committerDenis Kenzior <denkenz@gmail.com>
Mon, 20 Oct 2014 18:40:28 +0000 (13:40 -0500)
src/emulator.c

index 725a5d0181eced344edb20b848839df6cdfa3e1c..cab509c91154b2156d655ea5f203f16f8ee17450 100644 (file)
@@ -1431,3 +1431,22 @@ void __ofono_emulator_slc_condition(struct ofono_emulator *em,
                break;
        }
 }
+
+void ofono_emulator_set_hf_indicator_active(struct ofono_emulator *em,
+                                               int indicator,
+                                               ofono_bool_t active)
+{
+       char buf[64];
+
+       if (!(em->l_features & HFP_HF_FEATURE_HF_INDICATORS))
+               return;
+
+       if (!(em->r_features & HFP_HF_FEATURE_HF_INDICATORS))
+               return;
+
+       if (indicator != HFP_HF_INDICATOR_ENHANCED_SAFETY)
+               return;
+
+       sprintf(buf, "+BIND: %d,%d", HFP_HF_INDICATOR_ENHANCED_SAFETY, active);
+       g_at_server_send_unsolicited(em->server, buf);
+}