/**
 * @file
 * Implements a "Probe" Protocol, that logs all transferred data to a file.
 *
 * @defgroup brp_lib BRP Communication Library
 * @{
 */

#ifndef __MONITOR_PROTOCOL_H__
#define __MONITOR_PROTOCOL_H__


#include "protocol.h"


#if !defined(BRP_LOG_DIR_PREFIX)
	#define BRP_LOG_DIR_PREFIX    "brp-logs-"
#endif


/**
 * Creates a new Monitor protocol layer.
 *
 * This protocol layer will log all actions executed to a file and forward them
 * one-to-one to the underlying protocol.
 *
 * @return A BRP protocol on success or NULL on failure.
 */
BRP_LIB brp_protocol brp_create_monitor(void);


/**
 * Marks the beginning of a related block of log entries
 *
 * @param protocol A protocol which shall be annotated. Must not necessary a
 *                 brp_monitor_protocol as it will search for all
 *                 monitor_protocols which are comming below this protocol.
 */
BRP_LIB void brp_annotation_start(brp_protocol protocol);


/**
 * Marks the end of a related block of log entries and adds some kind of
 * comment to it.
 *
 * @param protocol A protocol which shall be annotated. Must not necessary a
 *                 brp_monitor_protocol as it will search for all
 *                 monitor_protocols which are comming below this protocol.
 * @param success  Specifies if the Annotated Block of commands was successful
 *                 or not.
 * @param comment  A comment that is shown together with the embraced log
 *                 entries
 */
BRP_LIB void brp_annotation_end(
	brp_protocol protocol, bool success, char * comment
);


#endif //__MONITOR_PROTOCOL_H__

/** @} */ // end of defgroup brp_lib
