def GetId(datas: bytes, length: int):
    """
    从数据包内获取子站地址——ID
    :param datas: 数据包
    :param length: 地址长度
    :return:
    """
    # int length = System.Convert.ToInt32(SqliteProvider.ReadPara(SqliteProvider.icepara, "LinkAddrLength"))
    if datas[0] == 0x10:  # 固定帧长报文
        return int.from_bytes(datas[2:2 + length], byteorder='little')  # little big
    elif datas[0] == 0x68:  # 可变帧长报文
        return int.from_bytes(datas[5:5 + length], byteorder='little')
    else:
        return 0