[PROTO] config is preserved between stop and start
authorNikita Kalyazin <n.kalyazin@samsung.com>
Tue, 22 Oct 2013 16:46:58 +0000 (20:46 +0400)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Wed, 23 Oct 2013 11:47:44 +0000 (11:47 +0000)
Change-Id: I47bda64a18121ef32cc0ed80872139e6e7f2c54c
Signed-off-by: Nikita Kalyazin <n.kalyazin@samsung.com>
parser/msg_cmd.c
parser/msg_parser.c
parser/msg_parser.h

index 2ead7d5..fb3b921 100644 (file)
@@ -60,6 +60,7 @@ int msg_start(struct msg_buf *mb)
 {
        int ret = 0;
        struct us_inst_data *us_inst;
+       struct conf_data conf;
 
        reset_seq_num();
        reset_discarded();
@@ -86,6 +87,9 @@ int msg_start(struct msg_buf *mb)
        if (ret)
                goto free_us_inst;
 
+       restore_config(&conf);
+       set_config(&conf);
+
        return ret;
 
 free_us_inst:
@@ -139,6 +143,7 @@ int msg_config(struct msg_buf *mb)
 
        /* TODO implement the processing */
        set_config(conf);
+       save_config(conf);
 
 free_conf_data:
        destroy_conf_data(conf);
index cdab15b..469d80c 100644 (file)
@@ -196,7 +196,16 @@ void destroy_conf_data(struct conf_data *conf)
        kfree(conf);
 }
 
+static struct conf_data config;
+void save_config(const struct conf_data *conf)
+{
+       memcpy(&config, conf, sizeof(config));
+}
 
+void restore_config(struct conf_data *conf)
+{
+       memcpy(conf, &config, sizeof(*conf));
+}
 
 
 
index c2f1e54..94434d1 100644 (file)
@@ -90,6 +90,9 @@ void destroy_app_info(struct app_info_data *app_info);
 struct conf_data *create_conf_data(struct msg_buf *mb);
 void destroy_conf_data(struct conf_data *conf);
 
+void save_config(const struct conf_data *conf);
+void restore_config(struct conf_data *conf);
+
 struct func_inst_data *create_func_inst_data(struct msg_buf *mb);
 void destroy_func_inst_data(struct func_inst_data *func_inst);