Feature/router bsd (#821)

* fix router compile warnings declaration-after-statement overlength-strings

* router disable PRINT(debug_level)

* ports rename dlmstp_[linux|bsd] to dlmstp_port

* copy ports/linux/dlmstp_port.c ports/bsd/dlmstp_port.c

* copy ports/linux/dlmstp_port.c ports/bsd/dlmstp_port.c

* fix typedef in bip_get_local_address_ioctl

* copy ports/linux/dlmstp_port.c ports/bsd/dlmstp_port.c

* add bsd support for router app

* fix clang __attribute__ optimize dont work
clang O2/O3/Os are also not working

* fix pre-commit

* fix bsd SO_BINDTODEVICE is not available

* add brew install libconfig for app router and bsd

* fix BACDL_MSTP test on macOS

* remove old comments
This commit is contained in:
Patrick Grimm
2024-10-21 14:53:01 +02:00
committed by GitHub
parent 57c3b81bb1
commit b9de08cf60
18 changed files with 1127 additions and 103 deletions
+12 -12
View File
@@ -61,7 +61,7 @@ uint16_t get_next_free_dnet(void);
int kbhit(void);
inline bool is_network_msg(const BACMSG *msg);
bool is_network_msg(const BACMSG *msg);
int main(int argc, char *argv[])
{
@@ -189,16 +189,16 @@ void print_help(void)
"-c, --config <filepath>\n\tinitialize router with a configuration "
"file (.cfg) located at <filepath>\n"
"-D, --device <dev_type> <iface> [params]\n\tinitialize a <dev_type> "
"device using an <iface> interface specified with\n\t[params]\n"
"\ninit_parameters:\n"
"-n, --network <net>\n\tspecify device network number\n"
"-P, --port <port>\n\tspecify udp port for BIP device\n"
"-m, --mac <mac_address> [max_master] [max_frames]\n\tspecify MSTP "
"port parameters\n"
"-b, --baud <baud>\n\tspecify MSTP port baud rate\n"
"-p, --parity <None|Even|Odd>\n\tspecify MSTP port parity\n"
"-d, --databits <5|6|7|8>\n\tspecify MSTP port databits\n"
"-s, --stopbits <1|2>\n\tspecify MSTP port stopbits\n");
"device using an <iface> interface specified with\n\t[params]\n");
printf("\ninit_parameters:\n"
"-n, --network <net>\n\tspecify device network number\n"
"-P, --port <port>\n\tspecify udp port for BIP device\n"
"-m, --mac <mac_address> [max_master] [max_frames]\n\tspecify MSTP "
"port parameters\n"
"-b, --baud <baud>\n\tspecify MSTP port baud rate\n"
"-p, --parity <None|Even|Odd>\n\tspecify MSTP port parity\n"
"-d, --databits <5|6|7|8>\n\tspecify MSTP port databits\n"
"-s, --stopbits <1|2>\n\tspecify MSTP port stopbits\n");
}
bool read_config(const char *filepath)
@@ -813,6 +813,7 @@ int kbhit(void)
{
static const int STDIN = 0;
static bool initialized = false;
int bytesWaiting;
if (!initialized) {
/* use termios to turn off line buffering */
@@ -824,7 +825,6 @@ int kbhit(void)
initialized = true;
}
int bytesWaiting;
ioctl(STDIN, FIONREAD, &bytesWaiting);
return bytesWaiting;
}