blob: 75a22fd8218dbb172744d893a322026a25099769 [file] [log] [blame]
/*
<:copyright-BRCM:2016:DUAL/GPL:standard
Broadcom Proprietary and Confidential.(c) 2016 Broadcom
All Rights Reserved
Unless you and Broadcom execute a separate written software license
agreement governing use of this software, this software is licensed
to you under the terms of the GNU General Public License version 2
(the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
with the following added to such license:
As a special exception, the copyright holders of this software give
you permission to link this software with independent modules, and
to copy and distribute the resulting executable under terms of your
choice, provided that you also meet, for each linked independent
module, the terms and conditions of the license of that module.
An independent module is a module which is not derived from this
software. The special exception does not apply to any modifications
of the software.
Not withstanding the above, under no circumstances may you combine
this software in any way with any other Broadcom software provided
under a license other than the GPL, without Broadcom's express prior
written consent.
:>
*/
#ifndef _BCMOLT_USER_APPL_REMOTE_LOGGER_H_
#define _BCMOLT_USER_APPL_REMOTE_LOGGER_H_
#include <bcmos_system.h>
#include <bcmolt_msg.h>
#define BCMOLT_REMOTE_LOGGER_FILENAME_MAX_LEN 128
/** Possible actions to take when the max log file size is reached. */
typedef enum
{
BCMOLT_REMOTE_LOGGER_FILE_SIZE_REACHED_BEHAVIOR_STOP, /**< Stop the remote logger application. */
BCMOLT_REMOTE_LOGGER_FILE_SIZE_REACHED_BEHAVIOR_CLEAR, /**< Clear all content from the file and continue. */
} bcmolt_remote_logger_file_size_reached_behavior;
/** Configuration for the remote logger application. */
typedef struct
{
uint32_t polling_period_ms; /**< Time to wait in between polling API calls. */
uint32_t subsequent_delay_ms; /**< Minumum required time to wait in between susequent API calls. */
uint32_t max_file_size; /**< Maximum size for the output file in bytes. */
/** Output file full path. */
char filename[BCMOLT_REMOTE_LOGGER_FILENAME_MAX_LEN];
/** Behavior when the max file size is reached. */
bcmolt_remote_logger_file_size_reached_behavior max_file_size_reached_behavior;
} bcmolt_remote_logger_cfg;
/** Initialize the remote logger application (this should be called as part of application startup). */
void bcmolt_remote_logger_appl_init(void);
/** Start the remote logger application.
* \return BCM_ERR_OK if the application was started successfully, <0 otherwise.
*/
bcmos_errno bcmolt_remote_logger_appl_start(bcmolt_devid device);
/** Stop the remote logger application.
* \return BCM_ERR_OK if the application was stopped successfully, <0 otherwise.
*/
bcmos_errno bcmolt_remote_logger_appl_stop(bcmolt_devid device);
/** Query whether the remote logger application is currently running.
* \return BCMOS_TRUE if the application is running, BCMOS_FALSE otherwise.
*/
bcmos_bool bcmolt_remote_logger_appl_is_running(bcmolt_devid device);
/** Get the configuration of the remote logger application.
* \param[out] cfg Remote logger configuration.
* \return BCM_ERR_OK if the configuration was retrieved successfully, <0 otherwise.
*/
bcmos_errno bcmolt_remote_logger_appl_cfg_get(bcmolt_devid device, bcmolt_remote_logger_cfg *cfg);
/** Change the configuration of the remote logger application.
* \param[in] cfg Remote logger configuration.
* \return BCM_ERR_OK if the configuration was updated successfully, <0 otherwise.
*/
bcmos_errno bcmolt_remote_logger_appl_cfg_update(bcmolt_devid device, const bcmolt_remote_logger_cfg *cfg);
#endif