• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python msgs.decode_message函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyipmi.msgs.decode_message函数的典型用法代码示例。如果您正苦于以下问题:Python decode_message函数的具体用法?Python decode_message怎么用?Python decode_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了decode_message函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_get_shelf_address_info_rsp

 def test_get_shelf_address_info_rsp(self):
     m = pyipmi.msgs.picmg.GetShelfAddressInfoRsp()
     decode_message(m, "\x00\x00\x01\x02")
     self.assertEqual(m.completion_code, 0x00)
     self.assertEqual(m.picmg_identifier, 0x00)
     self.assertEqual(m.shelf_address[0], 0x01)
     self.assertEqual(m.shelf_address[1], 0x02)
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:7,代码来源:test_picmg.py


示例2: send_and_receive

    def send_and_receive(self, msg):
        """Sends an IPMI request message and waits for its response.

        `msg` is a IPMI Message containing both the request and response.
        """

        log().debug('IPMI Request [%s]', msg)

        retries = 0
        while retries < self.max_retries:
            try:
                rx_data = self._send_and_receive_raw(msg.target, msg.lun,
                        msg.netfn, chr(msg.cmdid) + encode_message(msg))
                break
            except TimeoutError:
                pass

            retries += 1

        else:
            raise TimeoutError()

        msg = create_message(msg.cmdid, msg.netfn + 1)
        decode_message(msg, rx_data[5:-1])

        log().debug('IPMI Response [%s])', msg)

        return msg
开发者ID:sadig,项目名称:python-ipmi,代码行数:28,代码来源:aardvark.py


示例3: test_getsensoreventenable_decode_byte34_rsp

def test_getsensoreventenable_decode_byte34_rsp():
    m = pyipmi.msgs.sensor.GetSensorEventEnableRsp()
    decode_message(m, '\x00\xc0\xaa\xbb')
    eq_(m.completion_code, 0x00)
    eq_(m.enabled.event_message, 1)
    eq_(m.byte3, 0xaa)
    eq_(m.byte4, 0xbb)
开发者ID:Teslafly,项目名称:python-ipmi,代码行数:7,代码来源:test_sensor.py


示例4: test_decode_byte34_rsp

 def test_decode_byte34_rsp(self):
     m = pyipmi.msgs.sensor.GetSensorEventEnableRsp()
     decode_message(m, '\x00\xc0\xaa\xbb')
     self.assertEqual(m.completion_code, 0x00)
     self.assertEqual(m.enabled.event_message, 1)
     self.assertEqual(m.byte3, 0xaa)
     self.assertEqual(m.byte4, 0xbb)
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:7,代码来源:test_sensor.py


示例5: test_deviceid_object_with_aux

def test_deviceid_object_with_aux():
    m = pyipmi.msgs.bmc.GetDeviceIdRsp()
    decode_message(m,
    '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04')

    d = DeviceId(m)
    eq_(d.aux, [1,2,3,4])
开发者ID:hthiery,项目名称:python-ipmi,代码行数:7,代码来源:test_bmc.py


示例6: test_get_shelf_address_info_rsp

def test_get_shelf_address_info_rsp():
    m = pyipmi.msgs.picmg.GetShelfAddressInfoRsp()
    decode_message(m, b'\x00\x00\x01\x02')
    eq_(m.completion_code, 0x00)
    eq_(m.picmg_identifier, 0x00)
    eq_(m.shelf_address[0], 0x01)
    eq_(m.shelf_address[1], 0x02)
开发者ID:kontron,项目名称:python-ipmi,代码行数:7,代码来源:test_picmg.py


示例7: test_getmessage_decode_with_data_rsp

def test_getmessage_decode_with_data_rsp():
    m = pyipmi.msgs.device_messaging.GetMessageRsp()
    decode_message(m, b'\x00\x21\xaa\xff\xff\xee')
    eq_(m.completion_code, 0x00)
    eq_(m.channel.number, 1)
    eq_(m.channel.privilege_level, 2)
    eq_(m.data, array('B', [0xaa, 0xff, 0xff, 0xee]))
开发者ID:kontron,项目名称:python-ipmi,代码行数:7,代码来源:test_device_messaging.py


示例8: test_getmessage_decode_with_data_rsp

