Add the session timer to handle the exception case
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-service-event-receiver.c
index 51cd09f..73efe11 100644 (file)
@@ -1222,7 +1222,7 @@ static void __bt_device_property_changed_event(GVariant *msg, const char *path)
                } else if (strcasecmp(property, "IpspBtInterfaceInfo") == 0) {
                        char *ifname = NULL;
 
-                       g_variant_get(val, "s", &ifname);
+                       g_variant_get(val, "&s", &ifname);
 
                        address = g_malloc0(BT_ADDRESS_STRING_SIZE);
 
@@ -2245,9 +2245,31 @@ void _bt_handle_device_event(GVariant *msg, const char *member, const char *path
                param = g_variant_new("(iss)", result, address, ifname);
 
                /* Send event to application */
+               _bt_send_event(BT_DEVICE_EVENT, event, param);
+               g_free(address);
+       } else if (strcasecmp(member, "AttMtuChanged") == 0) {
+               int result = BLUETOOTH_ERROR_NONE;
+               guint16 mtu = 0;
+               guint8 status = 0;
+
+               g_variant_get(msg, "(q)", &mtu);
+
+               address = g_malloc0(BT_ADDRESS_STRING_SIZE);
+
+               _bt_convert_device_path_to_address(path, address);
+               BT_DBG("Address : %s Server MTU changed : %d", address, mtu);
+
+               param = g_variant_new("(isqy)",
+                       result,
+                       address,
+                       mtu,
+                       status);
+
+               /* Send the event to application */
                _bt_send_event(BT_DEVICE_EVENT,
-                                               event,
+                       BLUETOOTH_EVENT_GATT_SERVER_ATT_MTU_CHANGED,
                                                param);
+
                g_free(address);
        } else if (strcasecmp(member, "iBeaconReport") == 0) {
                bt_remote_ibeacon_dev_info_t *ibeacon_dev_info = NULL;