示例#1
0
def _read_apn_subscription_info(data, offset):
    arg_length = int(read_token(data, offset))
    arguments = read_seq(data, offset + 22, arg_length * 2)
    cust_data_size = int(read_token(data, offset + 1))
    custom_data = read_map(data, offset + 22 + arg_length * 2,
                           cust_data_size * 4)

    return MpnApnsSubscriptionInfo(
        device=_read_mpn_device_info(data, offset + 2),
        trigger=read(data, "S", offset + 8),
        sound=read(data, "S", offset + 10),
        badge=read(data, "S", offset + 12),
        localized_action_key=read(data, "S", offset + 14),
        launch_image=read(data, "S", offset + 16),
        txt_format=read(data, "S", offset + 18),
        localized_format_key=read(data, "S", offset + 20),
        arguments=arguments,
        custom_data=custom_data)
示例#2
0
def read_get_user_item_data(data):
    """Reads and parses a GUI ('Get User Item Data') request."""
    return {"user": read(data, 'S', 0),
            "items": read_seq(data, 2)}
示例#3
0
def read_get_item_data(data):
    """Reads and parses a GIT ('Get Item Data') request."""
    return read_seq(data, 0)