def test_getmessage_decode_with_data_rsp():
        m = pyipmi.msgs.bmc.GetMessageRsp()
        decode_message(m, '\x00\x21\xaa\xff\xff\xee')
        eq_(m.completion_code, 0x00)
        eq_(m.channel_number.channel_number, 1)
        eq_(m.channel_number.privilege_level, 2)
        eq_(m.data, array('B', b'\xaa\xff\xff\xee'))
开发者ID:hthiery,项目名称:python-ipmi,代码行数:7,代码来源:test_msgs.py


示例9: test_readeventmessagebuffer_decode_rsp

def test_readeventmessagebuffer_decode_rsp():
    m = pyipmi.msgs.device_messaging.ReadEventMessageBufferRsp()
    decode_message(m, b'\x00\x00\x01\x02\x03\x04\x05\x06\x07'
                   b'\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f')
    eq_(m.completion_code, 0x00)
    eq_(m.event_data, array('B', b'\x00\x01\x02\x03\x04'
        b'\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f'))
开发者ID:kontron,项目名称:python-ipmi,代码行数:7,代码来源:test_device_messaging.py


示例10: test_decode_rsp

 def test_decode_rsp(self):
     m = pyipmi.msgs.bmc.ReadEventMessageBufferRsp()
     decode_message(m, '\x00\x00\x01\x02\x03\x04\x05\x06\x07'\
             '\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f')
     self.assertEqual(m.completion_code, 0x00)
     self.assertEqual(m.event_data, array('B', '\x00\x01\x02\x03\x04'\
             '\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f'))
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:7,代码来源:msgs.py


示例11: test_decode_with_data_rsp

	def test_decode_with_data_rsp(self):
		m = pyipmi.msgs.bmc.GetMessageRsp()
		decode_message(m, '\x00\x21\xaa\xff\xff\xee')
		self.assertEqual(m.completion_code, 0x00)
		self.assertEqual(m.channel_number.channel_number, 1)
		self.assertEqual(m.channel_number.privilege_level, 2)
		self.assertEqual(m.data, array('B', '\xaa\xff\xff\xee'))
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:7,代码来源:msgs.py


示例12: test_decode_rsp_local_control_state

 def test_decode_rsp_local_control_state(self):
     m = pyipmi.msgs.picmg.GetFruLedStateRsp()
     decode_message(m, '\x00\x00\x01\xff\x00\x02')
     self.assertEqual(m.completion_code, 0x00)
     self.assertEqual(m.led_states.local_avail, 1)
     self.assertEqual(m.local_function, 0xff)
     self.assertEqual(m.local_on_duration, 0)
     self.assertEqual(m.local_color, 2)
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:8,代码来源:picmg.py


示例13: test_decode_rsp

 def test_decode_rsp(self):
     m = pyipmi.msgs.sdr.GetSdrRepositoryAllocationInfoRsp()
     decode_message(m,'\x00\x11\x22\x33\x44\x55\x66\x77\x88\xaa')
     eq_(m.completion_code, 0x00)
     eq_(m.number_of_units, 0x2211)
     eq_(m.unit_size, 0x4433)
     eq_(m.free_units, 0x6655)
     eq_(m.largest_free_block, 0x8877)
     eq_(m.maximum_record_size, 0xaa)
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:9,代码来源:sdr.py


示例14: test_decode_event_message_full_set_rsp

 def test_decode_event_message_full_set_rsp(self):
     m = pyipmi.msgs.bmc.GetMessageFlagsRsp()
     decode_message(m, '\x00\x02')
     self.assertEqual(m.completion_code, 0x00)
     self.assertEqual(m.flag.oem_2, 0)
     self.assertEqual(m.flag.oem_1, 0)
     self.assertEqual(m.flag.oem_0, 0)
     self.assertEqual(m.flag.watchdog_pretimeout_interrupt_occurred, 0)
     self.assertEqual(m.flag.event_message_buffer_full, 1)
     self.assertEqual(m.flag.receive_message_available, 0)
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:10,代码来源:msgs.py


示例15: test_encode_rsp

 def test_encode_rsp(self):
     m = pyipmi.msgs.sensor.GetDeviceSdrInfoRsp()
     decode_message(m, '\x00\x03\x05')
     self.assertEqual(m.completion_code, 0x00)
     self.assertEqual(m.number_of_sensors, 3)
     self.assertEqual(m.flags.lun0_has_sensors, 1)
     self.assertEqual(m.flags.lun1_has_sensors, 0)
     self.assertEqual(m.flags.lun2_has_sensors, 1)
     self.assertEqual(m.flags.lun3_has_sensors, 0)
     self.assertEqual(m.flags.dynamic_population, 0)
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:10,代码来源:test_sensor.py


