# Path: IoTPy/errors.py
# class IoTPy_APIError(Exception):
#     pass


from IoTPy.errors import IoTPy_APIError
from six import binary_type, integer_types
from struct import pack, unpack
    pointer = 4
    args = []
    while pointer < command_length:
        arg_type = ord(io_buffer[pointer:pointer + 1])
        pointer += 1
        if arg_type < 64:                    # short int
            args.append(arg_type)
        elif arg_type < 128:                    # short str
            arg_len = arg_type & 0x3f
            args.append(io_buffer[pointer:pointer + arg_len])
            pointer += arg_len
        else:
            arg_len = arg_type & 0x0f
            if arg_len < 4:            # decoding integers
                if arg_len == 0:
                    args.append(ord(io_buffer[pointer:pointer + 1]))
                elif arg_len == 1:
                    args.append(unpack('>H', io_buffer[pointer:pointer + 2])[0])
                elif arg_len == 2:
                    args.append(unpack('>I', b'\x00' + io_buffer[pointer:pointer + 3])[0])
                elif arg_len == 3:
                    args.append(unpack('>I', io_buffer[pointer:pointer + 4])[0])
                pointer += arg_len + 1
            else:
                if arg_type == 0xc4:        # decoding strings
                    arg_len = ord(io_buffer[pointer:pointer + 1])
                elif arg_type == 0xc5:
                    arg_len = unpack('>H', io_buffer[pointer:pointer + 2])[0]
                    pointer += 1
                else:

# Path: IoTPy/errors.py
# class IoTPy_APIError(Exception):
#     pass


# Path: IoTPy/sfp.py
from IoTPy.errors import IoTPy_APIError
from six import binary_type, integer_types
from struct import pack, unpack

    pointer = 4
    args = []
    while pointer < command_length:
        arg_type = ord(io_buffer[pointer:pointer + 1])
        pointer += 1
        if arg_type < 64:                    # short int
            args.append(arg_type)
        elif arg_type < 128:                    # short str
            arg_len = arg_type & 0x3f
            args.append(io_buffer[pointer:pointer + arg_len])
            pointer += arg_len
        else:
            arg_len = arg_type & 0x0f
            if arg_len < 4:            # decoding integers
                if arg_len == 0:
                    args.append(ord(io_buffer[pointer:pointer + 1]))
                elif arg_len == 1:
                    args.append(unpack('>H', io_buffer[pointer:pointer + 2])[0])
                elif arg_len == 2:
                    args.append(unpack('>I', b'\x00' + io_buffer[pointer:pointer + 3])[0])
                elif arg_len == 3:
                    args.append(unpack('>I', io_buffer[pointer:pointer + 4])[0])
                pointer += arg_len + 1
            else:
                if arg_type == 0xc4:        # decoding strings
                    arg_len = ord(io_buffer[pointer:pointer + 1])
                elif arg_type == 0xc5:
                    arg_len = unpack('>H', io_buffer[pointer:pointer + 2])[0]
                    pointer += 1
                else:

                    raise IoTPy_APIError("UPER API: Bad parameter type in decodeSFP method.")