Prepere repo so we can run auto formatters (#747)
* clang-format: Ignore javascript files Ignore javascript files. Clang-format is not very good formatter for javascript files anyway. If we ever need javascript formatter we should use Prettier. * clang-format: Ignore some lines in sources Couple things get formatted really funky if we let clang-format format those. Just ignore those locally. * zephyr/tescase.yaml: Fix yaml syntax pre-commit hook check-yaml did found out that there are two skips. Remove another as this is not right syntax. * Fix repo contains unicode replacement chars When running pre-commit text-unicode-replacement-char it founds that there is couple unicode replacemnt chars. Remove and replace these. * Convert some tabs to spaces manually We will soon auto format tabs to spaces. How ever it could not do couple thing so fix those by hand first. * Make files with shebang executables It is good habit that if file has shebang then it is marked executable. These where found with pre-commit check-shebang-scripts-are-executable checker. --------- Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
This commit is contained in:
@@ -18,4 +18,7 @@ IndentWidth: 4
|
|||||||
UseTab: Never
|
UseTab: Never
|
||||||
SortIncludes: false
|
SortIncludes: false
|
||||||
ColumnLimit: 80
|
ColumnLimit: 80
|
||||||
|
---
|
||||||
|
Language: JavaScript
|
||||||
|
DisableFormat: true
|
||||||
...
|
...
|
||||||
|
|||||||
+4
-4
@@ -39,10 +39,10 @@ option(
|
|||||||
"compile the bacpoll app"
|
"compile the bacpoll app"
|
||||||
ON)
|
ON)
|
||||||
|
|
||||||
option(
|
option(
|
||||||
BACNET_BUILD_BACDISCOVER_APP
|
BACNET_BUILD_BACDISCOVER_APP
|
||||||
"compile the bacdiscover app"
|
"compile the bacdiscover app"
|
||||||
ON)
|
ON)
|
||||||
|
|
||||||
option(
|
option(
|
||||||
BACDL_ETHERNET
|
BACDL_ETHERNET
|
||||||
|
|||||||
Regular → Executable
Regular → Executable
Regular → Executable
+29
-29
@@ -10,47 +10,47 @@
|
|||||||
#define BACPORT_H
|
#define BACPORT_H
|
||||||
|
|
||||||
/* common unix sockets headers needed */
|
/* common unix sockets headers needed */
|
||||||
#include <sys/types.h> /* basic system data types */
|
#include <sys/types.h> /* basic system data types */
|
||||||
#include <sys/time.h> /* timeval{} for select() */
|
#include <sys/time.h> /* timeval{} for select() */
|
||||||
#include <time.h> /* timespec{} for pselect() */
|
#include <time.h> /* timespec{} for pselect() */
|
||||||
#include <netinet/in.h> /* sockaddr_in{} and other Internet defns */
|
#include <netinet/in.h> /* sockaddr_in{} and other Internet defns */
|
||||||
#include <arpa/inet.h> /* inet(3) functions */
|
#include <arpa/inet.h> /* inet(3) functions */
|
||||||
#include <fcntl.h> /* for nonblocking */
|
#include <fcntl.h> /* for nonblocking */
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/stat.h> /* for S_xxx file mode constants */
|
#include <sys/stat.h> /* for S_xxx file mode constants */
|
||||||
#include <sys/uio.h> /* for iovec{} and readv/writev */
|
#include <sys/uio.h> /* for iovec{} and readv/writev */
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <sys/un.h> /* for Unix domain sockets */
|
#include <sys/un.h> /* for Unix domain sockets */
|
||||||
|
|
||||||
#ifdef HAVE_SYS_SELECT_H
|
#ifdef HAVE_SYS_SELECT_H
|
||||||
#include <sys/select.h> /* for convenience */
|
#include <sys/select.h> /* for convenience */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_POLL_H
|
#ifdef HAVE_POLL_H
|
||||||
#include <poll.h> /* for convenience */
|
#include <poll.h> /* for convenience */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_STRINGS_H
|
#ifdef HAVE_STRINGS_H
|
||||||
#include <strings.h> /* for convenience */
|
#include <strings.h> /* for convenience */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Three headers are normally needed for socket/file ioctl's:
|
/* Three headers are normally needed for socket/file ioctl's:
|
||||||
* <sys/ioctl.h>, <sys/filio.h>, and <sys/sockio.h>.
|
* <sys/ioctl.h>, <sys/filio.h>, and <sys/sockio.h>.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_SYS_IOCTL_H
|
#ifdef HAVE_SYS_IOCTL_H
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_FILIO_H
|
#ifdef HAVE_SYS_FILIO_H
|
||||||
#include <sys/filio.h>
|
#include <sys/filio.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKIO_H
|
#ifdef HAVE_SYS_SOCKIO_H
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ bool datetime_local(BACNET_DATE *bdate,
|
|||||||
* int tm_wday Day of week [0,6] (Sunday =0).
|
* int tm_wday Day of week [0,6] (Sunday =0).
|
||||||
* int tm_yday Day of year [0,365].
|
* int tm_yday Day of year [0,365].
|
||||||
* int tm_isdst Daylight Savings flag.
|
* int tm_isdst Daylight Savings flag.
|
||||||
* long tm_gmtoff offset from UTC in seconds
|
* long tm_gmtoff offset from UTC in seconds
|
||||||
*/
|
*/
|
||||||
datetime_set_date(bdate, (uint16_t)tblock->tm_year + 1900,
|
datetime_set_date(bdate, (uint16_t)tblock->tm_year + 1900,
|
||||||
(uint8_t)tblock->tm_mon + 1, (uint8_t)tblock->tm_mday);
|
(uint8_t)tblock->tm_mon + 1, (uint8_t)tblock->tm_mday);
|
||||||
|
|||||||
@@ -837,7 +837,7 @@ static int createSocket(struct sockaddr_in *sin)
|
|||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
if (BIP_Debug) {
|
if (BIP_Debug) {
|
||||||
perror("SO_BINDTODEVICE: ");
|
perror("SO_BINDTODEVICE: ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* bind the socket to the local port number and IP address */
|
/* bind the socket to the local port number and IP address */
|
||||||
status =
|
status =
|
||||||
|
|||||||
Regular → Executable
@@ -22,9 +22,9 @@ enum INT_STATE { INT_DISABLED, INT_ENABLED, INT_RESTORE };
|
|||||||
#define RESTART_WDT() { _asm CLRWDT _endasm }
|
#define RESTART_WDT() { _asm CLRWDT _endasm }
|
||||||
|
|
||||||
/* *************************************************************************
|
/* *************************************************************************
|
||||||
define ENABLE_GLOBAL_INT() INTCONbits.GIE = 1 �
|
define ENABLE_GLOBAL_INT() INTCONbits.GIE = 1
|
||||||
#define DISABLE_GLOBAL_INT() INTCONbits.GIE = 0 �
|
#define DISABLE_GLOBAL_INT() INTCONbits.GIE = 0
|
||||||
#define ENABLE_PERIPHERAL_INT() INTCONbits.PEIE = 1 �
|
#define ENABLE_PERIPHERAL_INT() INTCONbits.PEIE = 1
|
||||||
#define DISABLE_PERIPHERAL_INT() INTCONbits.PEIE = 0
|
#define DISABLE_PERIPHERAL_INT() INTCONbits.PEIE = 0
|
||||||
*************************************************************************** */
|
*************************************************************************** */
|
||||||
#define ENABLE_HIGH_INT() INTCONbits.GIE = 1
|
#define ENABLE_HIGH_INT() INTCONbits.GIE = 1
|
||||||
|
|||||||
Regular → Executable
@@ -45,9 +45,9 @@ enum INT_STATE { INT_DISABLED, INT_ENABLED, INT_RESTORE };
|
|||||||
#define RESTART_WDT() { _asm CLRWDT _endasm }
|
#define RESTART_WDT() { _asm CLRWDT _endasm }
|
||||||
|
|
||||||
/* *************************************************************************
|
/* *************************************************************************
|
||||||
define ENABLE_GLOBAL_INT() INTCONbits.GIE = 1 �
|
define ENABLE_GLOBAL_INT() INTCONbits.GIE = 1
|
||||||
#define DISABLE_GLOBAL_INT() INTCONbits.GIE = 0 �
|
#define DISABLE_GLOBAL_INT() INTCONbits.GIE = 0
|
||||||
#define ENABLE_PERIPHERAL_INT() INTCONbits.PEIE = 1 �
|
#define ENABLE_PERIPHERAL_INT() INTCONbits.PEIE = 1
|
||||||
#define DISABLE_PERIPHERAL_INT() INTCONbits.PEIE = 0
|
#define DISABLE_PERIPHERAL_INT() INTCONbits.PEIE = 0
|
||||||
*************************************************************************** */
|
*************************************************************************** */
|
||||||
#define ENABLE_HIGH_INT() INTCONbits.GIE = 1
|
#define ENABLE_HIGH_INT() INTCONbits.GIE = 1
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
/**
|
/**
|
||||||
* @brief This is the HAL system configuration section
|
* @brief This is the HAL system configuration section
|
||||||
*/
|
*/
|
||||||
#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */
|
#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */
|
||||||
#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */
|
#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */
|
||||||
#define USE_RTOS 0U
|
#define USE_RTOS 0U
|
||||||
#define PREFETCH_ENABLE 1U
|
#define PREFETCH_ENABLE 1U
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
void adc_init (void);
|
void adc_init (void);
|
||||||
uint16_t adc_result_12bit(uint8_t channel);
|
uint16_t adc_result_12bit(uint8_t channel);
|
||||||
@@ -22,5 +22,5 @@ extern "C"
|
|||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
void bacnet_init (void);
|
void bacnet_init (void);
|
||||||
void bacnet_task (void);
|
void bacnet_task (void);
|
||||||
@@ -22,5 +22,5 @@ extern "C"
|
|||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ BACNET_ADDRESS *Get_Routed_Device_Address(int idx)
|
|||||||
* devices with routing.
|
* devices with routing.
|
||||||
*
|
*
|
||||||
* @param my_address [out] Points to the currently active Device Object's
|
* @param my_address [out] Points to the currently active Device Object's
|
||||||
* BACnet address.
|
* BACnet address.
|
||||||
*/
|
*/
|
||||||
void routed_get_my_address(BACNET_ADDRESS *my_address)
|
void routed_get_my_address(BACNET_ADDRESS *my_address)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -198,10 +198,10 @@ extern "C" {
|
|||||||
|
|
||||||
BACNET_STACK_EXPORT
|
BACNET_STACK_EXPORT
|
||||||
bool Network_Port_IP_DHCP_Enable(
|
bool Network_Port_IP_DHCP_Enable(
|
||||||
uint32_t object_instance);
|
uint32_t object_instance);
|
||||||
BACNET_STACK_EXPORT
|
BACNET_STACK_EXPORT
|
||||||
bool Network_Port_IP_DHCP_Enable_Set(
|
bool Network_Port_IP_DHCP_Enable_Set(
|
||||||
uint32_t object_instance, bool value);
|
uint32_t object_instance, bool value);
|
||||||
|
|
||||||
BACNET_STACK_EXPORT
|
BACNET_STACK_EXPORT
|
||||||
bool Network_Port_IP_DNS_Server(
|
bool Network_Port_IP_DNS_Server(
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ int PositiveInteger_Value_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
|||||||
apdu_len =
|
apdu_len =
|
||||||
encode_application_enumerated(&apdu[0], CurrentAV->Units);
|
encode_application_enumerated(&apdu[0], CurrentAV->Units);
|
||||||
break;
|
break;
|
||||||
/* BACnet Testing Observed Incident oi00109
|
/* BACnet Testing Observed Incident oi00109
|
||||||
Positive Integer Value / Units returned wrong datatype -
|
Positive Integer Value / Units returned wrong datatype -
|
||||||
missing break. Revealed by BACnet Test Client v1.8.16 (
|
missing break. Revealed by BACnet Test Client v1.8.16 (
|
||||||
www.bac-test.com/bacnet-test-client-download ) BITS: BIT00031 BC
|
www.bac-test.com/bacnet-test-client-download ) BITS: BIT00031 BC
|
||||||
|
|||||||
@@ -19,12 +19,14 @@
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#ifndef NEXT_POWER_OF_2
|
#ifndef NEXT_POWER_OF_2
|
||||||
|
/* clang-format off */
|
||||||
#define B2(x) ( (x) | ( (x) >> 1) )
|
#define B2(x) ( (x) | ( (x) >> 1) )
|
||||||
#define B4(x) ( B2(x) | ( B2(x) >> 2) )
|
#define B4(x) ( B2(x) | ( B2(x) >> 2) )
|
||||||
#define B8(x) ( B4(x) | ( B4(x) >> 4) )
|
#define B8(x) ( B4(x) | ( B4(x) >> 4) )
|
||||||
#define B16(x) ( B8(x) | ( B8(x) >> 8) )
|
#define B16(x) ( B8(x) | ( B8(x) >> 8) )
|
||||||
#define B32(x) (B16(x) | (B16(x) >>16) )
|
#define B32(x) (B16(x) | (B16(x) >>16) )
|
||||||
#define NEXT_POWER_OF_2(x) (B32((x)-1) + 1)
|
#define NEXT_POWER_OF_2(x) (B32((x)-1) + 1)
|
||||||
|
/* clang-format on */
|
||||||
#endif
|
#endif
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
|||||||
+6
-1
@@ -130,7 +130,9 @@
|
|||||||
|
|
||||||
/* BACAPP decodes WriteProperty service requests
|
/* BACAPP decodes WriteProperty service requests
|
||||||
Choose the datatypes that your application supports */
|
Choose the datatypes that your application supports */
|
||||||
#if !(defined(BACAPP_ALL) || \
|
/* clang-format off */
|
||||||
|
#if !( \
|
||||||
|
defined(BACAPP_ALL) || \
|
||||||
defined(BACAPP_MINIMAL) || \
|
defined(BACAPP_MINIMAL) || \
|
||||||
defined(BACAPP_NULL) || \
|
defined(BACAPP_NULL) || \
|
||||||
defined(BACAPP_BOOLEAN) || \
|
defined(BACAPP_BOOLEAN) || \
|
||||||
@@ -166,6 +168,7 @@
|
|||||||
defined(BACAPP_TYPES_EXTRA))
|
defined(BACAPP_TYPES_EXTRA))
|
||||||
#define BACAPP_ALL
|
#define BACAPP_ALL
|
||||||
#endif
|
#endif
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
#if defined (BACAPP_ALL)
|
#if defined (BACAPP_ALL)
|
||||||
#define BACAPP_MINIMAL
|
#define BACAPP_MINIMAL
|
||||||
@@ -210,6 +213,7 @@
|
|||||||
#define BACAPP_SHED_LEVEL
|
#define BACAPP_SHED_LEVEL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* clang-format off */
|
||||||
#if defined(BACAPP_DOUBLE) || \
|
#if defined(BACAPP_DOUBLE) || \
|
||||||
defined(BACAPP_DATETIME) || \
|
defined(BACAPP_DATETIME) || \
|
||||||
defined(BACAPP_DATERANGE) || \
|
defined(BACAPP_DATERANGE) || \
|
||||||
@@ -231,6 +235,7 @@
|
|||||||
defined(BACAPP_SHED_LEVEL)
|
defined(BACAPP_SHED_LEVEL)
|
||||||
#define BACAPP_COMPLEX_TYPES
|
#define BACAPP_COMPLEX_TYPES
|
||||||
#endif
|
#endif
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Set the maximum vector type sizes
|
** Set the maximum vector type sizes
|
||||||
|
|||||||
@@ -1465,9 +1465,9 @@ int bvlc6_decode_secure_bvll(uint8_t *pdu,
|
|||||||
*
|
*
|
||||||
* This message provides a mechanism whereby a foreign device
|
* This message provides a mechanism whereby a foreign device
|
||||||
* shall cause a BBMD to distribute a Forwarded-NPDU
|
* shall cause a BBMD to distribute a Forwarded-NPDU
|
||||||
* BVLC to the local multicast domain, to all BBMD�s configured
|
* BVLC to the local multicast domain, to all BBMD's configured
|
||||||
* in the BBMD�s BDT, and to all foreign devices in the
|
* in the BBMD's BDT, and to all foreign devices in the
|
||||||
* BBMD�s FDT.
|
* BBMD's FDT.
|
||||||
*
|
*
|
||||||
* @param pdu - buffer to store the encoding
|
* @param pdu - buffer to store the encoding
|
||||||
* @param pdu_size - size of the buffer to store encoding
|
* @param pdu_size - size of the buffer to store encoding
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ static bool MSTP_Compare_Data_Expecting_Reply(
|
|||||||
request.address.mac_len = 1;
|
request.address.mac_len = 1;
|
||||||
offset = bacnet_npdu_decode(
|
offset = bacnet_npdu_decode(
|
||||||
&request_pdu[0], request_pdu_len, NULL, &request.address,
|
&request_pdu[0], request_pdu_len, NULL, &request.address,
|
||||||
&request.npdu_data);
|
&request.npdu_data);
|
||||||
if (request.npdu_data.network_layer_message) {
|
if (request.npdu_data.network_layer_message) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -171,7 +171,7 @@ static bool MSTP_Compare_Data_Expecting_Reply(
|
|||||||
bacnet_address_copy(&reply.address, dest_address);
|
bacnet_address_copy(&reply.address, dest_address);
|
||||||
offset = bacnet_npdu_decode(
|
offset = bacnet_npdu_decode(
|
||||||
&reply_pdu[0], reply_pdu_len, &reply.address, NULL,
|
&reply_pdu[0], reply_pdu_len, &reply.address, NULL,
|
||||||
&reply.npdu_data);
|
&reply.npdu_data);
|
||||||
if (reply.npdu_data.network_layer_message) {
|
if (reply.npdu_data.network_layer_message) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -393,7 +393,7 @@ int rr_decode_service_request(
|
|||||||
* ReadRange-ACK ::= SEQUENCE {
|
* ReadRange-ACK ::= SEQUENCE {
|
||||||
* objectIdentifier [0] BACnetObjectIdentifier,
|
* objectIdentifier [0] BACnetObjectIdentifier,
|
||||||
* propertyIdentifier [1] BACnetPropertyIdentifier,
|
* propertyIdentifier [1] BACnetPropertyIdentifier,
|
||||||
* propertyArrayIndex [2] Unsigned OPTIONAL , -- used only with
|
* propertyArrayIndex [2] Unsigned OPTIONAL, -- used only with
|
||||||
* array datatype resultFlags [3] BACnetResultFlags, itemCount [4]
|
* array datatype resultFlags [3] BACnetResultFlags, itemCount [4]
|
||||||
* Unsigned, itemData [5] SEQUENCE OF ABSTRACT-SYNTAX.&TYPE,
|
* Unsigned, itemData [5] SEQUENCE OF ABSTRACT-SYNTAX.&TYPE,
|
||||||
* firstSequenceNumber [6] Unsigned32 OPTIONAL -- used only if 'Item
|
* firstSequenceNumber [6] Unsigned32 OPTIONAL -- used only if 'Item
|
||||||
|
|||||||
+11
-13
@@ -11,16 +11,14 @@ rsource "object/Kconfig"
|
|||||||
rsource "server/Kconfig"
|
rsource "server/Kconfig"
|
||||||
|
|
||||||
config BACNET_SHELL
|
config BACNET_SHELL
|
||||||
bool "BACnet Shell"
|
bool "BACnet Shell"
|
||||||
default n
|
default n
|
||||||
select SHELL
|
select SHELL
|
||||||
select CONSOLE
|
select CONSOLE
|
||||||
select KERNEL_SHELL
|
select KERNEL_SHELL
|
||||||
select THREAD_MONITOR
|
select THREAD_MONITOR
|
||||||
select THREAD_NAME
|
select THREAD_NAME
|
||||||
select DEVICE_SHELL
|
select DEVICE_SHELL
|
||||||
select LOG
|
select LOG
|
||||||
help
|
help
|
||||||
Enable BACnet Shell support
|
Enable BACnet Shell support
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
common:
|
common:
|
||||||
skip: true # TODO: Remove skip when zephyr v3.0.0 nested <time.h> conflicting definitions resolved.
|
skip: true # TODO: Remove skip when zephyr v3.0.0 nested <time.h> conflicting definitions resolved.
|
||||||
skip: true #TODO: debug test for Zephyr v3.2.0
|
|
||||||
tests:
|
tests:
|
||||||
bacnet.datalink.bvlc.unit:
|
bacnet.datalink.bvlc.unit:
|
||||||
tags: bacnet
|
tags: bacnet
|
||||||
|
|||||||
Reference in New Issue
Block a user