Chore/bacnet-sc-unrelated-cleanup (#620)
* Added required linux Ethernet library for ethernet build * Added .obj to gitignore * Fixed BACnet port for APPLE to use BSD in CMake * Changed format in CMake to enable cleaner SC merge * Added create-object and delete-object recipes in GCC Makefile * Added datalink timer to all example OS apps * Changed most microcontroller ports to use BACAPP_MINIMAL to specify which datatypes can be written. * Fixed zephyr OS for BACnet/IP warning * Fixed zephyr OS log to not require log_strdup * Added writefile API to file object example * Added API to device-client to make it more robust. * Added API in network-port object for getting the ASCII object-name * Added debug print with a timestamp option * Added debug print with hex dump print * Added API to network port object for activate and discard * Added default define for debug with timestamp * Added prototype in header for disabled debug printf. * Added fifo peek ahead function to peek at more than one byte. * Added get-mac value for network port that uses buffer rather than octetstring
This commit is contained in:
@@ -338,7 +338,7 @@ uint16_t bip_receive(
|
||||
}
|
||||
ZSOCK_FD_ZERO(&read_fds);
|
||||
ZSOCK_FD_SET(BIP_Socket, &read_fds);
|
||||
FD_SET(BIP_Broadcast_Socket, &read_fds);
|
||||
ZSOCK_FD_SET(BIP_Broadcast_Socket, &read_fds);
|
||||
|
||||
max = BIP_Socket > BIP_Broadcast_Socket ? BIP_Socket : BIP_Broadcast_Socket;
|
||||
|
||||
@@ -507,7 +507,7 @@ void bip_set_interface(char *ifname)
|
||||
bip_set_addr(&unicast);
|
||||
bip_set_broadcast_addr(&broadcast);
|
||||
LOG_INF("BACnet/IP Unicast: %u.%u.%u.%u:%d", unicast.address[0],
|
||||
unicast.address[1], unicast.address[2], unicast.address[3],
|
||||
unicast.address[1], unicast.address[2], unicast.address[3],
|
||||
unicast.port);
|
||||
LOG_INF("BACnet/IP Broadcast: %u.%u.%u.%u", broadcast.address[0],
|
||||
broadcast.address[1], broadcast.address[2], broadcast.address[3]);
|
||||
|
||||
@@ -93,7 +93,7 @@ static char* inet6_ntoa(struct in6_addr *a)
|
||||
|
||||
/* Avoid overwhelming the logging system */
|
||||
while(log_buffered_cnt())
|
||||
{
|
||||
{
|
||||
k_sleep(K_MSEC(1));
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ uint16_t bip6_receive(
|
||||
/* we could just use a non-blocking socket, but that consumes all
|
||||
the CPU time. We can use a timeout; it is only supported as
|
||||
a select. */
|
||||
|
||||
|
||||
if (timeout >= 1000) {
|
||||
select_timeout.tv_sec = timeout / 1000;
|
||||
select_timeout.tv_usec =
|
||||
@@ -334,7 +334,7 @@ uint16_t bip6_receive(
|
||||
received_bytes = zsock_recvfrom(BIP6_Socket, (char *)&npdu[0], max_npdu,
|
||||
0, (struct sockaddr *)&sin, &sin_len);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -439,13 +439,13 @@ void bip6_set_interface(char *ifname)
|
||||
for(x=0; x<NET_IF_MAX_IPV6_ADDR; x++)
|
||||
{
|
||||
inet6_ntoa(&interface->config.ip.ipv6->unicast[x].address.in6_addr );
|
||||
LOG_INF(" unicast[%d]: %s", x, log_strdup(ipv6_addr_str));
|
||||
LOG_INF(" unicast[%d]: %s", x, ipv6_addr_str);
|
||||
}
|
||||
|
||||
for(x=0; x<NET_IF_MAX_IPV6_MADDR; x++)
|
||||
{
|
||||
inet6_ntoa(&interface->config.ip.ipv6->mcast[x].address.in6_addr );
|
||||
LOG_INF(" multicast[%d]: %s", x, log_strdup(ipv6_addr_str));
|
||||
LOG_INF(" multicast[%d]: %s", x, ipv6_addr_str);
|
||||
}
|
||||
|
||||
if(CONFIG_BACDL_BIP6_ADDRESS_INDEX >= NET_IF_MAX_IPV6_ADDR)
|
||||
@@ -459,7 +459,7 @@ void bip6_set_interface(char *ifname)
|
||||
|
||||
memcpy(&unicast.address, &interface->config.ip.ipv6->unicast
|
||||
[CONFIG_BACDL_BIP6_ADDRESS_INDEX].address.in6_addr, IP6_ADDRESS_MAX);
|
||||
|
||||
|
||||
if(net_addr_pton(AF_INET6, CONFIG_BACDL_BIP6_MCAST_ADDRESS, &multicast.address))
|
||||
{
|
||||
LOG_ERR("%s:%d - Failed to parse IPv6 multicast address: %s", THIS_FILE, __LINE__, CONFIG_BACDL_BIP6_MCAST_ADDRESS);
|
||||
@@ -468,8 +468,8 @@ void bip6_set_interface(char *ifname)
|
||||
bip6_set_addr(&unicast);
|
||||
bip6_set_broadcast_addr(&multicast);
|
||||
|
||||
LOG_INF(" Unicast: %s", log_strdup(inet6_ntoa((struct in6_addr*)&unicast.address)));
|
||||
LOG_INF(" Multicast: %s", log_strdup(inet6_ntoa((struct in6_addr*)&multicast.address)));
|
||||
LOG_INF(" Unicast: %s", inet6_ntoa((struct in6_addr*)&unicast.address));
|
||||
LOG_INF(" Multicast: %s", inet6_ntoa((struct in6_addr*)&multicast.address));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -490,7 +490,7 @@ bool bip6_init(char *ifname)
|
||||
bip6_set_interface(ifname);
|
||||
|
||||
if (BIP6_Address.s6_addr == 0) {
|
||||
LOG_ERR("%s:%d - Failed to get an IPv6 address on interface: %s\n", THIS_FILE, __LINE__, log_strdup(ifname ? ifname : "[default]"));
|
||||
LOG_ERR("%s:%d - Failed to get an IPv6 address on interface: %s\n", THIS_FILE, __LINE__, ifname ? ifname : "[default]");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user