Mesh: Handle mesh application termination event
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / services / mesh / bt-service-mesh-cdb.c
index ca6dada..c69ea7f 100644 (file)
@@ -459,6 +459,7 @@ static bool __mesh_add_u8_16(json_object *jobj,
 void _bt_mesh_conf_free(_bt_mesh_cdb_t *cfg)
 {
        g_free(cfg->cfg_fname);
+       g_free(cfg->owner);
        g_free(cfg->app_cred);
        json_object_put(cfg->jcfg);
        g_slist_free_full(cfg->groups, g_free);
@@ -816,7 +817,7 @@ bool _bt_mesh_conf_node_delete_application_key(_bt_mesh_cdb_t *cfg,
 _bt_mesh_cdb_t *_bt_mesh_conf_database_create(const char *file_name,
                const uint8_t uuid[16],
                        const uint8_t token[8], const char *network_name,
-                               const char *app_cred)
+                               const char *sender, const char *app_cred)
 {
        _bt_mesh_cdb_t *cfg;
        json_object *jcfg, *jarray;
@@ -837,6 +838,7 @@ _bt_mesh_cdb_t *_bt_mesh_conf_database_create(const char *file_name,
        cfg = g_malloc0(sizeof(_bt_mesh_cdb_t));
        cfg->jcfg = jcfg;
        cfg->cfg_fname = g_strdup(file_name);
+       cfg->owner = g_strdup(sender);
        cfg->app_cred = g_strdup(app_cred);
        memcpy(&cfg->token, (void*)token, 8);
        memcpy(&cfg->uuid, (void*)uuid, 16);