All of lore.kernel.org
 help / color / mirror / Atom feed
From: OpenBMC Patches <openbmc-patches@stwcx.xyz>
To: openbmc@lists.ozlabs.org
Cc: shgoupf <shgoupf@cn.ibm.com>
Subject: [PATCH phosphor-host-ipmid v3 5/6] Cleanup codes for ipmid boot option changes.
Date: Wed, 16 Dec 2015 06:50:24 -0600	[thread overview]
Message-ID: <1450270225-2497-6-git-send-email-openbmc-patches@stwcx.xyz> (raw)
In-Reply-To: <1450270225-2497-1-git-send-email-openbmc-patches@stwcx.xyz>

From: shgoupf <shgoupf@cn.ibm.com>

There are some codes for testing that should be removed.
---
 chassishandler.C | 42 ++++++++++++++----------------------------
 1 file changed, 14 insertions(+), 28 deletions(-)

diff --git a/chassishandler.C b/chassishandler.C
index e69e6c3..8aba43b 100644
--- a/chassishandler.C
+++ b/chassishandler.C
@@ -8,6 +8,12 @@
 const char  *chassis_bus_name      =  "org.openbmc.control.Chassis";
 const char  *chassis_object_name   =  "/org/openbmc/control/chassis0";
 const char  *chassis_intf_name     =  "org.openbmc.control.Chassis";
+
+// Host settings in dbus
+const char  *settings_service_name =  "org.openbmc.settings.Host";
+const char  *settings_object_name  =  "/org/openbmc/settings/host0";
+const char  *settings_intf_name    =  "org.freedesktop.DBus.Properties";
+
 char* uint8_to_char(uint8_t *a, size_t size)
 {
     char* buffer;
@@ -68,14 +74,14 @@ int dbus_get_property(char* buf)
     // Signatures and input arguments are provided by the arguments at the
     // end.
     r = sd_bus_call_method(bus,
-            "org.openbmc.settings.Host",                /* service to contact */
-            "/org/openbmc/settings/host0",              /* object path */
-            "org.freedesktop.DBus.Properties",          /* interface name */
+            settings_service_name,                      /* service to contact */
+            settings_object_name,                       /* object path */
+            settings_intf_name,                         /* interface name */
             "Get",                                      /* method name */
             &error,                                     /* object to return error in */
             &m,                                         /* return message on success */
             "ss",                                       /* input signature */
-            "org.freedesktop.DBus.Properties",          /* first argument */
+            settings_intf_name,                         /* first argument */
             "boot_flags");                              /* second argument */
     if (r < 0) {
         fprintf(stderr, "Failed to issue method call: %s\n", error.message);
@@ -122,14 +128,14 @@ int dbus_set_property(const char* buf)
     // Signatures and input arguments are provided by the arguments at the
     // end.
     r = sd_bus_call_method(bus,
-            "org.openbmc.settings.Host",                /* service to contact */
-            "/org/openbmc/settings/host0",              /* object path */
-            "org.freedesktop.DBus.Properties",          /* interface name */
+            settings_service_name,                      /* service to contact */
+            settings_object_name,                       /* object path */
+            settings_intf_name,                         /* interface name */
             "Set",                                      /* method name */
             &error,                                     /* object to return error in */
             &m,                                         /* return message on success */
             "ssv",                                      /* input signature */
-            "org.freedesktop.DBus.Properties",          /* first argument */
+            settings_intf_name,                         /* first argument */
             "boot_flags",                               /* second argument */
             "s",                                        /* third argument */
             buf);                                       /* fourth argument */
@@ -343,24 +349,4 @@ void register_netfn_chassis_functions()
 
     printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_CHASSIS, IPMI_CMD_CHASSIS_CONTROL);
     ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_CHASSIS_CONTROL, NULL, ipmi_chassis_control);
-
-    // TODO: Testing for dbus property set/get and related methods.
-    printf("----> Start of chassis handler testing.\n");
-    set_sys_boot_options_t req = {0x80, 0x10, 0xA2, 0x3B, 0x45, 0x57}; 
-    char* set_value = uint8_to_char((uint8_t*)(&(req.data1)), 5);
-    dbus_set_property(set_value);
-    char* buf = (char*)malloc(NUM_RETURN_BYTES_OF_GET_USED * 2 + 1);
-    dbus_get_property(buf);
-    uint8_t* get_value = char_to_uint8(buf, NUM_RETURN_BYTES_OF_GET_USED);
-    int i;
-    printf("buf: %s\n", (char*)buf);
-    printf("0x");
-    for (i = 0; i < 5; i++) {
-        printf("%2x", get_value[i]);
-    }
-    printf("\n");
-    printf("----> End of chassis handler testing.\n");
-    free(buf);
-    free(set_value);
-    free(get_value);
 }
-- 
2.6.3

  parent reply	other threads:[~2015-12-16 12:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16 12:50 [PATCH phosphor-host-ipmid v3 0/6] IPMID boot options changes OpenBMC Patches
2015-12-16 12:50 ` [PATCH phosphor-host-ipmid v3 1/6] Support host reboot OpenBMC Patches
2015-12-16 21:27   ` Stewart Smith
2015-12-17  6:46     ` Vishwanatha Subbanna
     [not found]     ` <201512170646.tBH6kaOR019514@d28av01.in.ibm.com>
2015-12-21  3:10       ` Stewart Smith
2015-12-16 12:50 ` [PATCH phosphor-host-ipmid v3 2/6] Add get/set ipmid command support with correct DBUS property handling OpenBMC Patches
2015-12-16 20:48   ` Benjamin Herrenschmidt
2015-12-16 21:44   ` Stewart Smith
2015-12-17  4:01     ` Chris Austen
     [not found]     ` <OF6CA268B3.D580B2FE-ON00257F1E.0016143E-1450324869873@LocalDomain>
2015-12-17  5:31       ` Peng Fei BG Gou
2015-12-21  3:14         ` Stewart Smith
2015-12-16 12:50 ` [PATCH phosphor-host-ipmid v3 3/6] Revert "Add get/set ipmid command support with correct DBUS property handling." OpenBMC Patches
2015-12-16 12:50 ` [PATCH phosphor-host-ipmid v3 4/6] Redo: Add get/set ipmid boot option command support with correct DBUS property handling OpenBMC Patches
2015-12-16 12:50 ` OpenBMC Patches [this message]
2015-12-16 12:50 ` [PATCH phosphor-host-ipmid v3 6/6] Get service name via object mapper OpenBMC Patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1450270225-2497-6-git-send-email-openbmc-patches@stwcx.xyz \
    --to=openbmc-patches@stwcx.xyz \
    --cc=openbmc@lists.ozlabs.org \
    --cc=shgoupf@cn.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.