Fix warnings during unit testing of BACnet secure connect node. (#1182)

This commit is contained in:
Steve Karg
2025-12-09 09:34:28 -06:00
committed by GitHub
parent b1c6a0e74b
commit 95cdec459e
39 changed files with 3206 additions and 36179 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
name: BACNet/SC linux tests name: BACnet/SC linux tests
on: on:
push: push:
+4 -3
View File
@@ -1,4 +1,4 @@
name: BACNet/SC macos/bsd tests name: BACnet/SC macOS/BSD tests
on: on:
push: push:
@@ -10,7 +10,7 @@ on:
jobs: jobs:
job_bsc_tests_macos: job_bsc_tests_macos:
runs-on: macOS-latest runs-on: macos-15-intel
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- name: Create Build Environment - name: Create Build Environment
@@ -64,7 +64,8 @@ jobs:
cd build cd build
cmake .. -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@3.0 cmake .. -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@3.0
make make
./test_bsc-node : # not completing on macOS-15
: # ./test_bsc-node
- name: Build and run bsc-datalink test - name: Build and run bsc-datalink test
run: | run: |
cd ./test/bacnet/datalink/bsc-datalink cd ./test/bacnet/datalink/bsc-datalink
+1 -1
View File
@@ -1,4 +1,4 @@
name: BACNet/SC windows tests name: BACnet/SC windows tests
on: on:
workflow_dispatch: workflow_dispatch:
+1 -1
View File
@@ -121,7 +121,7 @@
<ul> <ul>
<li><a href="http://www.cimetrics.com">Cimetrics</a> <li><a href="http://www.cimetrics.com">Cimetrics</a>
<font size="-2"><sup>TM</sup></font> - has a source library <font size="-2"><sup>TM</sup></font> - has a source library
called BACstac/32 as part of their BACNet Protocol Stack called BACstac/32 as part of their BACnet Protocol Stack
SDK.</li> SDK.</li>
<li><a href="http://www.polarsoft.biz">Polarsoft</a> - has a <li><a href="http://www.polarsoft.biz">Polarsoft</a> - has a
protocol stack source library for embedded use called protocol stack source library for embedded use called
+1 -1
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief Implementation of port specific API used in BACNet secure connect. * @brief Implementation of port specific API used in BACnet secure connect.
* @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com> * @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com>
* @date August 2022 * @date August 2022
* @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0 * @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
+1 -1
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief Implementation of port specific API used in BACNet secure connect. * @brief Implementation of port specific API used in BACnet secure connect.
* @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com> * @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com>
* @date August 2022 * @date August 2022
* @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0 * @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
+1 -1
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief Implementation of port specific API used in BACNet secure connect. * @brief Implementation of port specific API used in BACnet secure connect.
* @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com> * @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com>
* @date August 2022 * @date August 2022
* @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0 * @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
+3 -3
View File
@@ -1,4 +1,4 @@
This readme explains how to enable support of BACNet Secure Connect datalink This readme explains how to enable support of BACnet Secure Connect datalink
(ANNEX AB BACnet Secure Connect in standard), how to set up the building (ANNEX AB BACnet Secure Connect in standard), how to set up the building
environment and clarifies some important moments regarding implementation environment and clarifies some important moments regarding implementation
of that functionality. of that functionality.
@@ -7,7 +7,7 @@ By default the support of that functionality is turned off, to enable it
you need to set option BACDL_BSC=ON in CMakeLists.txt if cmake build system you need to set option BACDL_BSC=ON in CMakeLists.txt if cmake build system
is used or set BACDL_BSC=1 define in a case if using makefiles. is used or set BACDL_BSC=1 define in a case if using makefiles.
BACNet/SC standard uses websockets as a transport layer, so Windows/Linux/BSD BACnet/SC standard uses websockets as a transport layer, so Windows/Linux/BSD
implementations use libwebsocket library. Implementation for Zephyr uses implementations use libwebsocket library. Implementation for Zephyr uses
native websocket API for the client side and mongoose library for the native websocket API for the client side and mongoose library for the
server side. Websocket layer which is built on the top of libwebsockets server side. Websocket layer which is built on the top of libwebsockets
@@ -51,4 +51,4 @@ The current implementation does not support Certificate_Signing_Request_File
property of BACNET/SC netport and properties Operational_Certificate_File property of BACNET/SC netport and properties Operational_Certificate_File
and Issuer_Certificate_Files related to certificates are readonly and can't and Issuer_Certificate_Files related to certificates are readonly and can't
be changed remotely. So, management of device certificates is out of the scope be changed remotely. So, management of device certificates is out of the scope
of current BACNet/SC implementation. of current BACnet/SC implementation.
+2 -2
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief Configuration file of BACNet/SC datalink. * @brief Configuration file of BACnet/SC datalink.
* @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com> * @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com>
* @date August 2022 * @date August 2022
* @copyright SPDX-License-Identifier: MIT * @copyright SPDX-License-Identifier: MIT
@@ -58,7 +58,7 @@
#define BSC_CONF_WEBSOCKET_RX_BUFFER_LEN BVLC_SC_NPDU_SIZE_CONF #define BSC_CONF_WEBSOCKET_RX_BUFFER_LEN BVLC_SC_NPDU_SIZE_CONF
#endif #endif
/* THIS should not be changed, most of BACNet/SC devices must have */ /* THIS should not be changed, most of BACnet/SC devices must have */
/* hub connector, it uses 2 connections */ /* hub connector, it uses 2 connections */
#ifndef BSC_CONF_HUB_CONNECTOR_CONNECTIONS_NUM #ifndef BSC_CONF_HUB_CONNECTOR_CONNECTIONS_NUM
#define BSC_CONF_HUB_CONNECTOR_CONNECTIONS_NUM (BSC_CONF_HUB_CONNECTORS_NUM * 2) #define BSC_CONF_HUB_CONNECTOR_CONNECTIONS_NUM (BSC_CONF_HUB_CONNECTORS_NUM * 2)
+4 -4
View File
@@ -191,7 +191,7 @@ bool bsc_init(char *ifname)
/** /**
* @brief Blocking thread-safe bsc_cleanup() function * @brief Blocking thread-safe bsc_cleanup() function
* de-initializes BACNet/SC datalink. * de-initializes BACnet/SC datalink.
*/ */
void bsc_cleanup(void) void bsc_cleanup(void)
{ {
@@ -293,7 +293,7 @@ static void bsc_remove_packet(size_t packet_size)
/** /**
* @brief Blocking thread-safe bsc_receive() function * @brief Blocking thread-safe bsc_receive() function
* receives NPDUs transferred over BACNet/SC * receives NPDUs transferred over BACnet/SC
* from a node specified by it's virtual MAC address as * from a node specified by it's virtual MAC address as
* defined in Clause AB.1.5.2. * defined in Clause AB.1.5.2.
* @param src - source VMAC address * @param src - source VMAC address
@@ -375,7 +375,7 @@ uint16_t bsc_receive(
/** /**
* @brief Function can be used to retrieve broadcast * @brief Function can be used to retrieve broadcast
* VMAC address for BACNet/SC node. * VMAC address for BACnet/SC node.
* @param dest - value of broadcast VMAC address * @param dest - value of broadcast VMAC address
*/ */
void bsc_get_broadcast_address(BACNET_ADDRESS *dest) void bsc_get_broadcast_address(BACNET_ADDRESS *dest)
@@ -392,7 +392,7 @@ void bsc_get_broadcast_address(BACNET_ADDRESS *dest)
/** /**
* @brief Function can be used to retrieve local * @brief Function can be used to retrieve local
* VMAC address of initialized BACNet/SC datalink. * VMAC address of initialized BACnet/SC datalink.
* @param my_address - value of local VMAC address * @param my_address - value of local VMAC address
*/ */
void bsc_get_my_address(BACNET_ADDRESS *my_address) void bsc_get_my_address(BACNET_ADDRESS *my_address)
+19 -19
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief BACNet/SC datalink public interface API. * @brief BACnet/SC datalink public interface API.
* @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com> * @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com>
* @date October 2022 * @date October 2022
* @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0 * @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
@@ -16,10 +16,10 @@
/** /**
* @brief Blocking thread-safe bsc_init() function * @brief Blocking thread-safe bsc_init() function
* initializes BACNet/SC datalink in accordence with value of properties * initializes BACnet/SC datalink in accordence with value of properties
* from BACNet/SC Network Port Object (sc_netport.h). That means that * from BACnet/SC Network Port Object (sc_netport.h). That means that
* user must initialize and set corresponded properties required for * user must initialize and set corresponded properties required for
* configuration of BACNet/SC datalink before calling of that function. * configuration of BACnet/SC datalink before calling of that function.
* According to "Addendum cc" to ANSI/ASHRAE Standard 135-2020 * According to "Addendum cc" to ANSI/ASHRAE Standard 135-2020
* https://bacnet.org/wp-content/uploads/sites/4/2022/08/Add-135-2020cc.pdf * https://bacnet.org/wp-content/uploads/sites/4/2022/08/Add-135-2020cc.pdf
* most important properties are: * most important properties are:
@@ -45,7 +45,7 @@ bool bsc_init(char *ifname);
/** /**
* @brief Blocking thread-safe bsc_cleanup() function * @brief Blocking thread-safe bsc_cleanup() function
* de-initializes BACNet/SC datalink. * de-initializes BACnet/SC datalink.
*/ */
BACNET_STACK_EXPORT BACNET_STACK_EXPORT
void bsc_cleanup(void); void bsc_cleanup(void);
@@ -60,13 +60,13 @@ bool bsc_cert_files_check(uint32_t netport_instance);
/** /**
* @brief Blocking thread-safe bsc_send_pdu() function * @brief Blocking thread-safe bsc_send_pdu() function
* sends pdu over BACNet/SC to node specified by * sends pdu over BACnet/SC to node specified by
* destination address param. * destination address param.
* *
* @param dest [in] BACNet/SC node's virtual MAC address as * @param dest [in] BACnet/SC node's virtual MAC address as
* defined in Clause AB.1.5.2. * defined in Clause AB.1.5.2.
* Can be broadcast. * Can be broadcast.
* @param npdu_data [in] BACNet/SC datalink does not use that * @param npdu_data [in] BACnet/SC datalink does not use that
* parameter. Added for backward * parameter. Added for backward
* compatibility. * compatibility.
* @param pdu [in] protocol data unit to be sent. * @param pdu [in] protocol data unit to be sent.
@@ -83,7 +83,7 @@ int bsc_send_pdu(
/** /**
* @brief Blocking thread-safe bsc_receive() function * @brief Blocking thread-safe bsc_receive() function
* receives NPDUs transferred over BACNet/SC * receives NPDUs transferred over BACnet/SC
* from a node specified by it's virtual MAC address as * from a node specified by it's virtual MAC address as
* defined in Clause AB.1.5.2. * defined in Clause AB.1.5.2.
* *
@@ -101,7 +101,7 @@ uint16_t bsc_receive(
/** /**
* @brief Function can be used to retrieve broadcast * @brief Function can be used to retrieve broadcast
* VMAC address for BACNet/SC node. * VMAC address for BACnet/SC node.
* *
* @param addr [out] Value of broadcast VMAC address. * @param addr [out] Value of broadcast VMAC address.
*/ */
@@ -111,7 +111,7 @@ void bsc_get_broadcast_address(BACNET_ADDRESS *addr);
/** /**
* @brief Function can be used to retrieve local * @brief Function can be used to retrieve local
* VMAC address of initialized BACNet/SC datalink. * VMAC address of initialized BACnet/SC datalink.
* If function called when datalink is not started, * If function called when datalink is not started,
* my_address filled by empty vmac address * my_address filled by empty vmac address
* X'000000000000' as it defined in clause AB.1.5.2 * X'000000000000' as it defined in clause AB.1.5.2
@@ -123,11 +123,11 @@ BACNET_STACK_EXPORT
void bsc_get_my_address(BACNET_ADDRESS *my_address); void bsc_get_my_address(BACNET_ADDRESS *my_address);
/** /**
* @brief Function checks if BACNet/SC direct connection is * @brief Function checks if BACnet/SC direct connection is
* established with remote BACNet/SC node. * established with remote BACnet/SC node.
* User can check the status of connection using either * User can check the status of connection using either
* destination vmac or list of destination urls. * destination vmac or list of destination urls.
* @param dest BACNet/SC vmac of remote node to check direct * @param dest BACnet/SC vmac of remote node to check direct
* connection status. * connection status.
* @param urls this array represents the possible URIs of a * @param urls this array represents the possible URIs of a
* remote node for acceptance of direct connections. * remote node for acceptance of direct connections.
@@ -143,22 +143,22 @@ bool bsc_direct_connection_established(
/** /**
* @brief Function starts process of establishing of a * @brief Function starts process of establishing of a
* direct BACNet/SC connection to node identified by * direct BACnet/SC connection to node identified by
* either urls or dest parameter. User should note that * either urls or dest parameter. User should note that
* if dest parameter is used, local node tries to resolve * if dest parameter is used, local node tries to resolve
* it (e.g.to get URIs related to dest vmac from all existent * it (e.g.to get URIs related to dest vmac from all existent
* BACNet/SC nodes in network). As a result the process of * BACnet/SC nodes in network). As a result the process of
* establishing of a BACNet/SC connection by dest may * establishing of a BACnet/SC connection by dest may
* take unpredictable amount of time depending on a current * take unpredictable amount of time depending on a current
* network configuration. * network configuration.
* @param dest BACNet/SC vmac of remote node to check direct * @param dest BACnet/SC vmac of remote node to check direct
* connection status. * connection status.
* @param urls this array represents the possible URIs of a * @param urls this array represents the possible URIs of a
* remote node for acceptance of direct connections. * remote node for acceptance of direct connections.
* Can contain 1 elem. * Can contain 1 elem.
* @param urls_cnt - size of urls array. * @param urls_cnt - size of urls array.
* *
* @return BSC_SC_SUCCESS if process of a establishing of a BACNet/SC * @return BSC_SC_SUCCESS if process of a establishing of a BACnet/SC
* connection was started successfully, otherwise returns * connection was started successfully, otherwise returns
* any retcode from BSC_SC_RET enum. * any retcode from BSC_SC_RET enum.
*/ */
+2 -2
View File
@@ -1,8 +1,8 @@
/** /**
* @file * @file
* @brief BACNet secure connect hub connector API. * @brief BACnet secure connect hub connector API.
* In general, user should not use that API directly, * In general, user should not use that API directly,
* BACNet/SC datalink API should be used. * BACnet/SC datalink API should be used.
* @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com> * @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com>
* @date July 2022 * @date July 2022
* @copyright SPDX-License-Identifier: MIT * @copyright SPDX-License-Identifier: MIT
+1 -1
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief BACNet hub function API. * @brief BACnet hub function API.
* @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com> * @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com>
* @date July 2022 * @date July 2022
* @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0 * @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
+2 -2
View File
@@ -1,8 +1,8 @@
/** /**
* @file * @file
* @brief BACNet secure connect hub function API. * @brief BACnet secure connect hub function API.
* In general, user should not use that API directly, * In general, user should not use that API directly,
* BACNet/SC datalink API should be used. * BACnet/SC datalink API should be used.
* @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com> * @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com>
* @date July 2022 * @date July 2022
* @copyright SPDX-License-Identifier: MIT * @copyright SPDX-License-Identifier: MIT
+1 -1
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief BACNet secure connect node switch function API. * @brief BACnet secure connect node switch function API.
* @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com> * @author Kirill Neznamov <kirill.neznamov@dsr-corporation.com>
* @date October 2022 * @date October 2022
* @copyright SPDX-License-Identifier: GPL-2\.0-or-later WITH GCC-exception-2.0 * @copyright SPDX-License-Identifier: GPL-2\.0-or-later WITH GCC-exception-2.0
+2 -2
View File
@@ -1,8 +1,8 @@
/** /**
* @file * @file
* @brief BACNet secure connect node switch function API. * @brief BACnet secure connect node switch function API.
* In general, user should not use that API directly, * In general, user should not use that API directly,
* BACNet/SC datalink API should be used. * BACnet/SC datalink API should be used.
* @author Kirill Neznamov <kirill\.neznamov@dsr-corporation\.com> * @author Kirill Neznamov <kirill\.neznamov@dsr-corporation\.com>
* @date October 2022 * @date October 2022
* @copyright SPDX-License-Identifier: MIT * @copyright SPDX-License-Identifier: MIT
+1 -1
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief BACNet secure connect node API. * @brief BACnet secure connect node API.
* @author Kirill Neznamov <kirill\.neznamov@dsr-corporation\.com> * @author Kirill Neznamov <kirill\.neznamov@dsr-corporation\.com>
* @date October 2022 * @date October 2022
* @copyright SPDX-License-Identifier: MIT * @copyright SPDX-License-Identifier: MIT
+2 -2
View File
@@ -1,8 +1,8 @@
/** /**
* @file * @file
* @brief BACNet secure connect node API. * @brief BACnet secure connect node API.
* In general, user should not use that API directly, * In general, user should not use that API directly,
* BACNet/SC datalink API should be used. * BACnet/SC datalink API should be used.
* @author Kirill Neznamov <kirill\.neznamov@dsr-corporation\.com> * @author Kirill Neznamov <kirill\.neznamov@dsr-corporation\.com>
* @date October 2022 * @date October 2022
* @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0 * @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
+1 -1
View File
@@ -1,6 +1,6 @@
/** /**
* @file * @file
* @brief BACNet secure connect main include header. * @brief BACnet secure connect main include header.
* @author Kirill Neznamov <kirill\.neznamov@dsr-corporation\.com> * @author Kirill Neznamov <kirill\.neznamov@dsr-corporation\.com>
* @date August 2022 * @date August 2022
* @copyright SPDX-License-Identifier: MIT * @copyright SPDX-License-Identifier: MIT
+1 -1
View File
@@ -1,7 +1,7 @@
/** /**
* @file * @file
* @brief BACNet secure connect API. * @brief BACnet secure connect API.
* @author Kirill Neznamov <kirill\.neznamov@dsr-corporation\.com> * @author Kirill Neznamov <kirill\.neznamov@dsr-corporation\.com>
* @date May 2022 * @date May 2022
* @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0 * @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
+7 -7
View File
@@ -1,8 +1,8 @@
/** /**
* @file * @file
* @brief BACNet secure connect socket API. * @brief BACnet secure connect socket API.
* In general, user should not use that API directly, * In general, user should not use that API directly,
* BACNet/SC datalink API should be used. * BACnet/SC datalink API should be used.
* @author Kirill Neznamov <kirill\.neznamov@dsr-corporation\.com> * @author Kirill Neznamov <kirill\.neznamov@dsr-corporation\.com>
* @date December 2022 * @date December 2022
* @copyright SPDX-License-Identifier: MIT * @copyright SPDX-License-Identifier: MIT
@@ -217,7 +217,7 @@ void bsc_deinit_ctx(BSC_SOCKET_CTX *ctx);
/** /**
* @brief bsc_connect() function starts connect operation for a * @brief bsc_connect() function starts connect operation for a
* specified BACNet socket. The function call be called only * specified BACnet socket. The function call be called only
* for initiator context otherwise BSC_SC_INVALID_OPERATION * for initiator context otherwise BSC_SC_INVALID_OPERATION
* error is returned. As a result if bsc_connect() was * error is returned. As a result if bsc_connect() was
* succeeded for given param c, that leads to emitting of * succeeded for given param c, that leads to emitting of
@@ -231,7 +231,7 @@ void bsc_deinit_ctx(BSC_SOCKET_CTX *ctx);
* event is emitted. * event is emitted.
* *
* @param ctx - socket context. * @param ctx - socket context.
* @param c - BACNet socket descriptor . * @param c - BACnet socket descriptor .
* @param url - url to connect to. For example: wss://example.com:8080. * @param url - url to connect to. For example: wss://example.com:8080.
* *
* @return error code from BSC_SC_RET enum. * @return error code from BSC_SC_RET enum.
@@ -254,11 +254,11 @@ void bsc_disconnect(BSC_SOCKET *c);
/** /**
* @brief bsc_send() function schedules transmitting of pdu to * @brief bsc_send() function schedules transmitting of pdu to
* another BACNet socket. The function may be used only * another BACnet socket. The function may be used only
* when the socket is in a connected state * when the socket is in a connected state
* otherwise BSC_SC_INVALID_OPERATION error is returned. * otherwise BSC_SC_INVALID_OPERATION error is returned.
* *
* @param c - BACNet socket descriptor initialized by bsc_accept() or * @param c - BACnet socket descriptor initialized by bsc_accept() or
* bsc_connect() calls. * bsc_connect() calls.
* @param pdu - pointer to a data to send. * @param pdu - pointer to a data to send.
* @param pdu_len - size in bytes of data to send. * @param pdu_len - size in bytes of data to send.
@@ -288,7 +288,7 @@ void bsc_socket_maintenance_timer(uint16_t seconds);
* @brief bsc_socket_get_peer_addr() function gets information * @brief bsc_socket_get_peer_addr() function gets information
* about remote peer address only for socket with acceptor cotext. * about remote peer address only for socket with acceptor cotext.
* *
* @param c - BACNet socket descriptor initialized by bsc_accept() call. * @param c - BACnet socket descriptor initialized by bsc_accept() call.
* @param data - pointer to a struct holding address information. * @param data - pointer to a struct holding address information.
* @param pdu_len - size in bytes of data to send. * @param pdu_len - size in bytes of data to send.
* *
+49 -49
View File
@@ -152,7 +152,7 @@ static bool bvlc_sc_validate_options_headers(
if (option == BVLC_SC_OPTION_TYPE_SECURE_PATH) { if (option == BVLC_SC_OPTION_TYPE_SECURE_PATH) {
if (validation_type == BACNET_PDU_DEST_OPTION_VALIDATION) { if (validation_type == BACNET_PDU_DEST_OPTION_VALIDATION) {
/* According BACNet standard secure path header option can be /* According BACnet standard secure path header option can be
added only to data options. (AB.2.3.1 Secure Path Header added only to data options. (AB.2.3.1 Secure Path Header
Option) */ Option) */
*error_code = ERROR_CODE_HEADER_ENCODING_ERROR; *error_code = ERROR_CODE_HEADER_ENCODING_ERROR;
@@ -274,7 +274,7 @@ static size_t bvlc_sc_add_option(
if (!to_data_option && if (!to_data_option &&
(sc_option[0] & BVLC_SC_HEADER_OPTION_TYPE_MASK) == (sc_option[0] & BVLC_SC_HEADER_OPTION_TYPE_MASK) ==
BVLC_SC_OPTION_TYPE_SECURE_PATH) { BVLC_SC_OPTION_TYPE_SECURE_PATH) {
/* According BACNet standard secure path header option can be added /* According BACnet standard secure path header option can be added
only to data options. (AB.2.3.1 Secure Path Header Option) */ only to data options. (AB.2.3.1 Secure Path Header Option) */
return 0; return 0;
} }
@@ -408,7 +408,7 @@ size_t bvlc_sc_add_option_to_data_options(
/** /**
* @brief Function encodes proprietary header option in correspondence * @brief Function encodes proprietary header option in correspondence
* of BACNet standard AB.2.3.2 Proprietary Header Options. * of BACnet standard AB.2.3.2 Proprietary Header Options.
* Any proprietary header option shall consist of the * Any proprietary header option shall consist of the
* following fields: * following fields:
* *
@@ -479,7 +479,7 @@ size_t bvlc_sc_encode_proprietary_option(
/** /**
* @brief Function encodes security path header option in correspondence * @brief Function encodes security path header option in correspondence
* of BACNet standard AB.2.3.1 Secure Path Header Option. * of BACnet standard AB.2.3.1 Secure Path Header Option.
* Any proprietary header option shall consist of the * Any proprietary header option shall consist of the
* following fields: * following fields:
* *
@@ -605,7 +605,7 @@ static void bvlc_sc_decode_proprietary_option(
/** /**
* @brief encode BVLC-SC header * @brief encode BVLC-SC header
* *
* BACNet standard AB.2.2 BVLC-SC Header Format: * BACnet standard AB.2.2 BVLC-SC Header Format:
* BVLC Function 1-octet BVLC function code * BVLC Function 1-octet BVLC function code
* Control Flags 1-octet Control flags * Control Flags 1-octet Control flags
* Message ID 2-octets Message identifier * Message ID 2-octets Message identifier
@@ -659,7 +659,7 @@ static size_t bvlc_sc_encode_common(
} }
/** /**
* @brief Function encodes the BVLC-Result message according BACNet standard * @brief Function encodes the BVLC-Result message according BACnet standard
* AB.2.4.1 BVLC-Result Format. * AB.2.4.1 BVLC-Result Format.
* *
* BVLC Function 1-octet (X'00') BVLC-Result * BVLC Function 1-octet (X'00') BVLC-Result
@@ -811,7 +811,7 @@ size_t bvlc_sc_encode_result(
} }
/** /**
* @brief Function decodes the BVLC-Result message according BACNet standard * @brief Function decodes the BVLC-Result message according BACnet standard
* AB.2.4.1 BVLC-Result Format. * AB.2.4.1 BVLC-Result Format.
* @param payload - pointer to the decoded data * @param payload - pointer to the decoded data
* @param packed_payload - pointer to the packed data * @param packed_payload - pointer to the packed data
@@ -907,7 +907,7 @@ static bool bvlc_sc_decode_result(
/** /**
* @brief Function encodes the Encapsulated-NPDU message according * @brief Function encodes the Encapsulated-NPDU message according
* BACNet standard AB.2.5 Encapsulated-NPDU. * BACnet standard AB.2.5 Encapsulated-NPDU.
* *
* BVLC Function 1-octet (X'01') Encapsulated-NPDU * BVLC Function 1-octet (X'01') Encapsulated-NPDU
* Control Flags 1-octet Control flags. * Control Flags 1-octet Control flags.
@@ -959,7 +959,7 @@ size_t bvlc_sc_encode_encapsulated_npdu(
} }
/** /**
* @brief Function encodes the Address-Resolution message according BACNet * @brief Function encodes the Address-Resolution message according BACnet
* standard AB.2.6 Address-Resolution * standard AB.2.6 Address-Resolution
* *
* BVLC Function 1-octet (X'02') Address-Resolution * BVLC Function 1-octet (X'02') Address-Resolution
@@ -998,7 +998,7 @@ size_t bvlc_sc_encode_address_resolution(
/** /**
* @brief Function encodes the Address-Resolution-ACK message according * @brief Function encodes the Address-Resolution-ACK message according
* BACNet standard AB.2.7.1 Address-Resolution-ACK Format. * BACnet standard AB.2.7.1 Address-Resolution-ACK Format.
* *
* BVLC Function 1-octet (X'03') Address-Resolution-ACK * BVLC Function 1-octet (X'03') Address-Resolution-ACK
* Control Flags 1-octet Control flags. * Control Flags 1-octet Control flags.
@@ -1061,7 +1061,7 @@ size_t bvlc_sc_encode_address_resolution_ack(
/** /**
* @brief Function encodes the Advertisement message according * @brief Function encodes the Advertisement message according
* BACNet standard AB.2.8.1 Advertisement Format. * BACnet standard AB.2.8.1 Advertisement Format.
* *
* BVLC Function 1-octet (X'04') Advertisement * BVLC Function 1-octet (X'04') Advertisement
* Control Flags 1-octet Control flags. * Control Flags 1-octet Control flags.
@@ -1133,7 +1133,7 @@ size_t bvlc_sc_encode_advertisiment(
/** /**
* @brief Function encodes the Advertisement-Solicitation message according * @brief Function encodes the Advertisement-Solicitation message according
* BACNet standard AB.2.9.1 Advertisement-Solicitation Format. * BACnet standard AB.2.9.1 Advertisement-Solicitation Format.
* @param payload - pointer to the decoded data * @param payload - pointer to the decoded data
* @param packed_payload - pointer to packed data * @param packed_payload - pointer to packed data
* @param packed_payload_len - size of packed data * @param packed_payload_len - size of packed data
@@ -1189,7 +1189,7 @@ static bool bvlc_sc_decode_advertisiment(
/** /**
* @brief Function encodes the Advertisement-Solicitation message according * @brief Function encodes the Advertisement-Solicitation message according
* BACNet standard AB.2.9.1 Advertisement-Solicitation Format. * BACnet standard AB.2.9.1 Advertisement-Solicitation Format.
* *
* BVLC Function 1-octet (X'05') Advertisement * BVLC Function 1-octet (X'05') Advertisement
* Control Flags 1-octet Control flags. * Control Flags 1-octet Control flags.
@@ -1227,7 +1227,7 @@ size_t bvlc_sc_encode_advertisiment_solicitation(
/** /**
* @brief Function encodes the Connect-Request message according * @brief Function encodes the Connect-Request message according
* BACNet standard AB.2.10.1 Connect-Request Format. * BACnet standard AB.2.10.1 Connect-Request Format.
* *
* BVLC Function 1-octet (X'06') Advertisement * BVLC Function 1-octet (X'06') Advertisement
* Control Flags 1-octet Control flags. * Control Flags 1-octet Control flags.
@@ -1302,7 +1302,7 @@ size_t bvlc_sc_encode_connect_request(
/** /**
* @brief Function decodes the Connect-Request message according * @brief Function decodes the Connect-Request message according
* BACNet standard AB.2.10.1 Connect-Request Format. * BACnet standard AB.2.10.1 Connect-Request Format.
* @param payload - pointer to the decoded data * @param payload - pointer to the decoded data
* @param packed_payload - pointer to the packed data * @param packed_payload - pointer to the packed data
* @param packed_payload_len - size of the packed data * @param packed_payload_len - size of the packed data
@@ -1346,7 +1346,7 @@ static bool bvlc_sc_decode_connect_request(
/** /**
* @brief Function encodes the Connect-Accept message according * @brief Function encodes the Connect-Accept message according
* BACNet standard AB.2.11.1 Connect-Accept Format. * BACnet standard AB.2.11.1 Connect-Accept Format.
* *
* BVLC Function 1-octet (X'07') Advertisement * BVLC Function 1-octet (X'07') Advertisement
* Control Flags 1-octet Control flags. * Control Flags 1-octet Control flags.
@@ -1421,7 +1421,7 @@ size_t bvlc_sc_encode_connect_accept(
/** /**
* @brief Function decodes the Connect-Accept message according * @brief Function decodes the Connect-Accept message according
* BACNet standard AB.2.11.1 Connect-Accept Format. * BACnet standard AB.2.11.1 Connect-Accept Format.
* @param payload - pointer to the decoded data * @param payload - pointer to the decoded data
* @param packed_payload - pointer to the packed data * @param packed_payload - pointer to the packed data
* @param packed_payload_len - size of the packed data * @param packed_payload_len - size of the packed data
@@ -1466,7 +1466,7 @@ static bool bvlc_sc_decode_connect_accept(
/** /**
* @brief Function encodes the Disconnect-Request message according * @brief Function encodes the Disconnect-Request message according
* BACNet standard AB.2.12.1 Disconnect-Request Format. * BACnet standard AB.2.12.1 Disconnect-Request Format.
* *
* BVLC Function 1-octet (X'08') Advertisement * BVLC Function 1-octet (X'08') Advertisement
* Control Flags 1-octet Control flags. * Control Flags 1-octet Control flags.
@@ -1497,7 +1497,7 @@ size_t bvlc_sc_encode_disconnect_request(
/** /**
* @brief Function encodes the Disconnect-ACK message according * @brief Function encodes the Disconnect-ACK message according
* BACNet standard AB.2.13.1 Disconnect-ACK Format. * BACnet standard AB.2.13.1 Disconnect-ACK Format.
* *
* BVLC Function 1-octet (X'09') Advertisement * BVLC Function 1-octet (X'09') Advertisement
* Control Flags 1-octet Control flags. * Control Flags 1-octet Control flags.
@@ -1528,7 +1528,7 @@ bvlc_sc_encode_disconnect_ack(uint8_t *pdu, size_t pdu_len, uint16_t message_id)
/** /**
* @brief Function encodes the Heartbeat-Request message according * @brief Function encodes the Heartbeat-Request message according
* BACNet standard AB.2.14.1 Heartbeat-Request Format. * BACnet standard AB.2.14.1 Heartbeat-Request Format.
* *
* BVLC Function 1-octet (X'0A') Advertisement * BVLC Function 1-octet (X'0A') Advertisement
* Control Flags 1-octet Control flags. * Control Flags 1-octet Control flags.
@@ -1559,7 +1559,7 @@ size_t bvlc_sc_encode_heartbeat_request(
/** /**
* @brief Function encodes the Heartbeat-ACK message according * @brief Function encodes the Heartbeat-ACK message according
* BACNet standard AB.2.15.1 Heartbeat-ACK Format. * BACnet standard AB.2.15.1 Heartbeat-ACK Format.
* *
* BVLC Function 1-octet (X'0B') Advertisement * BVLC Function 1-octet (X'0B') Advertisement
* Control Flags 1-octet Control flags. * Control Flags 1-octet Control flags.
@@ -1589,7 +1589,7 @@ bvlc_sc_encode_heartbeat_ack(uint8_t *pdu, size_t pdu_len, uint16_t message_id)
} }
/** /**
* @brief Function encodes the Proprietary Message according BACNet standard * @brief Function encodes the Proprietary Message according BACnet standard
* AB.2.16.1 Proprietary Message Format. * AB.2.16.1 Proprietary Message Format.
* *
* BVLC Function 1-octet (X'0C') Proprietary-Message. * BVLC Function 1-octet (X'0C') Proprietary-Message.
@@ -1660,7 +1660,7 @@ size_t bvlc_sc_encode_proprietary_message(
} }
/** /**
* @brief Function decodes the Proprietary Message according BACNet standard * @brief Function decodes the Proprietary Message according BACnet standard
* AB.2.16.1 Proprietary Message Format. * AB.2.16.1 Proprietary Message Format.
* @param payload - pointer to the decoded data * @param payload - pointer to the decoded data
* @param packed_payload - pointer to the packed data * @param packed_payload - pointer to the packed data
@@ -1872,10 +1872,10 @@ bvlc_sc_decode_data_options_if_exists(BVLC_SC_DECODED_MESSAGE *message)
} }
/** /**
* @brief Function decodes BACNet/SC message. * @brief Function decodes BACnet/SC message.
* *
* @param buf - A buffer which holds BACNet/SC PDU. * @param buf - A buffer which holds BACnet/SC PDU.
* @param buf_len - length of a buffer which holds BACNet/SC PDU. * @param buf_len - length of a buffer which holds BACnet/SC PDU.
* @param message- pointer to structure for decoded data. * @param message- pointer to structure for decoded data.
* @param error-code - the value of parameter is filled if function returns * @param error-code - the value of parameter is filled if function returns
* false. Check BACNET_ERROR_CLASS enum. * false. Check BACNET_ERROR_CLASS enum.
@@ -2164,13 +2164,13 @@ bool bvlc_sc_decode_message(
} }
/** /**
* @brief Function removes destination address of BACNet/SC message * @brief Function removes destination address of BACnet/SC message
* and sets originating address instead of it. * and sets originating address instead of it.
* It does it job only if message has destination address * It does it job only if message has destination address
* and does not have origination address, otherwise pdu * and does not have origination address, otherwise pdu
* stays unchanged. * stays unchanged.
* @param pdu - BACNet/SC PDU. * @param pdu - BACnet/SC PDU.
* @param pdu_len - length of a buffer which holds BACNet/SC PDU. * @param pdu_len - length of a buffer which holds BACnet/SC PDU.
* @param orig- origination vmac. * @param orig- origination vmac.
*/ */
void bvlc_sc_remove_dest_set_orig( void bvlc_sc_remove_dest_set_orig(
@@ -2188,11 +2188,11 @@ void bvlc_sc_remove_dest_set_orig(
} }
/** /**
* @brief Function changes or adds originating address into BACNet/SC message. * @brief Function changes or adds originating address into BACnet/SC message.
* It is assumed that ppdu points to buffer with pdu that has * It is assumed that ppdu points to buffer with pdu that has
* BSC_PRE bytes behind. * BSC_PRE bytes behind.
* @param ppdu - pointer to buffer which holds BACNet/SC PDU. * @param ppdu - pointer to buffer which holds BACnet/SC PDU.
* @param pdu_len - length of a buffer which holds BACNet/SC PDU. * @param pdu_len - length of a buffer which holds BACnet/SC PDU.
* @param orig- origination vmac. * @param orig- origination vmac.
* @return new pdu length if function succeeded and ppdu points to beginning of * @return new pdu length if function succeeded and ppdu points to beginning of
* changed pdu, otherwise returns old pdu_len and ppdu is not changed. * changed pdu, otherwise returns old pdu_len and ppdu is not changed.
@@ -2238,10 +2238,10 @@ bool bvlc_sc_is_vmac_broadcast(BACNET_SC_VMAC_ADDRESS *vmac)
/** /**
* @brief Function checks if it is needed to send BVLC result * @brief Function checks if it is needed to send BVLC result
* response message for given decoded BACNet/SC message. * response message for given decoded BACnet/SC message.
* In a case of errors, standard requires to send such kind * In a case of errors, standard requires to send such kind
* of responses for unicast messages of specific types. * of responses for unicast messages of specific types.
* @param dm - pointer to decoded BACNet/SC message. * @param dm - pointer to decoded BACnet/SC message.
* @return true if vmac is broadcast, otherwise returns false. * @return true if vmac is broadcast, otherwise returns false.
*/ */
bool bvlc_sc_need_send_bvlc_result(BVLC_SC_DECODED_MESSAGE *dm) bool bvlc_sc_need_send_bvlc_result(BVLC_SC_DECODED_MESSAGE *dm)
@@ -2261,11 +2261,11 @@ bool bvlc_sc_need_send_bvlc_result(BVLC_SC_DECODED_MESSAGE *dm)
} }
/** /**
* @brief Function checks if destination address of input BACNet/SC * @brief Function checks if destination address of input BACnet/SC
* message is broadcast. * message is broadcast.
* @param pdu- buffer with BACNet/SC message. * @param pdu- buffer with BACnet/SC message.
* @param pdu_len- length of buffer of BACNet/SC message. * @param pdu_len- length of buffer of BACnet/SC message.
* @return true if destination address of input BACNet/SC * @return true if destination address of input BACnet/SC
* is broadcast, otherwise returns false. * is broadcast, otherwise returns false.
*/ */
bool bvlc_sc_pdu_has_dest_broadcast(uint8_t *pdu, size_t pdu_len) bool bvlc_sc_pdu_has_dest_broadcast(uint8_t *pdu, size_t pdu_len)
@@ -2286,12 +2286,12 @@ bool bvlc_sc_pdu_has_dest_broadcast(uint8_t *pdu, size_t pdu_len)
} }
/** /**
* @brief Function checks if input BACNet/SC message has * @brief Function checks if input BACnet/SC message has
* destination address field. * destination address field.
* @param pdu- buffer with BACNet/SC message. * @param pdu- buffer with BACnet/SC message.
* @param pdu_len- length of buffer of BACNet/SC message. * @param pdu_len- length of buffer of BACnet/SC message.
* @return true if destination address is presented in * @return true if destination address is presented in
* input BACNet/SC message, otherwise returns false. * input BACnet/SC message, otherwise returns false.
*/ */
bool bvlc_sc_pdu_has_no_dest(uint8_t *pdu, size_t pdu_len) bool bvlc_sc_pdu_has_no_dest(uint8_t *pdu, size_t pdu_len)
{ {
@@ -2305,10 +2305,10 @@ bool bvlc_sc_pdu_has_no_dest(uint8_t *pdu, size_t pdu_len)
/** /**
* @brief Function puts destination address of * @brief Function puts destination address of
* BACNet/SC message into vmac if message * BACnet/SC message into vmac if message
* contains it. * contains it.
* @param pdu- buffer with BACNet/SC message. * @param pdu- buffer with BACnet/SC message.
* @param pdu_len- length of buffer of BACNet/SC message. * @param pdu_len- length of buffer of BACnet/SC message.
* @return true if destination address is presented and was * @return true if destination address is presented and was
* placed into vmac, otherwise returns false. * placed into vmac, otherwise returns false.
*/ */
@@ -2332,13 +2332,13 @@ bool bvlc_sc_pdu_get_dest(
/** /**
* @brief Function removes originating and destination * @brief Function removes originating and destination
* address fields from input BACNet/SC message. * address fields from input BACnet/SC message.
* @param ppdu- pointer to buffer of BACNet/SC message. * @param ppdu- pointer to buffer of BACnet/SC message.
* @param pdu_len- length of buffer of BACNet/SC message. * @param pdu_len- length of buffer of BACnet/SC message.
* @return new length of changed pdu if originating or destination * @return new length of changed pdu if originating or destination
* addresses were removed or old pdu length if * addresses were removed or old pdu length if
* pdu was not changed. If pdu was changed, ppdu contains * pdu was not changed. If pdu was changed, ppdu contains
* updated pointer to buffer to modified BACNet/SC message. * updated pointer to buffer to modified BACnet/SC message.
*/ */
size_t bvlc_sc_remove_orig_and_dest(uint8_t **ppdu, size_t pdu_len) size_t bvlc_sc_remove_orig_and_dest(uint8_t **ppdu, size_t pdu_len)
{ {
+2 -2
View File
@@ -31,7 +31,7 @@
#if !defined(USER_DEFINED_BVLC_SC_HEADER_OPTION_MAX) #if !defined(USER_DEFINED_BVLC_SC_HEADER_OPTION_MAX)
#define BVLC_SC_HEADER_OPTION_MAX \ #define BVLC_SC_HEADER_OPTION_MAX \
4 /* though BACNet standard does not limit number of option headers \ 4 /* though BACnet standard does not limit number of option headers \
the implementation defines max value */ the implementation defines max value */
#else #else
#define BVLC_SC_HEADER_OPTION_MAX USER_DEFINED_BVLC_SC_HEADER_OPTION_MAX #define BVLC_SC_HEADER_OPTION_MAX USER_DEFINED_BVLC_SC_HEADER_OPTION_MAX
@@ -39,7 +39,7 @@
#if BVLC_SC_NPDU_SIZE > BVLC_SC_NPDU_MAX_SIZE #if BVLC_SC_NPDU_SIZE > BVLC_SC_NPDU_MAX_SIZE
#error \ #error \
"Maximum NPDU Length on BACNet/SC Data Link must be <= BVLC_SC_NPDU_MAX_SIZE" "Maximum NPDU Length on BACnet/SC Data Link must be <= BVLC_SC_NPDU_MAX_SIZE"
#endif #endif
/* /*
+5 -5
View File
@@ -144,10 +144,10 @@ typedef void (*BSC_WEBSOCKET_SRV_DISPATCH)(
* BSC_WEBSOCKET_CONNECTED in a case if connection established successfully or * BSC_WEBSOCKET_CONNECTED in a case if connection established successfully or
* BSC_WEBSOCKET_DISCONNECTED if connection attempt failed. * BSC_WEBSOCKET_DISCONNECTED if connection attempt failed.
* *
* @param type - type of BACNet/SC connection, check * @param type - type of BACnet/SC connection, check
* BSC_WEBSOCKET_CONNECTION_TYPE enum. According BACNet standard * BSC_WEBSOCKET_CONNECTION_TYPE enum. According BACnet standard
* different type of connections require different websocket protocols. * different type of connections require different websocket protocols.
* @param url - BACNet/SC server URL. For example: wss://example.com:8080. * @param url - BACnet/SC server URL. For example: wss://example.com:8080.
* @param ca_cert - pointer to certificate authority (CA) cert in PEM or DER * @param ca_cert - pointer to certificate authority (CA) cert in PEM or DER
* format. * format.
* @param ca_cert_size - size in bytes of CA cert. * @param ca_cert_size - size in bytes of CA cert.
@@ -253,13 +253,13 @@ BSC_WEBSOCKET_RET bws_cli_dispatch_send(
/** /**
* @brief Asynchronous bws_srv_start() function triggers process of * @brief Asynchronous bws_srv_start() function triggers process of
* starting of a websocket server on a specified port for specified * starting of a websocket server on a specified port for specified
* BACNet websocket protocol. At present time peer can have only 2 * BACnet websocket protocol. At present time peer can have only 2
* instances of server: onerelates to BSC_WEBSOCKET_HUB_PROTOCOL and * instances of server: onerelates to BSC_WEBSOCKET_HUB_PROTOCOL and
* the other to BSC_WEBSOCKET_HUB_PROTOCOL. When process completes, * the other to BSC_WEBSOCKET_HUB_PROTOCOL. When process completes,
* dispatch_func() is called with BSC_WEBSOCKET_SERVER_STARTED * dispatch_func() is called with BSC_WEBSOCKET_SERVER_STARTED
* event. * event.
* *
* @param proto - type of BACNet websocket protocol defined in * @param proto - type of BACnet websocket protocol defined in
* BSC_WEBSOCKET_PROTOCOL enum. * BSC_WEBSOCKET_PROTOCOL enum.
* @param port - port number. * @param port - port number.
* @param iface - name of interface to bind to. If the parameter is NULL * @param iface - name of interface to bind to. If the parameter is NULL
+2 -2
View File
@@ -30,7 +30,7 @@ void bacapp_timestamp_sequence_set(BACNET_TIMESTAMP *dest, uint16_t sequenceNum)
* from a time structure. * from a time structure.
* *
* @param dest Pointer to the destination time stamp structure. * @param dest Pointer to the destination time stamp structure.
* @param btime Pointer to the BACNet time structure. * @param btime Pointer to the BACnet time structure.
*/ */
void bacapp_timestamp_time_set(BACNET_TIMESTAMP *dest, const BACNET_TIME *btime) void bacapp_timestamp_time_set(BACNET_TIMESTAMP *dest, const BACNET_TIME *btime)
{ {
@@ -44,7 +44,7 @@ void bacapp_timestamp_time_set(BACNET_TIMESTAMP *dest, const BACNET_TIME *btime)
* from a date/time structure. * from a date/time structure.
* *
* @param dest Pointer to the destination time stamp structure. * @param dest Pointer to the destination time stamp structure.
* @param bdateTime Pointer to the BACNet date/time structure. * @param bdateTime Pointer to the BACnet date/time structure.
*/ */
void bacapp_timestamp_datetime_set( void bacapp_timestamp_datetime_set(
BACNET_TIMESTAMP *dest, const BACNET_DATE_TIME *bdateTime) BACNET_TIMESTAMP *dest, const BACNET_DATE_TIME *bdateTime)
@@ -29,6 +29,7 @@ add_compile_definitions(
CONFIG_ZTEST=1 CONFIG_ZTEST=1
MAX_BACFILES=4 MAX_BACFILES=4
BACFILE=1 BACFILE=1
BACNET_STACK_DEPRECATED_DISABLE=1
BSC_CONF_WSURL_MAX_LEN=128 BSC_CONF_WSURL_MAX_LEN=128
BSC_CONF_WEBSOCKET_ERR_DESC_STR_MAX_LEN=128 BSC_CONF_WEBSOCKET_ERR_DESC_STR_MAX_LEN=128
BSC_CONF_HUB_FUNCTION_CONNECTIONS_NUM=3 BSC_CONF_HUB_FUNCTION_CONNECTIONS_NUM=3
@@ -54,7 +55,7 @@ include_directories(
if(ZEPHYR_BASE) if(ZEPHYR_BASE)
message(FATAL_ERROR "ZEPHYR_BASE env variable defined. Use zephyr/CMakeLists.txt for Zephyr build") message(FATAL_ERROR "ZEPHYR_BASE env variable defined. Use zephyr/CMakeLists.txt for Zephyr build")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
message(STATUS "BACNet/SC datalink test: building for linux") message(STATUS "BACnet/SC datalink test: building for linux")
set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/linux) set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/linux)
add_compile_definitions(BACNET_PORT=linux) add_compile_definitions(BACNET_PORT=linux)
find_package(libwebsockets CONFIG REQUIRED) find_package(libwebsockets CONFIG REQUIRED)
@@ -75,7 +76,7 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
-Wno-language-extension-token -Wno-language-extension-token
) )
elseif(WIN32) elseif(WIN32)
message(STATUS "BACNet/SC datalink test: building for win32") message(STATUS "BACnet/SC datalink test: building for win32")
set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/win32) set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/win32)
add_compile_definitions(BACNET_PORT=win32) add_compile_definitions(BACNET_PORT=win32)
add_compile_definitions(BACNET_STACK_STATIC_DEFINE) add_compile_definitions(BACNET_STACK_STATIC_DEFINE)
@@ -121,7 +122,7 @@ elseif(WIN32)
) )
elseif(APPLE) elseif(APPLE)
message(STATUS "BACNet/SC datalink test: building for APPLE") message(STATUS "BACnet/SC datalink test: building for APPLE")
set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/bsd) set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/bsd)
execute_process ( execute_process (
COMMAND bash -c "brew --prefix openssl" COMMAND bash -c "brew --prefix openssl"
File diff suppressed because it is too large Load Diff
+5 -4
View File
@@ -27,7 +27,8 @@ set(ZTST_DIR "${TST_DIR}/ztest/src")
add_compile_definitions( add_compile_definitions(
BIG_ENDIAN=0 BIG_ENDIAN=0
CONFIG_ZTEST=1 CONFIG_ZTEST=1
BACDL_BSC BACNET_STACK_DEPRECATED_DISABLE=1
BACDL_BSC=1
BSC_CONF_HUB_FUNCTION_CONNECTIONS_NUM=3 BSC_CONF_HUB_FUNCTION_CONNECTIONS_NUM=3
BSC_CONF_NODE_SWITCH_CONNECTIONS_NUM=3 BSC_CONF_NODE_SWITCH_CONNECTIONS_NUM=3
BSC_CONF_WSURL_MAX_LEN=128 BSC_CONF_WSURL_MAX_LEN=128
@@ -48,7 +49,7 @@ include_directories(
if(ZEPHYR_BASE) if(ZEPHYR_BASE)
message(FATAL_ERROR "ZEPHYR_BASE env variable defined. Use zephyr/CMakeLists.txt for Zephyr build") message(FATAL_ERROR "ZEPHYR_BASE env variable defined. Use zephyr/CMakeLists.txt for Zephyr build")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
message(STATUS "BACNet/SC node test: building for linux") message(STATUS "BACnet/SC node test: building for linux")
set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/linux) set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/linux)
find_package(libwebsockets CONFIG REQUIRED) find_package(libwebsockets CONFIG REQUIRED)
include_directories(${LIBWEBSOCKETS_INCLUDE_DIRS}) include_directories(${LIBWEBSOCKETS_INCLUDE_DIRS})
@@ -69,7 +70,7 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
) )
elseif(WIN32) elseif(WIN32)
message(STATUS "BACNet/SC node test: building for win32") message(STATUS "BACnet/SC node test: building for win32")
set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/win32) set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/win32)
add_compile_definitions(BACNET_PORT=win32) add_compile_definitions(BACNET_PORT=win32)
add_compile_definitions(BACNET_STACK_STATIC_DEFINE) add_compile_definitions(BACNET_STACK_STATIC_DEFINE)
@@ -113,7 +114,7 @@ elseif(WIN32)
) )
elseif(APPLE) elseif(APPLE)
message(STATUS "BACNet/SC node test: building for APPLE") message(STATUS "BACnet/SC node test: building for APPLE")
execute_process ( execute_process (
COMMAND bash -c "brew --prefix openssl" COMMAND bash -c "brew --prefix openssl"
OUTPUT_VARIABLE OPEN_SSL_DIR OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE OPEN_SSL_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
File diff suppressed because it is too large Load Diff
@@ -27,7 +27,8 @@ set(ZTST_DIR "${TST_DIR}/ztest/src")
add_compile_definitions( add_compile_definitions(
BIG_ENDIAN=0 BIG_ENDIAN=0
CONFIG_ZTEST=1 CONFIG_ZTEST=1
BACDL_BSC BACDL_BSC=1
BACNET_STACK_DEPRECATED_DISABLE=1
BSC_CONF_HUB_FUNCTION_CONNECTIONS_NUM=4 BSC_CONF_HUB_FUNCTION_CONNECTIONS_NUM=4
BSC_CONF_NODE_SWITCH_CONNECTIONS_NUM=4 BSC_CONF_NODE_SWITCH_CONNECTIONS_NUM=4
BSC_CONF_WSURL_MAX_LEN=128 BSC_CONF_WSURL_MAX_LEN=128
@@ -44,7 +45,7 @@ include_directories(
if(ZEPHYR_BASE) if(ZEPHYR_BASE)
message(FATAL_ERROR "ZEPHYR_BASE env variable defined. Use zephyr/CMakeLists.txt for Zephyr build") message(FATAL_ERROR "ZEPHYR_BASE env variable defined. Use zephyr/CMakeLists.txt for Zephyr build")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
message(STATUS "BACNet/SC socket test: building for linux") message(STATUS "BACnet/SC socket test: building for linux")
set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/linux) set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/linux)
find_package(libwebsockets CONFIG REQUIRED) find_package(libwebsockets CONFIG REQUIRED)
include_directories(${LIBWEBSOCKETS_INCLUDE_DIRS}) include_directories(${LIBWEBSOCKETS_INCLUDE_DIRS})
@@ -65,7 +66,7 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
-Wno-language-extension-token -Wno-language-extension-token
) )
elseif(WIN32) elseif(WIN32)
message(STATUS "BACNet/SC socket test: building for win32") message(STATUS "BACnet/SC socket test: building for win32")
set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/win32) set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/win32)
add_compile_definitions(BACNET_PORT=win32) add_compile_definitions(BACNET_PORT=win32)
add_compile_definitions(BACNET_STACK_STATIC_DEFINE) add_compile_definitions(BACNET_STACK_STATIC_DEFINE)
@@ -109,7 +110,7 @@ elseif(WIN32)
advapi32.lib advapi32.lib
) )
elseif(APPLE) elseif(APPLE)
message(STATUS "BACNet/SC socket test: building for APPLE") message(STATUS "BACnet/SC socket test: building for APPLE")
set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/bsd) set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/bsd)
execute_process ( execute_process (
COMMAND bash -c "brew --prefix openssl" COMMAND bash -c "brew --prefix openssl"
File diff suppressed because it is too large Load Diff
@@ -23,6 +23,7 @@ add_compile_definitions(
BIG_ENDIAN=0 BIG_ENDIAN=0
CONFIG_ZTEST=1 CONFIG_ZTEST=1
BSC_CONF_TX_PRE=0 BSC_CONF_TX_PRE=0
BACNET_STACK_DEPRECATED_DISABLE=1
BACNET_STACK_STATIC_DEFINE BACNET_STACK_STATIC_DEFINE
) )
+5 -4
View File
@@ -27,7 +27,8 @@ set(ZTST_DIR "${TST_DIR}/ztest/src")
add_compile_definitions( add_compile_definitions(
BIG_ENDIAN=0 BIG_ENDIAN=0
CONFIG_ZTEST=1 CONFIG_ZTEST=1
BACDL_BSC BACDL_BSC=1
BACNET_STACK_DEPRECATED_DISABLE=1
BSC_CONF_HUB_FUNCTION_CONNECTIONS_NUM=4 BSC_CONF_HUB_FUNCTION_CONNECTIONS_NUM=4
BSC_CONF_NODE_SWITCH_CONNECTIONS_NUM=4 BSC_CONF_NODE_SWITCH_CONNECTIONS_NUM=4
BSC_CONF_WSURL_MAX_LEN=128 BSC_CONF_WSURL_MAX_LEN=128
@@ -46,7 +47,7 @@ include_directories(
if(ZEPHYR_BASE) if(ZEPHYR_BASE)
message(FATAL_ERROR "ZEPHYR_BASE env variable defined. Use zephyr/CMakeLists.txt for Zephyr build") message(FATAL_ERROR "ZEPHYR_BASE env variable defined. Use zephyr/CMakeLists.txt for Zephyr build")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
message(STATUS "BACNet/SC hub function test: building for linux") message(STATUS "BACnet/SC hub function test: building for linux")
set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/linux) set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/linux)
add_compile_definitions(BACNET_PORT=linux) add_compile_definitions(BACNET_PORT=linux)
find_package(libwebsockets CONFIG REQUIRED) find_package(libwebsockets CONFIG REQUIRED)
@@ -67,7 +68,7 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
-Wno-language-extension-token -Wno-language-extension-token
) )
elseif(WIN32) elseif(WIN32)
message(STATUS "BACNet/SC hub function test: building for win32") message(STATUS "BACnet/SC hub function test: building for win32")
set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/win32) set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/win32)
add_compile_definitions(BACNET_PORT=win32) add_compile_definitions(BACNET_PORT=win32)
add_compile_definitions(BACNET_STACK_STATIC_DEFINE) add_compile_definitions(BACNET_STACK_STATIC_DEFINE)
@@ -113,7 +114,7 @@ elseif(WIN32)
) )
elseif(APPLE) elseif(APPLE)
message(STATUS "BACNet/SC hub function test: building for APPLE") message(STATUS "BACnet/SC hub function test: building for APPLE")
set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/bsd) set(BACNET_PORT_DIRECTORY_PATH ${CMAKE_CURRENT_LIST_DIR}/ports/bsd)
execute_process ( execute_process (
COMMAND bash -c "brew --prefix openssl" COMMAND bash -c "brew --prefix openssl"
+13 -28
View File
@@ -24,7 +24,6 @@
#include <bacnet/datalink/bsc/bsc-hub-function.h> #include <bacnet/datalink/bsc/bsc-hub-function.h>
unsigned char ca_key[] = { unsigned char ca_key[] = {
/* certificate authority key for testing */
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x52, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x52,
0x53, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x53, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b,
0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45,
@@ -164,12 +163,10 @@ unsigned char ca_key[] = {
0x4d, 0x4e, 0x69, 0x6c, 0x49, 0x6a, 0x31, 0x6d, 0x71, 0x44, 0x4d, 0x3d, 0x4d, 0x4e, 0x69, 0x6c, 0x49, 0x6a, 0x31, 0x6d, 0x71, 0x44, 0x4d, 0x3d,
0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x52, 0x53, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x52, 0x53,
0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45,
0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a,
}; };
/* clang-format off */
unsigned char ca_cert[] = { unsigned char ca_cert[] = {
/* certificate authority certificate for testing */
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x48, 0x44, 0x43, 0x43, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x48, 0x44, 0x43, 0x43,
@@ -264,16 +261,13 @@ unsigned char ca_cert[] = {
0x48, 0x6d, 0x34, 0x53, 0x69, 0x64, 0x67, 0x4f, 0x78, 0x4c, 0x66, 0x31, 0x48, 0x6d, 0x34, 0x53, 0x69, 0x64, 0x67, 0x4f, 0x78, 0x4c, 0x66, 0x31,
0x46, 0x78, 0x31, 0x64, 0x32, 0x76, 0x34, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x46, 0x78, 0x31, 0x64, 0x32, 0x76, 0x34, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d,
0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46,
0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a,
#ifdef CONFIG_MBEDTLS #ifdef CONFIG_MBEDTLS
, 0x00,
0x00
#endif #endif
}; };
/* clang-format on */
unsigned char client_key[] = { unsigned char client_key[] = {
/* client key for testing BACnet secure connect */
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x52, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x52,
0x53, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x53, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b,
0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x4a, 0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x4a,
@@ -544,11 +538,10 @@ unsigned char client_key[] = {
0x77, 0x4f, 0x49, 0x35, 0x52, 0x49, 0x2f, 0x78, 0x0a, 0x2d, 0x2d, 0x2d, 0x77, 0x4f, 0x49, 0x35, 0x52, 0x49, 0x2f, 0x78, 0x0a, 0x2d, 0x2d, 0x2d,
0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x52, 0x53, 0x41, 0x20, 0x50, 0x52, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x52, 0x53, 0x41, 0x20, 0x50, 0x52,
0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d, 0x2d,
0x2d, 0x2d, 0x0a 0x2d, 0x2d, 0x0a,
}; };
unsigned char client_key_der[] = { unsigned char client_key_der[] = {
/* client key for testing BACnet data-expecting-reply DER */
0x30, 0x82, 0x09, 0x29, 0x02, 0x01, 0x00, 0x02, 0x82, 0x02, 0x01, 0x00, 0x30, 0x82, 0x09, 0x29, 0x02, 0x01, 0x00, 0x02, 0x82, 0x02, 0x01, 0x00,
0xAF, 0x04, 0xB2, 0x36, 0x78, 0x5F, 0xBC, 0x38, 0x9C, 0x18, 0x93, 0x81, 0xAF, 0x04, 0xB2, 0x36, 0x78, 0x5F, 0xBC, 0x38, 0x9C, 0x18, 0x93, 0x81,
0x7D, 0x44, 0x0B, 0x18, 0x4A, 0x4A, 0x0B, 0x6F, 0xCD, 0xDB, 0x94, 0xE8, 0x7D, 0x44, 0x0B, 0x18, 0x4A, 0x4A, 0x0B, 0x6F, 0xCD, 0xDB, 0x94, 0xE8,
@@ -744,12 +737,10 @@ unsigned char client_key_der[] = {
0x72, 0xC7, 0x08, 0x2C, 0x2F, 0x1A, 0x88, 0x95, 0x45, 0x39, 0x26, 0x67, 0x72, 0xC7, 0x08, 0x2C, 0x2F, 0x1A, 0x88, 0x95, 0x45, 0x39, 0x26, 0x67,
0x36, 0x32, 0xBF, 0x7E, 0x5A, 0x2B, 0xC6, 0xD4, 0xCE, 0x0C, 0x3F, 0x48, 0x36, 0x32, 0xBF, 0x7E, 0x5A, 0x2B, 0xC6, 0xD4, 0xCE, 0x0C, 0x3F, 0x48,
0x1B, 0x78, 0x07, 0x7F, 0x14, 0xD1, 0xD6, 0xC7, 0xDA, 0x2E, 0xFE, 0x73, 0x1B, 0x78, 0x07, 0x7F, 0x14, 0xD1, 0xD6, 0xC7, 0xDA, 0x2E, 0xFE, 0x73,
0x09, 0x07, 0xFD, 0xC0, 0xE2, 0x39, 0x44, 0x8F, 0xF1 0x09, 0x07, 0xFD, 0xC0, 0xE2, 0x39, 0x44, 0x8F, 0xF1,
}; };
/* clang-format off */
unsigned char client_cert[] = { unsigned char client_cert[] = {
/* client certificate for testing BACnet secure connect */
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x47, 0x44, 0x43, 0x43, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x47, 0x44, 0x43, 0x43,
@@ -873,17 +864,13 @@ unsigned char client_cert[] = {
0x53, 0x43, 0x55, 0x55, 0x61, 0x58, 0x5a, 0x73, 0x2f, 0x2b, 0x51, 0x41, 0x53, 0x43, 0x55, 0x55, 0x61, 0x58, 0x5a, 0x73, 0x2f, 0x2b, 0x51, 0x41,
0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43,
0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
0x2d, 0x2d, 0x2d, 0x0a 0x2d, 0x2d, 0x2d, 0x0a,
#ifdef CONFIG_MBEDTLS #ifdef CONFIG_MBEDTLS
, 0x00,
0x00
#endif #endif
}; };
/* clang-format on */
/* clang-format off */
unsigned char server_key[] = { unsigned char server_key[] = {
/* server key for testing BACnet secure connect */
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x52, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x52,
0x53, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x53, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b,
0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x4a, 0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x4a,
@@ -1154,16 +1141,12 @@ unsigned char server_key[] = {
0x68, 0x69, 0x61, 0x51, 0x34, 0x69, 0x67, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x68, 0x69, 0x61, 0x51, 0x34, 0x69, 0x67, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d,
0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x52, 0x53, 0x41, 0x20, 0x50, 0x52, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x52, 0x53, 0x41, 0x20, 0x50, 0x52,
0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d, 0x2d,
0x2d, 0x2d, 0x0a 0x2d, 0x2d, 0x0a,
#ifdef CONFIG_MBEDTLS #ifdef CONFIG_MBEDTLS
, 0x00 0x00,
#endif #endif
}; };
/* clang-format on */
/* clang-format off */
unsigned char server_cert[] = { unsigned char server_cert[] = {
/* server certificate for testing BACnet secure connect */
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x47, 0x7a, 0x43, 0x43, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x47, 0x7a, 0x43, 0x43,
@@ -1287,9 +1270,9 @@ unsigned char server_cert[] = {
0x67, 0x4c, 0x31, 0x4a, 0x59, 0x58, 0x5a, 0x37, 0x45, 0x4a, 0x39, 0x79, 0x67, 0x4c, 0x31, 0x4a, 0x59, 0x58, 0x5a, 0x37, 0x45, 0x4a, 0x39, 0x79,
0x6a, 0x50, 0x64, 0x77, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x6a, 0x50, 0x64, 0x77, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45,
0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41,
0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a,
#ifdef CONFIG_MBEDTLS #ifdef CONFIG_MBEDTLS
, 0x00 0x00,
#endif #endif
}; };
/* clang-format on */ /* clang-format on */
@@ -2329,6 +2312,7 @@ static void test_hub_function_duplicated_uuid(void)
static void *suite_setup(void) static void *suite_setup(void)
{ {
setbuf(stdout, NULL); setbuf(stdout, NULL);
lws_set_log_level(0, NULL);
return NULL; return NULL;
} }
@@ -2344,6 +2328,7 @@ ZTEST_SUITE(hub_test_8, NULL, suite_setup, NULL, NULL, NULL);
void test_main(void) void test_main(void)
{ {
// setbuf(stdout, NULL); // setbuf(stdout, NULL);
lws_set_log_level(0, NULL);
// Tests must not be run in parallel threads! // Tests must not be run in parallel threads!
// Thats why tests functions are in different suites. // Thats why tests functions are in different suites.
ztest_test_suite( ztest_test_suite(
File diff suppressed because it is too large Load Diff
+1
View File
@@ -30,6 +30,7 @@ set(ZTST_DIR "${TST_DIR}/ztest/src")
add_compile_definitions( add_compile_definitions(
BIG_ENDIAN=0 BIG_ENDIAN=0
CONFIG_ZTEST=1 CONFIG_ZTEST=1
BACNET_STACK_DEPRECATED_DISABLE=1
) )
include_directories( include_directories(
@@ -31,6 +31,7 @@ set(ZTST_DIR "${TST_DIR}/ztest/src")
add_compile_definitions( add_compile_definitions(
BIG_ENDIAN=0 BIG_ENDIAN=0
CONFIG_ZTEST=1 CONFIG_ZTEST=1
BACNET_STACK_DEPRECATED_DISABLE=1
) )
include_directories( include_directories(
@@ -32,6 +32,7 @@ set(ZTST_DIR "${TST_DIR}/ztest/src")
add_compile_definitions( add_compile_definitions(
BIG_ENDIAN=0 BIG_ENDIAN=0
CONFIG_ZTEST=1 CONFIG_ZTEST=1
BACNET_STACK_DEPRECATED_DISABLE=1
) )
include_directories( include_directories(
@@ -27,6 +27,7 @@ set(ZTST_DIR "${TST_DIR}/ztest/src")
add_compile_definitions( add_compile_definitions(
BIG_ENDIAN=0 BIG_ENDIAN=0
CONFIG_ZTEST=1 CONFIG_ZTEST=1
BACNET_STACK_DEPRECATED_DISABLE=1
) )
include_directories( include_directories(