示例16: test_getmessageflags_decode_event_message_full_set_rsp

def test_getmessageflags_decode_event_message_full_set_rsp():
    m = pyipmi.msgs.device_messaging.GetMessageFlagsRsp()
    decode_message(m, b'\x00\x02')
    eq_(m.completion_code, 0x00)
    eq_(m.flag.oem_2, 0)
    eq_(m.flag.oem_1, 0)
    eq_(m.flag.oem_0, 0)
    eq_(m.flag.watchdog_pretimeout_interrupt_occurred, 0)
    eq_(m.flag.event_message_buffer_full, 1)
    eq_(m.flag.receive_message_available, 0)
开发者ID:kontron,项目名称:python-ipmi,代码行数:10,代码来源:test_device_messaging.py


示例17: test_getdevicesdrinfo_encode_rsp

def test_getdevicesdrinfo_encode_rsp():
    m = pyipmi.msgs.sensor.GetDeviceSdrInfoRsp()
    decode_message(m, '\x00\x03\x05')
    eq_(m.completion_code, 0x00)
    eq_(m.number_of_sensors, 3)
    eq_(m.flags.lun0_has_sensors, 1)
    eq_(m.flags.lun1_has_sensors, 0)
    eq_(m.flags.lun2_has_sensors, 1)
    eq_(m.flags.lun3_has_sensors, 0)
    eq_(m.flags.dynamic_population, 0)
开发者ID:Teslafly,项目名称:python-ipmi,代码行数:10,代码来源:test_sensor.py


示例18: test_decode_oem_0_enabled_rsp

 def test_decode_oem_0_enabled_rsp(self):
     m = pyipmi.msgs.bmc.GetBmcGlobalEnablesRsp()
     decode_message(m, '\x00\x20')
     self.assertEqual(m.completion_code, 0x00)
     self.assertEqual(m.enables.oem_2, 0)
     self.assertEqual(m.enables.oem_1, 0)
     self.assertEqual(m.enables.oem_0, 1)
     self.assertEqual(m.enables.system_event_logging, 0)
     self.assertEqual(m.enables.event_message_buffer, 0)
     self.assertEqual(m.enables.event_message_buffer_full_interrupt, 0)
     self.assertEqual(m.enables.receive_message_queue_interrupt, 0)
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:11,代码来源:msgs.py


示例19: test_getbmcglobalenables_decode_oem_2_enabled_rsp

def test_getbmcglobalenables_decode_oem_2_enabled_rsp():
    m = pyipmi.msgs.device_messaging.GetBmcGlobalEnablesRsp()
    decode_message(m, b'\x00\x80')
    eq_(m.completion_code, 0x00)
    eq_(m.enables.oem_2, 1)
    eq_(m.enables.oem_1, 0)
    eq_(m.enables.oem_0, 0)
    eq_(m.enables.system_event_logging, 0)
    eq_(m.enables.event_message_buffer, 0)
    eq_(m.enables.event_message_buffer_full_interrupt, 0)
    eq_(m.enables.receive_message_queue_interrupt, 0)
开发者ID:kontron,项目名称:python-ipmi,代码行数:11,代码来源:test_device_messaging.py


示例20: test_encode_rsp_with_timestamp

 def test_encode_rsp_with_timestamp(self):
     m = pyipmi.msgs.sensor.GetDeviceSdrInfoRsp()
     decode_message(m, '\x00\x12\x01\xaa\xbb\xcc\xdd')
     self.assertEqual(m.completion_code, 0x00)
     self.assertEqual(m.number_of_sensors, 0x12)
     self.assertEqual(m.flags.lun0_has_sensors, 1)
     self.assertEqual(m.flags.lun1_has_sensors, 0)
     self.assertEqual(m.flags.lun2_has_sensors, 0)
     self.assertEqual(m.flags.lun3_has_sensors, 0)
     self.assertEqual(m.flags.dynamic_population, 0)
     self.assertEqual(m.sensor_population_change, 0xddccbbaa)
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:11,代码来源:test_sensor.py



注:本文中的pyipmi.msgs.decode_message函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python msgs.encode_message函数代码示例发布时间:2022-05-25
下一篇:
Python msgs.create_request_by_name函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap