def buildPacketsInfo(count, total):
    """ Helper function to calculate data related with packets received from an asset
    Request parameters (all required):
        - count: number of packets of the type (up, down, lost) to calculate data for
        - total: number of packets in total
    Returns:
        - JSON with packets related information (see code for more details about the fields).
    """
    return {
        'total': count,
        'percentage': 100*count/total if total else None
    }