#include "bt-request-sender.h"
#include "bt-event-handler.h"
#include "bluetooth-media-control.h"
-
-#ifdef TIZEN_GATT_CLIENT
#include "bluetooth-gatt-client-api.h"
-#endif
+#include "bluetooth-mesh-api.h"
static GSList *sending_requests;
*param_data = &g_array_index(output,
bluetooth_device_address_t, 0);
break;
-#ifdef TIZEN_GATT_CLIENT
case BT_CONNECT_LE:
*event_type = BT_DEVICE_EVENT;
*event = BLUETOOTH_EVENT_GATT_CLIENT_CONNECTED;
*param_data = &g_array_index(output,
bluetooth_device_address_t, 0);
break;
-#else
- case BT_CONNECT_LE:
- *event_type = BT_DEVICE_EVENT;
- *event = BLUETOOTH_EVENT_GATT_CONNECTED;
- ret_if(output == NULL);
- *param_data = &g_array_index(output,
- bluetooth_device_address_t, 0);
- break;
- case BT_DISCONNECT_LE:
- *event_type = BT_DEVICE_EVENT;
- *event = BLUETOOTH_EVENT_GATT_DISCONNECTED;
- ret_if(output == NULL);
- *param_data = &g_array_index(output,
- bluetooth_device_address_t, 0);
- break;
-#endif
-#ifdef TIZEN_GATT_CLIENT
case BT_GATT_READ_CHARACTERISTIC:
BT_INFO("BT_GATT_READ_CHARACTERISTIC");
*event_type = BT_GATT_CLIENT_EVENT;
*param_data = &g_array_index(output,
bluetooth_gatt_client_desc_prop_info_t, 0);
break;
-#endif
case BT_TDS_READ_TRANSPORT_DATA:
*event_type = BT_TDS_EVENT;
*event = BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED;
*param_data = &g_array_index(output,
bt_hdp_disconnected_t, 0);
break;
+ case BT_MESH_NETWORK_PROVISION_DEVICE:
+ *event_type = BT_MESH_EVENT;
+ *event = BLUETOOTH_EVENT_MESH_PROVISIONING_FINISHED;
+ ret_if(output == NULL);
+ *param_data = &g_array_index(output,
+ bluetooth_mesh_provisioning_request_t, 0);
+ break;
+ case BT_MESH_NODE_BROWSE:
+ *event_type = BT_MESH_EVENT;
+ *event = BLUETOOTH_EVENT_MESH_NODE_BROWSED;
+ ret_if(output == NULL);
+ *param_data = &g_array_index(output,
+ bluetooth_mesh_node_discover_t, 0);
+ break;
+ case BT_MESH_NODE_GET_VENDOR_FEATURES:
+ *event_type = BT_MESH_EVENT;
+ *event = BLUETOOTH_EVENT_MESH_NODE_VENDOR_FEATURES;
+ ret_if(output == NULL);
+ *param_data = &g_array_index(output,
+ bluetooth_mesh_node_features_t, 0);
+ break;
+ case BT_MESH_NODE_CONFIGURE_KEY:
+ *event_type = BT_MESH_EVENT;
+ *event = BLUETOOTH_EVENT_MESH_NODE_KEY_CONFIGURED;
+ ret_if(output == NULL);
+ *param_data = &g_array_index(output,
+ bluetooth_mesh_key_configure_t, 0);
+ break;
+ case BT_MESH_NODE_TTL_EXECUTE:
+ *event_type = BT_MESH_EVENT;
+ *event = BLUETOOTH_EVENT_MESH_NODE_TTL_CONFIGURED;
+ ret_if(output == NULL);
+ *param_data = &g_array_index(output,
+ bluetooth_mesh_node_ttl_info_t, 0);
+ break;
+ case BT_MESH_MODEL_CONFIGURE_APPKEY:
+ *event_type = BT_MESH_EVENT;
+ *event = BLUETOOTH_EVENT_MESH_MODEL_APPKEY_BIND;
+ ret_if(output == NULL);
+ *param_data = &g_array_index(output,
+ bluetooth_mesh_model_configure_t, 0);
+ break;
+ case BT_MESH_MODEL_EXECUTE_MSG:
+ *event_type = BT_MESH_EVENT;
+ *event = BLUETOOTH_EVENT_MESH_MODEL_MSG_EXECUTED;
+ ret_if(output == NULL);
+ *param_data = &g_array_index(output,
+ bluetooth_mesh_model_msg_t, 0);
+ break;
+ case BT_MESH_MODEL_CONFIG_GROUP_SUB:
+ *event_type = BT_MESH_EVENT;
+ *event = BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_CONFGURED;
+ ret_if(output == NULL);
+ *param_data = &g_array_index(output,
+ bluetooth_mesh_model_configure_t, 0);
+ break;
+ case BT_MESH_MODEL_GET_APPKEY_LIST:
+ *event_type = BT_MESH_EVENT;
+ *event = BLUETOOTH_EVENT_MESH_MODEL_APPKEY_LIST;
+ ret_if(output == NULL);
+ *param_data = &g_array_index(output,
+ bluetooth_mesh_model_configure_t, 0);
+ break;
+ case BT_MESH_MODEL_GET_SUBSCRIPTION_LIST:
+ *event_type = BT_MESH_EVENT;
+ *event = BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_LIST;
+ ret_if(output == NULL);
+ *param_data = &g_array_index(output,
+ bluetooth_mesh_model_configure_t, 0);
+ break;
+ case BT_MESH_MODEL_CONFIG_VIRTUAL_GROUP_SUB:
+ *event_type = BT_MESH_EVENT;
+ *event = BLUETOOTH_EVENT_MESH_MODEL_VIRTUAL_SUBSCRIPTION_CONFGURED;
+ ret_if(output == NULL);
+ *param_data = &g_array_index(output,
+ bluetooth_mesh_model_configure_t, 0);
+ break;
+ case BT_MESH_MODEL_SET_PUBLICATION:
+ *event_type = BT_MESH_EVENT;
+ *event = BLUETOOTH_EVENT_MESH_MODEL_PUBLICATION_STATUS;
+ ret_if(output == NULL);
+ *param_data = &g_array_index(output,
+ bluetooth_mesh_model_configure_t, 0);
+ break;
+ case BT_MESH_MODEL_GET_PUBLICATION:
+ *event_type = BT_MESH_EVENT;
+ *event = BLUETOOTH_EVENT_MESH_MODEL_PUBLICATION_STATUS;
+ ret_if(output == NULL);
+ *param_data = &g_array_index(output,
+ bluetooth_mesh_model_configure_t, 0);
+ break;
default:
BT_ERR("Unknown function");
return;
} else if (event_type == BT_AVRCP_EVENT) {
((bluetooth_cb_func_ptr)cb_data->cb)(bt_event.event,
&bt_event, cb_data->user_data);
-#ifdef TIZEN_GATT_CLIENT
} else if (event_type == BT_GATT_CLIENT_EVENT) {
((gatt_client_cb_func_ptr)cb_data->cb)(bt_event.event,
(gatt_client_event_param_t*)&bt_event, cb_data->user_data);
-#endif
+ } else if (event_type == BT_MESH_EVENT) {
+ ((mesh_cb_func_ptr)cb_data->cb)(bt_event.event,
+ (mesh_event_param_t*)&bt_event, cb_data->user_data);
} else {
BT_INFO("Not handled event type : %d", event_type);
}