ekmmeters.py
def unpackStruct(self, data, def_buf):
        """ Wrapper for struct.unpack with SerialBlock buffer definitionns.

        Args:
            data (str): Implicit cast bytes to str, serial port return.
            def_buf (SerialBlock): Block object holding field lengths.

        Returns:
            tuple: parsed result of struct.unpack() with field definitions.
        """
        struct_str = "="
        for fld in def_buf:
            if not def_buf[fld][MeterData.CalculatedFlag]:
                struct_str = struct_str + str(def_buf[fld][MeterData.SizeValue]) + "s"
        if len(data) == 255:
            contents = struct.unpack(struct_str, str(data))
        else:
            self.writeCmdMsg("Length error.  Len() size = " + str(len(data)))
            contents = ()
        return contents
def unpackStruct(self, data, def_buf):
        struct_str = "="
        for fld in def_buf:
            if not def_buf[fld][MeterData.CalculatedFlag]:
                struct_str = struct_str + str(def_buf[fld][MeterData.SizeValue]) + "s"
        if len(data) == 255:
            contents = struct.unpack(struct_str, str(data))
        else:
            self.writeCmdMsg("Length error.  Len() size = " + str(len(data)))
            contents = ()
        return contents
def unpackStruct ( self , data , def_buf ) : struct_str = "=" for fld in def_buf : if not def_buf [ fld ] [ MeterData . CalculatedFlag ] : struct_str = struct_str + str ( def_buf [ fld ] [ MeterData . SizeValue ] ) + "s" if len ( data ) == 255 : contents = struct . unpack ( struct_str , str ( data ) ) else : self . writeCmdMsg ( "Length error.  Len() size = " + str ( len ( data ) ) ) contents = ( ) return contents
Wrapper for struct.unpack with SerialBlock buffer definitionns.

        Args:
            data (str): Implicit cast bytes to str, serial port return.
            def_buf (SerialBlock): Block object holding field lengths.

        Returns:
            tuple: parsed result of struct.unpack() with field definitions.
Wrapper for struct . unpack with SerialBlock buffer definitionns .