def make_mgt_byte(service, sync=False):
    """
    Creates the management byte according to the protocol

    :param service: Service code as defined in :obj:`~.Service`
    :param sync: boolean if synchronized mode should be used
    :return: integer
    """
    msg = service + 3*16
    if sync:
        msg += 64
    return msg