コード例 #1
0
 def setUp(self):
     self._protocol = Protocol('Test')
     self._protocol.add(UInt(1, 'id', 1))
     self._protocol.add(UInt(2, 'length', None))
     self._protocol.add(PDU('length-2'))
     self._msg = MessageTemplate('FooRequest', self._protocol, {'id': '0xaa'})
     self._msg.add(UInt(1, 'field_1', None))
     self._msg.add(UInt(1, 'field_2', None))
     byte_stream = MockStream(to_bin('0xff0004cafe aa0004dead dd0004beef'))
     self._msg_stream = MessageStream(byte_stream, self._protocol)
コード例 #2
0
 def setUp(self):
     self._protocol = Protocol('Test')
     self._protocol.add(UInt(1, 'id', 1))
     self._protocol.add(UInt(2, 'length', None))
     self._protocol.add(PDU('length-2'))