def pack_info(gw_name, dev_id, data_type, ty, data):
    """method that packages the information to be sent to the server
    with specific format.

    Args:
        gw_name (String): Name of the gw
        dev_id (String): Device identifier
        data_type (String): data type to be casted (String = 2, Double = 1, Int = 0)
        ty (String): sensor type
        data (Object): data received from device

    Raises:
        ValueError: [description]

    Returns:
        [type]: [description]
    """
    if (gw_name == "") or (dev_id == "") or (data_type == "") or (ty == "") or (data == None):
        raise ValueError("All params must be non empty")
    params = {
                "Gateway": gw_name,
                "Devices":[
                    {   
                        "Device":dev_id,    
                        "Sensors":[
                            {
                                "DType":data_type,
                                "Type":ty,
                                "data":data
                            }
                        ]

                    }
                ]
            }
    return params