From b2e8555ffd5faaa1530c02b10d38c6f66907c4c3 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Wed, 22 Aug 2012 07:18:59 +0200 Subject: [PATCH] pmc: support getting the current data set. Signed-off-by: Richard Cochran --- pmc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pmc.c b/pmc.c index fd6e15a..bf5328a 100644 --- a/pmc.c +++ b/pmc.c @@ -43,6 +43,7 @@ static struct PortIdentity port_identity; static struct transport *transport; static struct fdarray fdarray; +static void do_get_action(int action, int index); static void not_supported(int action, int index); static void null_management(int action, int index); @@ -61,7 +62,7 @@ struct management_id idtab[] = { { "FAULT_LOG", FAULT_LOG, not_supported }, { "FAULT_LOG_RESET", FAULT_LOG_RESET, not_supported }, { "DEFAULT_DATA_SET", DEFAULT_DATA_SET, not_supported }, - { "CURRENT_DATA_SET", CURRENT_DATA_SET, not_supported }, + { "CURRENT_DATA_SET", CURRENT_DATA_SET, do_get_action }, { "PARENT_DATA_SET", PARENT_DATA_SET, not_supported }, { "TIME_PROPERTIES_DATA_SET", TIME_PROPERTIES_DATA_SET, not_supported }, { "PRIORITY1", PRIORITY1, not_supported }, @@ -208,6 +209,14 @@ static void get_action(int id) msg_put(msg); } +static void do_get_action(int action, int index) +{ + if (action == GET) + get_action(idtab[index].code); + else + fprintf(stderr, "%s only allows GET\n", idtab[index].name); +} + static void not_supported(int action, int index) { fprintf(stdout, "sorry, %s not supported yet\n", idtab[index].name);