Add multi-device support for BACnet gateway routing (#1279)
* Expanded Object_List to Object_List[MAX_NUM_DEVICES] array to support per-device objects for virtual remote devices * Added multi-device iteration for COV handler, device timer, and intrinsic reporting * Added apps/gateway2 demo application * When MAX_NUM_DEVICES == 1, behavior is identical to the original implementation * Conditional compilation with macros ensures no impact on non-gateway applications --------- Signed-off-by: Hyeongjun Kim <hjun1.kim@samsung.com> Co-authored-by: haemeok-kang <haemeok.kang@samsung.com>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief Header for example gateway (ie, BACnet Router and Devices)
|
||||
* using the BACnet Stack.
|
||||
* @author Tom Brennan <tbrennan3@users.sourceforge.net>
|
||||
* @date 2010
|
||||
* @copyright SPDX-License-Identifier: MIT
|
||||
*/
|
||||
#ifndef BACNET_GATEWAY_H_
|
||||
#define BACNET_GATEWAY_H_
|
||||
|
||||
#include "bacnet/config.h"
|
||||
|
||||
/** @defgroup GatewayDemo Demo of a BACnet virtual gateway (multiple Device).
|
||||
* @ingroup Demos
|
||||
* This is a basic demonstration of a BACnet Router with child devices (ie,
|
||||
* gateway) appearing on a virtual BACnet network behind the Router.
|
||||
* This is an extension of the ServerDemo project.
|
||||
*/
|
||||
|
||||
/* Device configuration definitions. */
|
||||
#define FIRST_DEVICE_NUMBER 260001
|
||||
#define VIRTUAL_DNET 2709 /* your choice of number here */
|
||||
#define DEV_NAME_BASE "Gateway Demo Device"
|
||||
#define DEV_DESCR_GATEWAY "Gateway Device and Router"
|
||||
#define DEV_DESCR_REMOTE "Routed Remote Device"
|
||||
#define VIRTUAL_DEVICE_COUNT 10
|
||||
#define VIRTUAL_DEVICE_INDEX_OFFSET 1
|
||||
|
||||
#if VIRTUAL_DEVICE_COUNT >= MAX_NUM_DEVICES
|
||||
#ifdef _MSC_VER
|
||||
#pragma message( \
|
||||
"VIRTUAL_DEVICE_COUNT >= MAX_NUM_DEVICES, adjusting to MAX_NUM_DEVICES-1")
|
||||
#else
|
||||
#warning \
|
||||
"VIRTUAL_DEVICE_COUNT >= MAX_NUM_DEVICES, adjusting to MAX_NUM_DEVICES-1"
|
||||
#endif
|
||||
#undef VIRTUAL_DEVICE_COUNT
|
||||
#define VIRTUAL_DEVICE_COUNT (MAX_NUM_DEVICES - 1)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user