static int bt_status_before[BT_MODE_MAX] = { VCONFKEY_BT_STATUS_OFF, };
static int bt_le_status_before[BT_MODE_MAX] = { VCONFKEY_BT_LE_STATUS_OFF, };
+static int __bt_eventsystem_set_value(const char *event, const char *key, const char *value);
+
static void __bt_core_set_status(bt_status_t status)
{
adapter_status = status;
return TRUE;
}
+gboolean _bt_core_set_transfer_value(gboolean value)
+{
+ const char *event_val = NULL;
+ gboolean ret = TRUE;
+
+ BT_DBG("value: %d", value);
+
+ event_val = value ? EVT_VAL_BT_TRANSFERING : EVT_VAL_BT_NON_TRANSFERING;
+
+ if (__bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_TRANSFERING_STATE,
+ event_val) != ES_R_OK) {
+ BT_ERR("Fail to set BT state value");
+ ret = FALSE;
+ }
+
+ if (ret == FALSE || value == FALSE) {
+ BT_DBG("Terminate bt-core process");
+ g_timeout_add(BT_CORE_IDLE_TERM_TIME, __bt_core_idle_terminate, NULL);
+ }
+
+ BT_DBG("-");
+ return ret;
+}
+
gboolean _bt_core_factory_test_mode(const char *type, const char *arg)
{
return;
}
_bt_set_flightmode_request(FALSE);
+
+ if (__bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_STATE,
+ EVT_VAL_BT_ON) != ES_R_OK)
+ BT_ERR("Fail to set BT state value");
+
+ if (__bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_LE_STATE,
+ EVT_VAL_BT_LE_ON) != ES_R_OK)
+ BT_ERR("Fail to set BT LE state value");
+
_bt_core_terminate();
}
" </method>"
" <method name='EnableCore'>"
" </method>"
+" <method name='SetTransferValue'>"
+" <arg type='b' name='value' direction='in'/>"
+" </method>"
" <method name='FactoryTestMode'>"
" <arg type='s' name='type' direction='in'/>"
" <arg type='s' name='arg' direction='in'/>"
ret = _bt_core_disable_adapter_le();
} else if (g_strcmp0(method_name, "EnableCore") == 0) {
ret = _bt_core_enable_core();
+ } else if (g_strcmp0(method_name, "SetTransferValue") == 0) {
+ gboolean value = FALSE;
+
+ g_variant_get(parameters, "(b)", &value);
+ BT_DBG("Transfer value: %d", value);
+
+ ret = _bt_core_set_transfer_value(value);
} else if (g_strcmp0(method_name, "FactoryTestMode") == 0) {
const char *type = NULL;
const char *arg = NULL;
gboolean _bt_core_disable_adapter_le(void);
gboolean __bt_core_reset_adapter(void);
gboolean _bt_core_enable_core(void);
+gboolean _bt_core_set_transfer_value(gboolean value);
gboolean _bt_core_factory_test_mode(const char *type, const char *arg);
void _bt_core_update_status(void);