Files
bacnet_stack/zephyr/subsys/bacnet_basic/bacnet_shell_uptime.c
T
Steve Karg 1e889b633c Added Zephyr settings and basic device in subsys. (#697)
* Added Zephyr settings subsys to enable storing of BACnet values according to BACnet object property value path.

* Added BACnet Basic features to enable basic samples. Refactored the zephyr BACnet profile B-SS sample to use BACnet basic subsys.
2024-07-19 17:12:20 -05:00

39 lines
970 B
C

/**
* @file
* @brief The BACnet shell commands for debugging and testing
* @author Steve Karg <skarg@users.sourceforge.net>
* @date May 2024
* @copyright SPDX-License-Identifier: MIT
*/
#include <stdlib.h>
#include <stdint.h>
#include <errno.h>
#include <zephyr/shell/shell.h>
/* BACnet definitions */
#include "bacnet/bacdef.h"
#include "bacnet/bacdcode.h"
#include "bacnet/bactext.h"
#include "bacnet/bacapp.h"
/* Basic BACnet */
#include "bacnet_basic/bacnet_basic.h"
/**
* @brief Print BACnet uptime statistics
* @param sh Shell
* @param argc Number of arguments
* @param argv Argument list
* @return 0 on success, negative on failure
*/
static int cmd_uptime(const struct shell *sh, size_t argc, char **argv)
{
(void)argc;
(void)argv;
shell_print(sh, "BACnet thread uptime: %ld seconds",
bacnet_basic_uptime_seconds());
return 0;
}
SHELL_SUBCMD_ADD((bacnet), uptime, NULL, "BACnet task uptime", cmd_uptime,
1, 0);