Skip to content

Commit

Permalink
bmc: implement Get Device GUID
Browse files Browse the repository at this point in the history
Signed-off-by: Emilio Perez <emiliopeju@gmail.com>
  • Loading branch information
EmilioPeJu committed Jun 12, 2024
1 parent ebf99fd commit 2ab3693
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
12 changes: 12 additions & 0 deletions pyipmi/bmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class Bmc(object):
def get_device_id(self):
return DeviceId(self.send_message_with_name('GetDeviceId'))

def get_device_guid(self):
return DeviceGuid(self.send_message_with_name('GetDeviceGuid'))

def cold_reset(self):
self.send_message_with_name('ColdReset')

Expand Down Expand Up @@ -165,3 +168,12 @@ def _from_response(self, rsp):
self.aux = None
if rsp.auxiliary is not None:
self.aux = list(rsp.auxiliary)


class DeviceGuid(State):
def __str__(self):
return 'Device GUID: %02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-' \
'%02x%02x%02x%02x%02x%02x' % tuple(reversed(self.device_guid))

def _from_response(self, rsp):
self.device_guid = rsp.device_guid
9 changes: 6 additions & 3 deletions pyipmi/msgs/bmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,20 @@ class GetAcpiPowerStateRsp(Message):


@register_message_class
class GetDeviceGuideReq(Message):
class GetDeviceGuidReq(Message):
__cmdid__ = constants.CMDID_GET_DEVICE_GUID
__netfn__ = constants.NETFN_APP
__not_implemented__ = True


@register_message_class
class GetDeviceGuideRsp(Message):
class GetDeviceGuidRsp(Message):
__cmdid__ = constants.CMDID_GET_DEVICE_GUID
__netfn__ = constants.NETFN_APP | 1
__not_implemented__ = True
__fields__ = (
CompletionCode(),
ByteArray('device_guid', 16),
)


@register_message_class
Expand Down

0 comments on commit 2ab3693

Please sign in to comment.