Beispiel #1
0
 def __init__(self):
     gd.BaseGDClass.__init__(self)
     #
     self.name = 'start_byte'
     self._isFixed = 1
     self._width = 1
     self._num_items = 1
     self._isPackCompatible = 1
     self._packSpec = '<B'
     #
     # Code to create item objects.
     self.items = []
     #
     x = gd.IntItem(name="stx1",
                    width=1,
                    value=0x68,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
Beispiel #2
0
 def __init__(self):
     gd.BaseGDClass.__init__(self)
     #
     self.name = 'readmeterreq'
     self._isFixed = 1
     self._width = 16
     self._num_items = 11
     self._isPackCompatible = 0
     self._packSpec = None
     #
     # Code to create item objects.
     self.items = []
     #
     x = gd.IntItem(name="wake_up1",
                    width=1,
                    value=0xFE,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="wake_up2",
                    width=1,
                    value=0xFE,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="stx1",
                    width=1,
                    value=0x68,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.BufferItem(name="addr",
                       isfixedwidth=1,
                       width=6,
                       ispack=0,
                       widthispack=0,
                       type="fbuffer")
     self.items.append(x)
     #
     x = gd.IntItem(name="stx2",
                    width=1,
                    value=0x68,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="opcode",
                    width=1,
                    value=0x01,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="len",
                    width=1,
                    value=0x02,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="di_b1",
                    width=1,
                    value=0x43,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="di_b2",
                    width=1,
                    value=0xC3,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="cs",
                    width=1,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="etx",
                    width=1,
                    value=0x16,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
Beispiel #3
0
 def __init__(self):
     gd.BaseGDClass.__init__(self)
     #
     self.name = 'readmeterres'
     self._isFixed = 1
     self._width = 39
     self._num_items = 10
     self._isPackCompatible = 0
     self._packSpec = None
     #
     # Code to create item objects.
     self.items = []
     #
     x = gd.BufferItem(name="addr",
                       isfixedwidth=1,
                       width=6,
                       ispack=0,
                       widthispack=0,
                       type="fbuffer")
     self.items.append(x)
     #
     x = gd.IntItem(name="stx2",
                    width=1,
                    value=0x68,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="opcode",
                    width=1,
                    value=0x81,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="len",
                    width=1,
                    value=0x1C,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="di_b1",
                    width=1,
                    value=0x52,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="di_b2",
                    width=1,
                    value=0x14,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.BufferItem(name="data",
                       isfixedwidth=1,
                       width=25,
                       ispack=0,
                       widthispack=0,
                       type="fbuffer")
     self.items.append(x)
     #
     x = gd.IntItem(name="relay",
                    width=1,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="cs",
                    width=1,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="etx",
                    width=1,
                    value=0x16,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
Beispiel #4
0
 def __init__(self):
     gd.BaseGDClass.__init__(self)
     #
     self.name = 'control_relay_res'
     self._isFixed = 1
     self._width = 13
     self._num_items = 8
     self._isPackCompatible = 0
     self._packSpec = None
     #
     # Code to create item objects.
     self.items = []
     #
     x = gd.BufferItem(name="addr",
                       isfixedwidth=1,
                       width=6,
                       ispack=0,
                       widthispack=0,
                       type="fbuffer")
     self.items.append(x)
     #
     x = gd.IntItem(name="stx2",
                    width=1,
                    value=0x68,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="control",
                    width=1,
                    value=0x84,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="len",
                    width=1,
                    value=0x02,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="di_b1",
                    width=1,
                    value=0x55,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="di_b2",
                    width=1,
                    value=0x28,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="bcc",
                    width=1,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)
     #
     x = gd.IntItem(name="etx",
                    width=1,
                    value=0x16,
                    packspec="<B",
                    ispack=1,
                    widthispack=0,
                    type="uint8")
     self.items.append(x)