├── .gitignore ├── .gitmodules ├── JayboxMB-Buy.JPG ├── LICENSE ├── README.md ├── basejay.gif ├── build ├── hellworld │ └── helloworld ├── iperf │ └── iperf3 ├── modbus-test-with-PC-Box │ ├── PC-Server │ │ └── tests │ │ │ ├── .deps │ │ │ ├── bandwidth-client.Po │ │ │ ├── bandwidth-server-many-up.Po │ │ │ ├── bandwidth-server-one.Po │ │ │ ├── random-test-client.Po │ │ │ ├── random-test-server.Po │ │ │ ├── unit-test-client.Po │ │ │ ├── unit-test-server.Po │ │ │ └── version.Po │ │ │ ├── .libs │ │ │ ├── bandwidth-client │ │ │ ├── bandwidth-server-many-up │ │ │ ├── bandwidth-server-one │ │ │ ├── random-test-client │ │ │ ├── random-test-server │ │ │ ├── unit-test-client │ │ │ ├── unit-test-server │ │ │ └── version │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── README.md │ │ │ ├── bandwidth-client │ │ │ ├── bandwidth-client.c │ │ │ ├── bandwidth-client.o │ │ │ ├── bandwidth-server-many-up │ │ │ ├── bandwidth-server-many-up.c │ │ │ ├── bandwidth-server-many-up.o │ │ │ ├── bandwidth-server-one │ │ │ ├── bandwidth-server-one.c │ │ │ ├── bandwidth-server-one.o │ │ │ ├── random-test-client │ │ │ ├── random-test-client.c │ │ │ ├── random-test-client.o │ │ │ ├── random-test-server │ │ │ ├── random-test-server.c │ │ │ ├── random-test-server.o │ │ │ ├── stamp-h2 │ │ │ ├── unit-test-client │ │ │ ├── unit-test-client.c │ │ │ ├── unit-test-client.o │ │ │ ├── unit-test-server │ │ │ ├── unit-test-server.c │ │ │ ├── unit-test-server.o │ │ │ ├── unit-test.h │ │ │ ├── unit-test.h.in │ │ │ ├── unit-tests.sh │ │ │ ├── version │ │ │ ├── version.c │ │ │ └── version.o │ └── client-box │ │ ├── bandwidth-client │ │ ├── random-test-client │ │ ├── tests │ │ ├── .deps │ │ │ ├── bandwidth-client.Po │ │ │ ├── bandwidth-server-many-up.Po │ │ │ ├── bandwidth-server-one.Po │ │ │ ├── random-test-client.Po │ │ │ ├── random-test-server.Po │ │ │ ├── unit-test-client.Po │ │ │ ├── unit-test-server.Po │ │ │ └── version.Po │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── README.md │ │ ├── bandwidth-client │ │ ├── bandwidth-client.c │ │ ├── bandwidth-client.o │ │ ├── bandwidth-server-many-up │ │ ├── bandwidth-server-many-up.c │ │ ├── bandwidth-server-many-up.o │ │ ├── bandwidth-server-one │ │ ├── bandwidth-server-one.c │ │ ├── bandwidth-server-one.o │ │ ├── random-test-client │ │ ├── random-test-client.c │ │ ├── random-test-client.o │ │ ├── random-test-server │ │ ├── random-test-server.c │ │ ├── random-test-server.o │ │ ├── stamp-h2 │ │ ├── unit-test-client │ │ ├── unit-test-client.c │ │ ├── unit-test-client.o │ │ ├── unit-test-server │ │ ├── unit-test-server.c │ │ ├── unit-test-server.o │ │ ├── unit-test.h │ │ ├── unit-test.h.in │ │ ├── unit-tests.sh │ │ ├── version │ │ ├── version.c │ │ └── version.o │ │ └── unit-test-client └── zstd │ └── zstd ├── docker_scripts ├── build-fanuc.sh ├── build-helloworld.sh ├── build-iperf.sh ├── build-libmodbus.sh ├── build-mqtt.sh ├── build-pnet.sh ├── build-soem.sh └── build-zstd.sh ├── dockerfile ├── external ├── .DS_Store └── sdk │ ├── environment-setup-armv7a-vfp-neon-oe-linux-gnueabi │ ├── oecore-x86_64-armv7a-vfp-neon-toolchain-nodistro.0.manifest │ └── oecore-x86_64-armv7a-vfp-neon-toolchain-nodistro.0.sh ├── packages └── helloworld │ ├── helloworld.c │ └── makefile └── scripts ├── buildall.sh ├── deploy-fanuc.sh ├── deploy-helloworld.sh ├── deploy-iperf.sh ├── deploy-libmodbus.sh ├── deploy-mqtt.sh ├── deploy-pnet.sh ├── deploy-soem.sh └── deploy-zstd.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | packages/goahead -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "packages/fanuc-control"] 2 | path = packages/fanuc-control 3 | url = https://github.com/usernamegemaoa/robot-control.git 4 | [submodule "packages/p-net"] 5 | path = packages/p-net 6 | url = https://github.com/rtlabs-com/p-net.git 7 | [submodule "packages/SOEM"] 8 | path = packages/SOEM 9 | url = https://github.com/OpenEtherCATsociety/SOEM.git 10 | [submodule "packages/libmodbus"] 11 | path = packages/libmodbus 12 | url = https://github.com/stephane/libmodbus.git 13 | [submodule "packages/iperf"] 14 | path = packages/iperf 15 | url = https://github.com/esnet/iperf.git 16 | [submodule "packages/MQTT-C"] 17 | path = packages/MQTT-C 18 | url = https://github.com/LiamBindle/MQTT-C.git 19 | [submodule "packages/ethersploitip"] 20 | path = packages/ethersploitip 21 | url = https://github.com/thiagoralves/EtherSploit-IP.git 22 | [submodule "packages/aws-iot-device-sdk-embeded"] 23 | path = packages/aws-iot-device-sdk-embeded 24 | url = https://github.com/aws/aws-iot-device-sdk-embedded-c.git 25 | [submodule "packages/freeopcua"] 26 | path = packages/freeopcua 27 | url = https://github.com/FreeOpcUa/freeopcua 28 | [submodule "packages/zstd"] 29 | path = packages/zstd 30 | url = https://github.com/facebook/zstd.git 31 | [submodule "packages/mf2b"] 32 | path = packages/mf2b 33 | url = https://github.com/gindul/mf2b.git 34 | -------------------------------------------------------------------------------- /JayboxMB-Buy.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/JayboxMB-Buy.JPG -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BaseJay: Docker Dev. Kit 2 | 3 | ![](basejay.gif) 4 | 5 | BaseJay is part of [The Open EdgeComputing Hardware Project](https://jieqi.io/open.html). 6 | Create your own software with BaseJay Docker Development Kit on linux, Mac and windows, we recommend the visual studio code as the IDE. 7 | 8 | ## Requirements 9 | 10 | * docker 11 | * standard *nix environment 12 | 13 | ## Build instructions 14 | 15 | ``` 16 | git clone https://github.com/Jieqiio/BaseJay.git 17 | cd basejay 18 | docker build -t basejay:latest . 19 | docker run -dt --name basejay basejay 20 | ``` 21 | 22 | ## Build packages 23 | ``` 24 | git submodule add https://github.com/esnet/iperf.git packages/iperf 25 | cp docker_scripts/build-hellworld.sh docker_scripts/build-iperf.sh 26 | cp scripts/deploy-hello.sh scripts/deploy-iperf.sh 27 | ``` 28 | - Edit `docker_script/build-iperf.sh` based on its compile procedures 29 | - Edit `scripts/deploy-iperf.sh` 30 | 31 | ## to build helloworld 32 | ``` 33 | ./scripts/deploy-hellworld.sh basejay 34 | ``` 35 | 36 | ## to build libmodbus 37 | ``` 38 | ./scripts/deploy-libmodbus.sh basejay 39 | ``` 40 | 41 | ## to build all of basejay 42 | ``` 43 | ./scripts/buildall.sh basejay 44 | ``` 45 | 46 | ## File structure 47 | 48 | ``` 49 | packages # packages library 50 | helloworld # example 51 | libmodbus # modbus library 52 | iperf # iperf 53 | SOEM # EtherCAT Master 54 | fanuc-control # fanuc control 55 | p-net # p-net Profinet device stack 56 | MQTT-C # MQTT 57 | zstd # Zstandard - Fast real-time compression algorithm 58 | external # external libraries 59 | build # build results 60 | docker_scripts # scripts copied into docker image to run build task 61 | scripts # scripts to be run on host OS 62 | ``` 63 | 64 | ## Contact 65 | 66 | - [The EdgeComputing Open hardware Project](https://jieqi.io/open.html) 67 | - email: open@jieqi.io 68 | 69 | ## TODO 70 | ### Immediate Feature Goals 71 | 72 | - [x] OPC-UA: https://github.com/open62541/open62541 73 | - [x] FreeOpc-UA: https://github.com/FreeOpcUa/freeopcua 74 | - [x] TDengine: https://github.com/taosdata/TDengine 75 | - [x] memcached: https://github.com/memcached/memcached 76 | - [x] IndigoSCADA https://github.com/brucebot/IndigoSCADA.git 77 | ### Midterm Feature Goals 78 | - [x] CODESYS Integration 79 | - [x] PowerLink Slave 80 | 81 | ### Longterm Feature Goals 82 | - [x] Package Manger System 83 | 84 | 85 | We accept pull requests. Kindly add comments to your code before sending one. 86 | 87 | -------------------------------------------------------------------------------- /basejay.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/basejay.gif -------------------------------------------------------------------------------- /build/hellworld/helloworld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/hellworld/helloworld -------------------------------------------------------------------------------- /build/iperf/iperf3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/iperf/iperf3 -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/.deps/version.Po: -------------------------------------------------------------------------------- 1 | version.o: version.c ../config.h \ 2 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h \ 3 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h \ 4 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h \ 5 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h \ 6 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h \ 7 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h \ 8 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h \ 9 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h \ 10 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h \ 11 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h \ 12 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/i386/_types.h \ 13 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h \ 14 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h \ 15 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h \ 16 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/i386/types.h \ 17 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h \ 18 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h \ 19 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h \ 20 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h \ 21 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h \ 22 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h \ 23 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h \ 24 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h \ 25 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h \ 26 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h \ 27 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h \ 28 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h \ 29 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h \ 30 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h \ 31 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h \ 32 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h \ 33 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h \ 34 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h \ 35 | ../src/modbus.h \ 36 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.3/include/stdint.h \ 37 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h \ 38 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h \ 39 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h \ 40 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h \ 41 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h \ 42 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h \ 43 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h \ 44 | ../src/modbus-version.h ../src/modbus-tcp.h ../src/modbus-rtu.h 45 | 46 | ../config.h: 47 | 48 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h: 49 | 50 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h: 51 | 52 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h: 53 | 54 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h: 55 | 56 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h: 57 | 58 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h: 59 | 60 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h: 61 | 62 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h: 63 | 64 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h: 65 | 66 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h: 67 | 68 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/i386/_types.h: 69 | 70 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h: 71 | 72 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h: 73 | 74 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h: 75 | 76 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/i386/types.h: 77 | 78 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h: 79 | 80 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h: 81 | 82 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h: 83 | 84 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h: 85 | 86 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h: 87 | 88 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h: 89 | 90 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h: 91 | 92 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h: 93 | 94 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h: 95 | 96 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h: 97 | 98 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h: 99 | 100 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h: 101 | 102 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h: 103 | 104 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h: 105 | 106 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h: 107 | 108 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h: 109 | 110 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h: 111 | 112 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h: 113 | 114 | ../src/modbus.h: 115 | 116 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.3/include/stdint.h: 117 | 118 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h: 119 | 120 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h: 121 | 122 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h: 123 | 124 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h: 125 | 126 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h: 127 | 128 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h: 129 | 130 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h: 131 | 132 | ../src/modbus-version.h: 133 | 134 | ../src/modbus-tcp.h: 135 | 136 | ../src/modbus-rtu.h: 137 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/.libs/bandwidth-client: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/PC-Server/tests/.libs/bandwidth-client -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/.libs/bandwidth-server-many-up: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/PC-Server/tests/.libs/bandwidth-server-many-up -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/.libs/bandwidth-server-one: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/PC-Server/tests/.libs/bandwidth-server-one -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/.libs/random-test-client: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/PC-Server/tests/.libs/random-test-client -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/.libs/random-test-server: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/PC-Server/tests/.libs/random-test-server -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/.libs/unit-test-client: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/PC-Server/tests/.libs/unit-test-client -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/.libs/unit-test-server: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/PC-Server/tests/.libs/unit-test-server -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/.libs/version: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/PC-Server/tests/.libs/version -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2014 by Stéphane Raimbault 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above 12 | copyright notice, this list of conditions and the following 13 | disclaimer in the documentation and/or other materials provided 14 | with the distribution. 15 | 16 | * The names of the contributors may not be used to endorse or 17 | promote products derived from this software without specific 18 | prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = README.md unit-tests.sh 2 | 3 | noinst_PROGRAMS = \ 4 | bandwidth-server-one \ 5 | bandwidth-server-many-up \ 6 | bandwidth-client \ 7 | random-test-server \ 8 | random-test-client \ 9 | unit-test-server \ 10 | unit-test-client \ 11 | version 12 | 13 | common_ldflags = \ 14 | $(top_builddir)/src/libmodbus.la 15 | 16 | bandwidth_server_one_SOURCES = bandwidth-server-one.c 17 | bandwidth_server_one_LDADD = $(common_ldflags) 18 | 19 | bandwidth_server_many_up_SOURCES = bandwidth-server-many-up.c 20 | bandwidth_server_many_up_LDADD = $(common_ldflags) 21 | 22 | bandwidth_client_SOURCES = bandwidth-client.c 23 | bandwidth_client_LDADD = $(common_ldflags) 24 | 25 | random_test_server_SOURCES = random-test-server.c 26 | random_test_server_LDADD = $(common_ldflags) 27 | 28 | random_test_client_SOURCES = random-test-client.c 29 | random_test_client_LDADD = $(common_ldflags) 30 | 31 | unit_test_server_SOURCES = unit-test-server.c unit-test.h 32 | unit_test_server_LDADD = $(common_ldflags) 33 | 34 | unit_test_client_SOURCES = unit-test-client.c unit-test.h 35 | unit_test_client_LDADD = $(common_ldflags) 36 | 37 | version_SOURCES = version.c 38 | version_LDADD = $(common_ldflags) 39 | 40 | AM_CPPFLAGS = \ 41 | -include $(top_builddir)/config.h \ 42 | -DSYSCONFDIR=\""$(sysconfdir)"\" \ 43 | -DLIBEXECDIR=\""$(libexecdir)"\" \ 44 | -I${top_srcdir}/src \ 45 | -I${top_builddir}/src 46 | 47 | AM_CFLAGS = ${my_CFLAGS} 48 | 49 | CLEANFILES = *~ *.log 50 | 51 | noinst_SCRIPTS=unit-tests.sh 52 | TESTS=./unit-tests.sh 53 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/README.md: -------------------------------------------------------------------------------- 1 | # License 2 | Test programs of this directory are provided under BSD license (see associated 3 | LICENSE file). 4 | 5 | # Compilation 6 | After installation, you can use pkg-config to compile these tests. 7 | For example, to compile random-test-server run: 8 | 9 | gcc random-test-server.c -o random-test-server `pkg-config --libs --cflags libmodbus` 10 | 11 | - `random-test-server` is necessary to launch a server before running 12 | random-test-client. By default, it receives and replies to Modbus query on the 13 | localhost and port 1502. 14 | 15 | - `random-test-client` sends many different queries to a large range of 16 | addresses and values to test the communication between the client and the 17 | server. 18 | 19 | - `unit-test-server` and `unit-test-client` run a full unit test suite. These 20 | programs are essential to test the Modbus protocol implementation and libmodbus 21 | behavior. 22 | 23 | - `bandwidth-server-one`, `bandwidth-server-many-up` and `bandwidth-client` 24 | return very useful information about the performance of transfert rate between 25 | the server and the client. `bandwidth-server-one` can only handles one 26 | connection at once with a client whereas `bandwidth-server-many-up` opens a 27 | connection for each new clients (with a limit). 28 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/bandwidth-client: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # bandwidth-client - temporary wrapper script for .libs/bandwidth-client 4 | # Generated by libtool (GNU libtool) 2.4.6 5 | # 6 | # The bandwidth-client program cannot be directly executed until all the libtool 7 | # libraries that it depends on are installed. 8 | # 9 | # This wrapper script should never be moved out of the build directory. 10 | # If it is, it will not operate correctly. 11 | 12 | # Sed substitution that helps us do robust quoting. It backslashifies 13 | # metacharacters that are still active within double-quoted strings. 14 | sed_quote_subst='s|\([`"$\\]\)|\\\1|g' 15 | 16 | # Be Bourne compatible 17 | if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then 18 | emulate sh 19 | NULLCMD=: 20 | # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which 21 | # is contrary to our usage. Disable this feature. 22 | alias -g '${1+"$@"}'='"$@"' 23 | setopt NO_GLOB_SUBST 24 | else 25 | case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac 26 | fi 27 | BIN_SH=xpg4; export BIN_SH # for Tru64 28 | DUALCASE=1; export DUALCASE # for MKS sh 29 | 30 | # The HP-UX ksh and POSIX shell print the target directory to stdout 31 | # if CDPATH is set. 32 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 33 | 34 | relink_command="" 35 | 36 | # This environment variable determines our operation mode. 37 | if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then 38 | # install mode needs the following variables: 39 | generated_by_libtool_version='2.4.6' 40 | notinst_deplibs=' ../src/libmodbus.la' 41 | else 42 | # When we are sourced in execute mode, $file and $ECHO are already set. 43 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then 44 | file="$0" 45 | 46 | # A function that is used when there is no print builtin or printf. 47 | func_fallback_echo () 48 | { 49 | eval 'cat <<_LTECHO_EOF 50 | $1 51 | _LTECHO_EOF' 52 | } 53 | ECHO="printf %s\\n" 54 | fi 55 | 56 | # Very basic option parsing. These options are (a) specific to 57 | # the libtool wrapper, (b) are identical between the wrapper 58 | # /script/ and the wrapper /executable/ that is used only on 59 | # windows platforms, and (c) all begin with the string --lt- 60 | # (application programs are unlikely to have options that match 61 | # this pattern). 62 | # 63 | # There are only two supported options: --lt-debug and 64 | # --lt-dump-script. There is, deliberately, no --lt-help. 65 | # 66 | # The first argument to this parsing function should be the 67 | # script's ../libtool value, followed by no. 68 | lt_option_debug= 69 | func_parse_lt_options () 70 | { 71 | lt_script_arg0=$0 72 | shift 73 | for lt_opt 74 | do 75 | case "$lt_opt" in 76 | --lt-debug) lt_option_debug=1 ;; 77 | --lt-dump-script) 78 | lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` 79 | test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. 80 | lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'` 81 | cat "$lt_dump_D/$lt_dump_F" 82 | exit 0 83 | ;; 84 | --lt-*) 85 | $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 86 | exit 1 87 | ;; 88 | esac 89 | done 90 | 91 | # Print the debug banner immediately: 92 | if test -n "$lt_option_debug"; then 93 | echo "bandwidth-client:bandwidth-client:$LINENO: libtool wrapper (GNU libtool) 2.4.6" 1>&2 94 | fi 95 | } 96 | 97 | # Used when --lt-debug. Prints its arguments to stdout 98 | # (redirection is the responsibility of the caller) 99 | func_lt_dump_args () 100 | { 101 | lt_dump_args_N=1; 102 | for lt_arg 103 | do 104 | $ECHO "bandwidth-client:bandwidth-client:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" 105 | lt_dump_args_N=`expr $lt_dump_args_N + 1` 106 | done 107 | } 108 | 109 | # Core function for launching the target application 110 | func_exec_program_core () 111 | { 112 | 113 | if test -n "$lt_option_debug"; then 114 | $ECHO "bandwidth-client:bandwidth-client:$LINENO: newargv[0]: $progdir/$program" 1>&2 115 | func_lt_dump_args ${1+"$@"} 1>&2 116 | fi 117 | exec "$progdir/$program" ${1+"$@"} 118 | 119 | $ECHO "$0: cannot exec $program $*" 1>&2 120 | exit 1 121 | } 122 | 123 | # A function to encapsulate launching the target application 124 | # Strips options in the --lt-* namespace from $@ and 125 | # launches target application with the remaining arguments. 126 | func_exec_program () 127 | { 128 | case " $* " in 129 | *\ --lt-*) 130 | for lt_wr_arg 131 | do 132 | case $lt_wr_arg in 133 | --lt-*) ;; 134 | *) set x "$@" "$lt_wr_arg"; shift;; 135 | esac 136 | shift 137 | done ;; 138 | esac 139 | func_exec_program_core ${1+"$@"} 140 | } 141 | 142 | # Parse options 143 | func_parse_lt_options "$0" ${1+"$@"} 144 | 145 | # Find the directory that this script lives in. 146 | thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` 147 | test "x$thisdir" = "x$file" && thisdir=. 148 | 149 | # Follow symbolic links until we get to the real thisdir. 150 | file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` 151 | while test -n "$file"; do 152 | destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` 153 | 154 | # If there was a directory component, then change thisdir. 155 | if test "x$destdir" != "x$file"; then 156 | case "$destdir" in 157 | [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; 158 | *) thisdir="$thisdir/$destdir" ;; 159 | esac 160 | fi 161 | 162 | file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'` 163 | file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` 164 | done 165 | 166 | # Usually 'no', except on cygwin/mingw when embedded into 167 | # the cwrapper. 168 | WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no 169 | if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then 170 | # special case for '.' 171 | if test "$thisdir" = "."; then 172 | thisdir=`pwd` 173 | fi 174 | # remove .libs from thisdir 175 | case "$thisdir" in 176 | *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;; 177 | .libs ) thisdir=. ;; 178 | esac 179 | fi 180 | 181 | # Try to get the absolute directory name. 182 | absdir=`cd "$thisdir" && pwd` 183 | test -n "$absdir" && thisdir="$absdir" 184 | 185 | program='bandwidth-client' 186 | progdir="$thisdir/.libs" 187 | 188 | 189 | if test -f "$progdir/$program"; then 190 | # Add our own library path to DYLD_LIBRARY_PATH 191 | DYLD_LIBRARY_PATH="/Users/bruceboty/Data/xGuard/J介器互联/CJ公司产品/BlueJayOS/OpenSource/BaseJay/packages/libmodbus/src/.libs:$DYLD_LIBRARY_PATH" 192 | 193 | # Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH 194 | # The second colon is a workaround for a bug in BeOS R4 sed 195 | DYLD_LIBRARY_PATH=`$ECHO "$DYLD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'` 196 | 197 | export DYLD_LIBRARY_PATH 198 | 199 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then 200 | # Run the actual program with our arguments. 201 | func_exec_program ${1+"$@"} 202 | fi 203 | else 204 | # The program doesn't exist. 205 | $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 206 | $ECHO "This script is just a wrapper for $program." 1>&2 207 | $ECHO "See the libtool documentation for more information." 1>&2 208 | exit 1 209 | fi 210 | fi 211 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/bandwidth-client.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008-2014 Stéphane Raimbault 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | 7 | #include 8 | #ifndef _MSC_VER 9 | #include 10 | #include 11 | #endif 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | 19 | #define G_MSEC_PER_SEC 1000 20 | 21 | static uint32_t gettime_ms(void) 22 | { 23 | struct timeval tv; 24 | #if !defined(_MSC_VER) 25 | gettimeofday(&tv, NULL); 26 | return (uint32_t) tv.tv_sec * 1000 + tv.tv_usec / 1000; 27 | #else 28 | return GetTickCount(); 29 | #endif 30 | } 31 | 32 | enum { 33 | TCP, 34 | RTU 35 | }; 36 | 37 | /* Tests based on PI-MBUS-300 documentation */ 38 | int main(int argc, char *argv[]) 39 | { 40 | uint8_t *tab_bit; 41 | uint16_t *tab_reg; 42 | modbus_t *ctx; 43 | int i; 44 | int nb_points; 45 | double elapsed; 46 | uint32_t start; 47 | uint32_t end; 48 | uint32_t bytes; 49 | uint32_t rate; 50 | int rc; 51 | int n_loop; 52 | int use_backend; 53 | 54 | if (argc > 1) { 55 | if (strcmp(argv[1], "tcp") == 0) { 56 | use_backend = TCP; 57 | n_loop = 100000; 58 | } else if (strcmp(argv[1], "rtu") == 0) { 59 | use_backend = RTU; 60 | n_loop = 100; 61 | } else { 62 | printf("Usage:\n %s [tcp|rtu] - Modbus client to measure data bandwith\n\n", argv[0]); 63 | exit(1); 64 | } 65 | } else { 66 | /* By default */ 67 | use_backend = TCP; 68 | n_loop = 100000; 69 | } 70 | 71 | if (use_backend == TCP) { 72 | ctx = modbus_new_tcp("192.168.2.46", 502); 73 | } else { 74 | ctx = modbus_new_rtu("/dev/ttyUSB1", 115200, 'N', 8, 1); 75 | modbus_set_slave(ctx, 1); 76 | } 77 | if (modbus_connect(ctx) == -1) { 78 | fprintf(stderr, "Connection failed: %s\n", 79 | modbus_strerror(errno)); 80 | modbus_free(ctx); 81 | return -1; 82 | } 83 | 84 | /* Allocate and initialize the memory to store the status */ 85 | tab_bit = (uint8_t *) malloc(MODBUS_MAX_READ_BITS * sizeof(uint8_t)); 86 | memset(tab_bit, 0, MODBUS_MAX_READ_BITS * sizeof(uint8_t)); 87 | 88 | /* Allocate and initialize the memory to store the registers */ 89 | tab_reg = (uint16_t *) malloc(MODBUS_MAX_READ_REGISTERS * sizeof(uint16_t)); 90 | memset(tab_reg, 0, MODBUS_MAX_READ_REGISTERS * sizeof(uint16_t)); 91 | 92 | printf("READ BITS\n\n"); 93 | 94 | nb_points = MODBUS_MAX_READ_BITS; 95 | start = gettime_ms(); 96 | for (i=0; i/dev/null 2>&1; then 18 | emulate sh 19 | NULLCMD=: 20 | # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which 21 | # is contrary to our usage. Disable this feature. 22 | alias -g '${1+"$@"}'='"$@"' 23 | setopt NO_GLOB_SUBST 24 | else 25 | case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac 26 | fi 27 | BIN_SH=xpg4; export BIN_SH # for Tru64 28 | DUALCASE=1; export DUALCASE # for MKS sh 29 | 30 | # The HP-UX ksh and POSIX shell print the target directory to stdout 31 | # if CDPATH is set. 32 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 33 | 34 | relink_command="" 35 | 36 | # This environment variable determines our operation mode. 37 | if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then 38 | # install mode needs the following variables: 39 | generated_by_libtool_version='2.4.6' 40 | notinst_deplibs=' ../src/libmodbus.la' 41 | else 42 | # When we are sourced in execute mode, $file and $ECHO are already set. 43 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then 44 | file="$0" 45 | 46 | # A function that is used when there is no print builtin or printf. 47 | func_fallback_echo () 48 | { 49 | eval 'cat <<_LTECHO_EOF 50 | $1 51 | _LTECHO_EOF' 52 | } 53 | ECHO="printf %s\\n" 54 | fi 55 | 56 | # Very basic option parsing. These options are (a) specific to 57 | # the libtool wrapper, (b) are identical between the wrapper 58 | # /script/ and the wrapper /executable/ that is used only on 59 | # windows platforms, and (c) all begin with the string --lt- 60 | # (application programs are unlikely to have options that match 61 | # this pattern). 62 | # 63 | # There are only two supported options: --lt-debug and 64 | # --lt-dump-script. There is, deliberately, no --lt-help. 65 | # 66 | # The first argument to this parsing function should be the 67 | # script's ../libtool value, followed by no. 68 | lt_option_debug= 69 | func_parse_lt_options () 70 | { 71 | lt_script_arg0=$0 72 | shift 73 | for lt_opt 74 | do 75 | case "$lt_opt" in 76 | --lt-debug) lt_option_debug=1 ;; 77 | --lt-dump-script) 78 | lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` 79 | test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. 80 | lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'` 81 | cat "$lt_dump_D/$lt_dump_F" 82 | exit 0 83 | ;; 84 | --lt-*) 85 | $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 86 | exit 1 87 | ;; 88 | esac 89 | done 90 | 91 | # Print the debug banner immediately: 92 | if test -n "$lt_option_debug"; then 93 | echo "bandwidth-server-many-up:bandwidth-server-many-up:$LINENO: libtool wrapper (GNU libtool) 2.4.6" 1>&2 94 | fi 95 | } 96 | 97 | # Used when --lt-debug. Prints its arguments to stdout 98 | # (redirection is the responsibility of the caller) 99 | func_lt_dump_args () 100 | { 101 | lt_dump_args_N=1; 102 | for lt_arg 103 | do 104 | $ECHO "bandwidth-server-many-up:bandwidth-server-many-up:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" 105 | lt_dump_args_N=`expr $lt_dump_args_N + 1` 106 | done 107 | } 108 | 109 | # Core function for launching the target application 110 | func_exec_program_core () 111 | { 112 | 113 | if test -n "$lt_option_debug"; then 114 | $ECHO "bandwidth-server-many-up:bandwidth-server-many-up:$LINENO: newargv[0]: $progdir/$program" 1>&2 115 | func_lt_dump_args ${1+"$@"} 1>&2 116 | fi 117 | exec "$progdir/$program" ${1+"$@"} 118 | 119 | $ECHO "$0: cannot exec $program $*" 1>&2 120 | exit 1 121 | } 122 | 123 | # A function to encapsulate launching the target application 124 | # Strips options in the --lt-* namespace from $@ and 125 | # launches target application with the remaining arguments. 126 | func_exec_program () 127 | { 128 | case " $* " in 129 | *\ --lt-*) 130 | for lt_wr_arg 131 | do 132 | case $lt_wr_arg in 133 | --lt-*) ;; 134 | *) set x "$@" "$lt_wr_arg"; shift;; 135 | esac 136 | shift 137 | done ;; 138 | esac 139 | func_exec_program_core ${1+"$@"} 140 | } 141 | 142 | # Parse options 143 | func_parse_lt_options "$0" ${1+"$@"} 144 | 145 | # Find the directory that this script lives in. 146 | thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` 147 | test "x$thisdir" = "x$file" && thisdir=. 148 | 149 | # Follow symbolic links until we get to the real thisdir. 150 | file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` 151 | while test -n "$file"; do 152 | destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` 153 | 154 | # If there was a directory component, then change thisdir. 155 | if test "x$destdir" != "x$file"; then 156 | case "$destdir" in 157 | [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; 158 | *) thisdir="$thisdir/$destdir" ;; 159 | esac 160 | fi 161 | 162 | file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'` 163 | file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` 164 | done 165 | 166 | # Usually 'no', except on cygwin/mingw when embedded into 167 | # the cwrapper. 168 | WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no 169 | if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then 170 | # special case for '.' 171 | if test "$thisdir" = "."; then 172 | thisdir=`pwd` 173 | fi 174 | # remove .libs from thisdir 175 | case "$thisdir" in 176 | *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;; 177 | .libs ) thisdir=. ;; 178 | esac 179 | fi 180 | 181 | # Try to get the absolute directory name. 182 | absdir=`cd "$thisdir" && pwd` 183 | test -n "$absdir" && thisdir="$absdir" 184 | 185 | program='bandwidth-server-many-up' 186 | progdir="$thisdir/.libs" 187 | 188 | 189 | if test -f "$progdir/$program"; then 190 | # Add our own library path to DYLD_LIBRARY_PATH 191 | DYLD_LIBRARY_PATH="/Users/bruceboty/Data/xGuard/J介器互联/CJ公司产品/BlueJayOS/OpenSource/BaseJay/packages/libmodbus/src/.libs:$DYLD_LIBRARY_PATH" 192 | 193 | # Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH 194 | # The second colon is a workaround for a bug in BeOS R4 sed 195 | DYLD_LIBRARY_PATH=`$ECHO "$DYLD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'` 196 | 197 | export DYLD_LIBRARY_PATH 198 | 199 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then 200 | # Run the actual program with our arguments. 201 | func_exec_program ${1+"$@"} 202 | fi 203 | else 204 | # The program doesn't exist. 205 | $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 206 | $ECHO "This script is just a wrapper for $program." 1>&2 207 | $ECHO "See the libtool documentation for more information." 1>&2 208 | exit 1 209 | fi 210 | fi 211 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/bandwidth-server-many-up.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008-2014 Stéphane Raimbault 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | #if defined(_WIN32) 17 | #include 18 | #else 19 | #include 20 | #include 21 | #include 22 | #include 23 | #endif 24 | 25 | #define NB_CONNECTION 5 26 | 27 | static modbus_t *ctx = NULL; 28 | static modbus_mapping_t *mb_mapping; 29 | 30 | static int server_socket = -1; 31 | 32 | static void close_sigint(int dummy) 33 | { 34 | if (server_socket != -1) { 35 | close(server_socket); 36 | } 37 | modbus_free(ctx); 38 | modbus_mapping_free(mb_mapping); 39 | 40 | exit(dummy); 41 | } 42 | 43 | int main(void) 44 | { 45 | uint8_t query[MODBUS_TCP_MAX_ADU_LENGTH]; 46 | int master_socket; 47 | int rc; 48 | fd_set refset; 49 | fd_set rdset; 50 | /* Maximum file descriptor number */ 51 | int fdmax; 52 | 53 | ctx = modbus_new_tcp("0.0.0.0", 502); 54 | 55 | mb_mapping = modbus_mapping_new(MODBUS_MAX_READ_BITS, 0, 56 | MODBUS_MAX_READ_REGISTERS, 0); 57 | if (mb_mapping == NULL) { 58 | fprintf(stderr, "Failed to allocate the mapping: %s\n", 59 | modbus_strerror(errno)); 60 | modbus_free(ctx); 61 | return -1; 62 | } 63 | 64 | server_socket = modbus_tcp_listen(ctx, NB_CONNECTION); 65 | if (server_socket == -1) { 66 | fprintf(stderr, "Unable to listen TCP connection\n"); 67 | modbus_free(ctx); 68 | return -1; 69 | } 70 | 71 | signal(SIGINT, close_sigint); 72 | 73 | /* Clear the reference set of socket */ 74 | FD_ZERO(&refset); 75 | /* Add the server socket */ 76 | FD_SET(server_socket, &refset); 77 | 78 | /* Keep track of the max file descriptor */ 79 | fdmax = server_socket; 80 | 81 | for (;;) { 82 | rdset = refset; 83 | if (select(fdmax+1, &rdset, NULL, NULL, NULL) == -1) { 84 | perror("Server select() failure."); 85 | close_sigint(1); 86 | } 87 | 88 | /* Run through the existing connections looking for data to be 89 | * read */ 90 | for (master_socket = 0; master_socket <= fdmax; master_socket++) { 91 | 92 | if (!FD_ISSET(master_socket, &rdset)) { 93 | continue; 94 | } 95 | 96 | if (master_socket == server_socket) { 97 | /* A client is asking a new connection */ 98 | socklen_t addrlen; 99 | struct sockaddr_in clientaddr; 100 | int newfd; 101 | 102 | /* Handle new connections */ 103 | addrlen = sizeof(clientaddr); 104 | memset(&clientaddr, 0, sizeof(clientaddr)); 105 | newfd = accept(server_socket, (struct sockaddr *)&clientaddr, &addrlen); 106 | if (newfd == -1) { 107 | perror("Server accept() error"); 108 | } else { 109 | FD_SET(newfd, &refset); 110 | 111 | if (newfd > fdmax) { 112 | /* Keep track of the maximum */ 113 | fdmax = newfd; 114 | } 115 | printf("New connection from %s:%d on socket %d\n", 116 | inet_ntoa(clientaddr.sin_addr), clientaddr.sin_port, newfd); 117 | } 118 | } else { 119 | modbus_set_socket(ctx, master_socket); 120 | rc = modbus_receive(ctx, query); 121 | if (rc > 0) { 122 | modbus_reply(ctx, query, rc, mb_mapping); 123 | } else if (rc == -1) { 124 | /* This example server in ended on connection closing or 125 | * any errors. */ 126 | printf("Connection closed on socket %d\n", master_socket); 127 | close(master_socket); 128 | 129 | /* Remove from reference set */ 130 | FD_CLR(master_socket, &refset); 131 | 132 | if (master_socket == fdmax) { 133 | fdmax--; 134 | } 135 | } 136 | } 137 | } 138 | } 139 | 140 | return 0; 141 | } 142 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/bandwidth-server-many-up.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/PC-Server/tests/bandwidth-server-many-up.o -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/bandwidth-server-one: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # bandwidth-server-one - temporary wrapper script for .libs/bandwidth-server-one 4 | # Generated by libtool (GNU libtool) 2.4.6 5 | # 6 | # The bandwidth-server-one program cannot be directly executed until all the libtool 7 | # libraries that it depends on are installed. 8 | # 9 | # This wrapper script should never be moved out of the build directory. 10 | # If it is, it will not operate correctly. 11 | 12 | # Sed substitution that helps us do robust quoting. It backslashifies 13 | # metacharacters that are still active within double-quoted strings. 14 | sed_quote_subst='s|\([`"$\\]\)|\\\1|g' 15 | 16 | # Be Bourne compatible 17 | if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then 18 | emulate sh 19 | NULLCMD=: 20 | # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which 21 | # is contrary to our usage. Disable this feature. 22 | alias -g '${1+"$@"}'='"$@"' 23 | setopt NO_GLOB_SUBST 24 | else 25 | case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac 26 | fi 27 | BIN_SH=xpg4; export BIN_SH # for Tru64 28 | DUALCASE=1; export DUALCASE # for MKS sh 29 | 30 | # The HP-UX ksh and POSIX shell print the target directory to stdout 31 | # if CDPATH is set. 32 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 33 | 34 | relink_command="" 35 | 36 | # This environment variable determines our operation mode. 37 | if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then 38 | # install mode needs the following variables: 39 | generated_by_libtool_version='2.4.6' 40 | notinst_deplibs=' ../src/libmodbus.la' 41 | else 42 | # When we are sourced in execute mode, $file and $ECHO are already set. 43 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then 44 | file="$0" 45 | 46 | # A function that is used when there is no print builtin or printf. 47 | func_fallback_echo () 48 | { 49 | eval 'cat <<_LTECHO_EOF 50 | $1 51 | _LTECHO_EOF' 52 | } 53 | ECHO="printf %s\\n" 54 | fi 55 | 56 | # Very basic option parsing. These options are (a) specific to 57 | # the libtool wrapper, (b) are identical between the wrapper 58 | # /script/ and the wrapper /executable/ that is used only on 59 | # windows platforms, and (c) all begin with the string --lt- 60 | # (application programs are unlikely to have options that match 61 | # this pattern). 62 | # 63 | # There are only two supported options: --lt-debug and 64 | # --lt-dump-script. There is, deliberately, no --lt-help. 65 | # 66 | # The first argument to this parsing function should be the 67 | # script's ../libtool value, followed by no. 68 | lt_option_debug= 69 | func_parse_lt_options () 70 | { 71 | lt_script_arg0=$0 72 | shift 73 | for lt_opt 74 | do 75 | case "$lt_opt" in 76 | --lt-debug) lt_option_debug=1 ;; 77 | --lt-dump-script) 78 | lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` 79 | test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. 80 | lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'` 81 | cat "$lt_dump_D/$lt_dump_F" 82 | exit 0 83 | ;; 84 | --lt-*) 85 | $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 86 | exit 1 87 | ;; 88 | esac 89 | done 90 | 91 | # Print the debug banner immediately: 92 | if test -n "$lt_option_debug"; then 93 | echo "bandwidth-server-one:bandwidth-server-one:$LINENO: libtool wrapper (GNU libtool) 2.4.6" 1>&2 94 | fi 95 | } 96 | 97 | # Used when --lt-debug. Prints its arguments to stdout 98 | # (redirection is the responsibility of the caller) 99 | func_lt_dump_args () 100 | { 101 | lt_dump_args_N=1; 102 | for lt_arg 103 | do 104 | $ECHO "bandwidth-server-one:bandwidth-server-one:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" 105 | lt_dump_args_N=`expr $lt_dump_args_N + 1` 106 | done 107 | } 108 | 109 | # Core function for launching the target application 110 | func_exec_program_core () 111 | { 112 | 113 | if test -n "$lt_option_debug"; then 114 | $ECHO "bandwidth-server-one:bandwidth-server-one:$LINENO: newargv[0]: $progdir/$program" 1>&2 115 | func_lt_dump_args ${1+"$@"} 1>&2 116 | fi 117 | exec "$progdir/$program" ${1+"$@"} 118 | 119 | $ECHO "$0: cannot exec $program $*" 1>&2 120 | exit 1 121 | } 122 | 123 | # A function to encapsulate launching the target application 124 | # Strips options in the --lt-* namespace from $@ and 125 | # launches target application with the remaining arguments. 126 | func_exec_program () 127 | { 128 | case " $* " in 129 | *\ --lt-*) 130 | for lt_wr_arg 131 | do 132 | case $lt_wr_arg in 133 | --lt-*) ;; 134 | *) set x "$@" "$lt_wr_arg"; shift;; 135 | esac 136 | shift 137 | done ;; 138 | esac 139 | func_exec_program_core ${1+"$@"} 140 | } 141 | 142 | # Parse options 143 | func_parse_lt_options "$0" ${1+"$@"} 144 | 145 | # Find the directory that this script lives in. 146 | thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` 147 | test "x$thisdir" = "x$file" && thisdir=. 148 | 149 | # Follow symbolic links until we get to the real thisdir. 150 | file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` 151 | while test -n "$file"; do 152 | destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` 153 | 154 | # If there was a directory component, then change thisdir. 155 | if test "x$destdir" != "x$file"; then 156 | case "$destdir" in 157 | [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; 158 | *) thisdir="$thisdir/$destdir" ;; 159 | esac 160 | fi 161 | 162 | file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'` 163 | file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` 164 | done 165 | 166 | # Usually 'no', except on cygwin/mingw when embedded into 167 | # the cwrapper. 168 | WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no 169 | if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then 170 | # special case for '.' 171 | if test "$thisdir" = "."; then 172 | thisdir=`pwd` 173 | fi 174 | # remove .libs from thisdir 175 | case "$thisdir" in 176 | *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;; 177 | .libs ) thisdir=. ;; 178 | esac 179 | fi 180 | 181 | # Try to get the absolute directory name. 182 | absdir=`cd "$thisdir" && pwd` 183 | test -n "$absdir" && thisdir="$absdir" 184 | 185 | program='bandwidth-server-one' 186 | progdir="$thisdir/.libs" 187 | 188 | 189 | if test -f "$progdir/$program"; then 190 | # Add our own library path to DYLD_LIBRARY_PATH 191 | DYLD_LIBRARY_PATH="/Users/bruceboty/Data/xGuard/J介器互联/CJ公司产品/BlueJayOS/OpenSource/BaseJay/packages/libmodbus/src/.libs:$DYLD_LIBRARY_PATH" 192 | 193 | # Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH 194 | # The second colon is a workaround for a bug in BeOS R4 sed 195 | DYLD_LIBRARY_PATH=`$ECHO "$DYLD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'` 196 | 197 | export DYLD_LIBRARY_PATH 198 | 199 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then 200 | # Run the actual program with our arguments. 201 | func_exec_program ${1+"$@"} 202 | fi 203 | else 204 | # The program doesn't exist. 205 | $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 206 | $ECHO "This script is just a wrapper for $program." 1>&2 207 | $ECHO "See the libtool documentation for more information." 1>&2 208 | exit 1 209 | fi 210 | fi 211 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/bandwidth-server-one.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008-2014 Stéphane Raimbault 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | 7 | #include 8 | #ifndef _MSC_VER 9 | #include 10 | #endif 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | #if defined(_WIN32) 18 | #define close closesocket 19 | #endif 20 | 21 | enum { 22 | TCP, 23 | RTU 24 | }; 25 | 26 | int main(int argc, char *argv[]) 27 | { 28 | int s = -1; 29 | modbus_t *ctx = NULL; 30 | modbus_mapping_t *mb_mapping = NULL; 31 | int rc; 32 | int use_backend; 33 | 34 | /* TCP */ 35 | if (argc > 1) { 36 | if (strcmp(argv[1], "tcp") == 0) { 37 | use_backend = TCP; 38 | } else if (strcmp(argv[1], "rtu") == 0) { 39 | use_backend = RTU; 40 | } else { 41 | printf("Usage:\n %s [tcp|rtu] - Modbus client to measure data bandwith\n\n", argv[0]); 42 | exit(1); 43 | } 44 | } else { 45 | /* By default */ 46 | use_backend = TCP; 47 | } 48 | 49 | if (use_backend == TCP) { 50 | ctx = modbus_new_tcp("0.0.0.0", 502); 51 | s = modbus_tcp_listen(ctx, 1); 52 | modbus_tcp_accept(ctx, &s); 53 | 54 | } else { 55 | ctx = modbus_new_rtu("/dev/ttyUSB0", 115200, 'N', 8, 1); 56 | modbus_set_slave(ctx, 1); 57 | modbus_connect(ctx); 58 | } 59 | 60 | mb_mapping = modbus_mapping_new(MODBUS_MAX_READ_BITS, 0, 61 | MODBUS_MAX_READ_REGISTERS, 0); 62 | if (mb_mapping == NULL) { 63 | fprintf(stderr, "Failed to allocate the mapping: %s\n", 64 | modbus_strerror(errno)); 65 | modbus_free(ctx); 66 | return -1; 67 | } 68 | 69 | for(;;) { 70 | uint8_t query[MODBUS_TCP_MAX_ADU_LENGTH]; 71 | 72 | rc = modbus_receive(ctx, query); 73 | if (rc > 0) { 74 | modbus_reply(ctx, query, rc, mb_mapping); 75 | } else if (rc == -1) { 76 | /* Connection closed by the client or error */ 77 | break; 78 | } 79 | } 80 | 81 | printf("Quit the loop: %s\n", modbus_strerror(errno)); 82 | 83 | modbus_mapping_free(mb_mapping); 84 | if (s != -1) { 85 | close(s); 86 | } 87 | /* For RTU, skipped by TCP (no TCP connect) */ 88 | modbus_close(ctx); 89 | modbus_free(ctx); 90 | 91 | return 0; 92 | } 93 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/bandwidth-server-one.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/PC-Server/tests/bandwidth-server-one.o -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/random-test-client: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # random-test-client - temporary wrapper script for .libs/random-test-client 4 | # Generated by libtool (GNU libtool) 2.4.6 5 | # 6 | # The random-test-client program cannot be directly executed until all the libtool 7 | # libraries that it depends on are installed. 8 | # 9 | # This wrapper script should never be moved out of the build directory. 10 | # If it is, it will not operate correctly. 11 | 12 | # Sed substitution that helps us do robust quoting. It backslashifies 13 | # metacharacters that are still active within double-quoted strings. 14 | sed_quote_subst='s|\([`"$\\]\)|\\\1|g' 15 | 16 | # Be Bourne compatible 17 | if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then 18 | emulate sh 19 | NULLCMD=: 20 | # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which 21 | # is contrary to our usage. Disable this feature. 22 | alias -g '${1+"$@"}'='"$@"' 23 | setopt NO_GLOB_SUBST 24 | else 25 | case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac 26 | fi 27 | BIN_SH=xpg4; export BIN_SH # for Tru64 28 | DUALCASE=1; export DUALCASE # for MKS sh 29 | 30 | # The HP-UX ksh and POSIX shell print the target directory to stdout 31 | # if CDPATH is set. 32 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 33 | 34 | relink_command="" 35 | 36 | # This environment variable determines our operation mode. 37 | if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then 38 | # install mode needs the following variables: 39 | generated_by_libtool_version='2.4.6' 40 | notinst_deplibs=' ../src/libmodbus.la' 41 | else 42 | # When we are sourced in execute mode, $file and $ECHO are already set. 43 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then 44 | file="$0" 45 | 46 | # A function that is used when there is no print builtin or printf. 47 | func_fallback_echo () 48 | { 49 | eval 'cat <<_LTECHO_EOF 50 | $1 51 | _LTECHO_EOF' 52 | } 53 | ECHO="printf %s\\n" 54 | fi 55 | 56 | # Very basic option parsing. These options are (a) specific to 57 | # the libtool wrapper, (b) are identical between the wrapper 58 | # /script/ and the wrapper /executable/ that is used only on 59 | # windows platforms, and (c) all begin with the string --lt- 60 | # (application programs are unlikely to have options that match 61 | # this pattern). 62 | # 63 | # There are only two supported options: --lt-debug and 64 | # --lt-dump-script. There is, deliberately, no --lt-help. 65 | # 66 | # The first argument to this parsing function should be the 67 | # script's ../libtool value, followed by no. 68 | lt_option_debug= 69 | func_parse_lt_options () 70 | { 71 | lt_script_arg0=$0 72 | shift 73 | for lt_opt 74 | do 75 | case "$lt_opt" in 76 | --lt-debug) lt_option_debug=1 ;; 77 | --lt-dump-script) 78 | lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` 79 | test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. 80 | lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'` 81 | cat "$lt_dump_D/$lt_dump_F" 82 | exit 0 83 | ;; 84 | --lt-*) 85 | $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 86 | exit 1 87 | ;; 88 | esac 89 | done 90 | 91 | # Print the debug banner immediately: 92 | if test -n "$lt_option_debug"; then 93 | echo "random-test-client:random-test-client:$LINENO: libtool wrapper (GNU libtool) 2.4.6" 1>&2 94 | fi 95 | } 96 | 97 | # Used when --lt-debug. Prints its arguments to stdout 98 | # (redirection is the responsibility of the caller) 99 | func_lt_dump_args () 100 | { 101 | lt_dump_args_N=1; 102 | for lt_arg 103 | do 104 | $ECHO "random-test-client:random-test-client:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" 105 | lt_dump_args_N=`expr $lt_dump_args_N + 1` 106 | done 107 | } 108 | 109 | # Core function for launching the target application 110 | func_exec_program_core () 111 | { 112 | 113 | if test -n "$lt_option_debug"; then 114 | $ECHO "random-test-client:random-test-client:$LINENO: newargv[0]: $progdir/$program" 1>&2 115 | func_lt_dump_args ${1+"$@"} 1>&2 116 | fi 117 | exec "$progdir/$program" ${1+"$@"} 118 | 119 | $ECHO "$0: cannot exec $program $*" 1>&2 120 | exit 1 121 | } 122 | 123 | # A function to encapsulate launching the target application 124 | # Strips options in the --lt-* namespace from $@ and 125 | # launches target application with the remaining arguments. 126 | func_exec_program () 127 | { 128 | case " $* " in 129 | *\ --lt-*) 130 | for lt_wr_arg 131 | do 132 | case $lt_wr_arg in 133 | --lt-*) ;; 134 | *) set x "$@" "$lt_wr_arg"; shift;; 135 | esac 136 | shift 137 | done ;; 138 | esac 139 | func_exec_program_core ${1+"$@"} 140 | } 141 | 142 | # Parse options 143 | func_parse_lt_options "$0" ${1+"$@"} 144 | 145 | # Find the directory that this script lives in. 146 | thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` 147 | test "x$thisdir" = "x$file" && thisdir=. 148 | 149 | # Follow symbolic links until we get to the real thisdir. 150 | file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` 151 | while test -n "$file"; do 152 | destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` 153 | 154 | # If there was a directory component, then change thisdir. 155 | if test "x$destdir" != "x$file"; then 156 | case "$destdir" in 157 | [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; 158 | *) thisdir="$thisdir/$destdir" ;; 159 | esac 160 | fi 161 | 162 | file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'` 163 | file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` 164 | done 165 | 166 | # Usually 'no', except on cygwin/mingw when embedded into 167 | # the cwrapper. 168 | WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no 169 | if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then 170 | # special case for '.' 171 | if test "$thisdir" = "."; then 172 | thisdir=`pwd` 173 | fi 174 | # remove .libs from thisdir 175 | case "$thisdir" in 176 | *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;; 177 | .libs ) thisdir=. ;; 178 | esac 179 | fi 180 | 181 | # Try to get the absolute directory name. 182 | absdir=`cd "$thisdir" && pwd` 183 | test -n "$absdir" && thisdir="$absdir" 184 | 185 | program='random-test-client' 186 | progdir="$thisdir/.libs" 187 | 188 | 189 | if test -f "$progdir/$program"; then 190 | # Add our own library path to DYLD_LIBRARY_PATH 191 | DYLD_LIBRARY_PATH="/Users/bruceboty/Data/xGuard/J介器互联/CJ公司产品/BlueJayOS/OpenSource/BaseJay/packages/libmodbus/src/.libs:$DYLD_LIBRARY_PATH" 192 | 193 | # Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH 194 | # The second colon is a workaround for a bug in BeOS R4 sed 195 | DYLD_LIBRARY_PATH=`$ECHO "$DYLD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'` 196 | 197 | export DYLD_LIBRARY_PATH 198 | 199 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then 200 | # Run the actual program with our arguments. 201 | func_exec_program ${1+"$@"} 202 | fi 203 | else 204 | # The program doesn't exist. 205 | $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 206 | $ECHO "This script is just a wrapper for $program." 1>&2 207 | $ECHO "See the libtool documentation for more information." 1>&2 208 | exit 1 209 | fi 210 | fi 211 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/random-test-client.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008-2014 Stéphane Raimbault 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | 7 | #include 8 | #ifndef _MSC_VER 9 | #include 10 | #endif 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | /* The goal of this program is to check all major functions of 18 | libmodbus: 19 | - write_coil 20 | - read_bits 21 | - write_coils 22 | - write_register 23 | - read_registers 24 | - write_registers 25 | - read_registers 26 | 27 | All these functions are called with random values on a address 28 | range defined by the following defines. 29 | */ 30 | #define LOOP 1 31 | #define SERVER_ID 17 32 | #define ADDRESS_START 0 33 | #define ADDRESS_END 99 34 | 35 | /* At each loop, the program works in the range ADDRESS_START to 36 | * ADDRESS_END then ADDRESS_START + 1 to ADDRESS_END and so on. 37 | */ 38 | int main(void) 39 | { 40 | modbus_t *ctx; 41 | int rc; 42 | int nb_fail; 43 | int nb_loop; 44 | int addr; 45 | int nb; 46 | uint8_t *tab_rq_bits; 47 | uint8_t *tab_rp_bits; 48 | uint16_t *tab_rq_registers; 49 | uint16_t *tab_rw_rq_registers; 50 | uint16_t *tab_rp_registers; 51 | 52 | /* RTU */ 53 | /* 54 | ctx = modbus_new_rtu("/dev/ttyUSB0", 19200, 'N', 8, 1); 55 | modbus_set_slave(ctx, SERVER_ID); 56 | */ 57 | 58 | /* TCP */ 59 | ctx = modbus_new_tcp("192.168.2.46", 502); 60 | modbus_set_debug(ctx, TRUE); 61 | 62 | if (modbus_connect(ctx) == -1) { 63 | fprintf(stderr, "Connection failed: %s\n", 64 | modbus_strerror(errno)); 65 | modbus_free(ctx); 66 | return -1; 67 | } 68 | 69 | /* Allocate and initialize the different memory spaces */ 70 | nb = ADDRESS_END - ADDRESS_START; 71 | 72 | tab_rq_bits = (uint8_t *) malloc(nb * sizeof(uint8_t)); 73 | memset(tab_rq_bits, 0, nb * sizeof(uint8_t)); 74 | 75 | tab_rp_bits = (uint8_t *) malloc(nb * sizeof(uint8_t)); 76 | memset(tab_rp_bits, 0, nb * sizeof(uint8_t)); 77 | 78 | tab_rq_registers = (uint16_t *) malloc(nb * sizeof(uint16_t)); 79 | memset(tab_rq_registers, 0, nb * sizeof(uint16_t)); 80 | 81 | tab_rp_registers = (uint16_t *) malloc(nb * sizeof(uint16_t)); 82 | memset(tab_rp_registers, 0, nb * sizeof(uint16_t)); 83 | 84 | tab_rw_rq_registers = (uint16_t *) malloc(nb * sizeof(uint16_t)); 85 | memset(tab_rw_rq_registers, 0, nb * sizeof(uint16_t)); 86 | 87 | nb_loop = nb_fail = 0; 88 | while (nb_loop++ < LOOP) { 89 | for (addr = ADDRESS_START; addr < ADDRESS_END; addr++) { 90 | int i; 91 | 92 | /* Random numbers (short) */ 93 | for (i=0; i/dev/null 2>&1; then 18 | emulate sh 19 | NULLCMD=: 20 | # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which 21 | # is contrary to our usage. Disable this feature. 22 | alias -g '${1+"$@"}'='"$@"' 23 | setopt NO_GLOB_SUBST 24 | else 25 | case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac 26 | fi 27 | BIN_SH=xpg4; export BIN_SH # for Tru64 28 | DUALCASE=1; export DUALCASE # for MKS sh 29 | 30 | # The HP-UX ksh and POSIX shell print the target directory to stdout 31 | # if CDPATH is set. 32 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 33 | 34 | relink_command="" 35 | 36 | # This environment variable determines our operation mode. 37 | if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then 38 | # install mode needs the following variables: 39 | generated_by_libtool_version='2.4.6' 40 | notinst_deplibs=' ../src/libmodbus.la' 41 | else 42 | # When we are sourced in execute mode, $file and $ECHO are already set. 43 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then 44 | file="$0" 45 | 46 | # A function that is used when there is no print builtin or printf. 47 | func_fallback_echo () 48 | { 49 | eval 'cat <<_LTECHO_EOF 50 | $1 51 | _LTECHO_EOF' 52 | } 53 | ECHO="printf %s\\n" 54 | fi 55 | 56 | # Very basic option parsing. These options are (a) specific to 57 | # the libtool wrapper, (b) are identical between the wrapper 58 | # /script/ and the wrapper /executable/ that is used only on 59 | # windows platforms, and (c) all begin with the string --lt- 60 | # (application programs are unlikely to have options that match 61 | # this pattern). 62 | # 63 | # There are only two supported options: --lt-debug and 64 | # --lt-dump-script. There is, deliberately, no --lt-help. 65 | # 66 | # The first argument to this parsing function should be the 67 | # script's ../libtool value, followed by no. 68 | lt_option_debug= 69 | func_parse_lt_options () 70 | { 71 | lt_script_arg0=$0 72 | shift 73 | for lt_opt 74 | do 75 | case "$lt_opt" in 76 | --lt-debug) lt_option_debug=1 ;; 77 | --lt-dump-script) 78 | lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` 79 | test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. 80 | lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'` 81 | cat "$lt_dump_D/$lt_dump_F" 82 | exit 0 83 | ;; 84 | --lt-*) 85 | $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 86 | exit 1 87 | ;; 88 | esac 89 | done 90 | 91 | # Print the debug banner immediately: 92 | if test -n "$lt_option_debug"; then 93 | echo "random-test-server:random-test-server:$LINENO: libtool wrapper (GNU libtool) 2.4.6" 1>&2 94 | fi 95 | } 96 | 97 | # Used when --lt-debug. Prints its arguments to stdout 98 | # (redirection is the responsibility of the caller) 99 | func_lt_dump_args () 100 | { 101 | lt_dump_args_N=1; 102 | for lt_arg 103 | do 104 | $ECHO "random-test-server:random-test-server:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" 105 | lt_dump_args_N=`expr $lt_dump_args_N + 1` 106 | done 107 | } 108 | 109 | # Core function for launching the target application 110 | func_exec_program_core () 111 | { 112 | 113 | if test -n "$lt_option_debug"; then 114 | $ECHO "random-test-server:random-test-server:$LINENO: newargv[0]: $progdir/$program" 1>&2 115 | func_lt_dump_args ${1+"$@"} 1>&2 116 | fi 117 | exec "$progdir/$program" ${1+"$@"} 118 | 119 | $ECHO "$0: cannot exec $program $*" 1>&2 120 | exit 1 121 | } 122 | 123 | # A function to encapsulate launching the target application 124 | # Strips options in the --lt-* namespace from $@ and 125 | # launches target application with the remaining arguments. 126 | func_exec_program () 127 | { 128 | case " $* " in 129 | *\ --lt-*) 130 | for lt_wr_arg 131 | do 132 | case $lt_wr_arg in 133 | --lt-*) ;; 134 | *) set x "$@" "$lt_wr_arg"; shift;; 135 | esac 136 | shift 137 | done ;; 138 | esac 139 | func_exec_program_core ${1+"$@"} 140 | } 141 | 142 | # Parse options 143 | func_parse_lt_options "$0" ${1+"$@"} 144 | 145 | # Find the directory that this script lives in. 146 | thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` 147 | test "x$thisdir" = "x$file" && thisdir=. 148 | 149 | # Follow symbolic links until we get to the real thisdir. 150 | file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` 151 | while test -n "$file"; do 152 | destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` 153 | 154 | # If there was a directory component, then change thisdir. 155 | if test "x$destdir" != "x$file"; then 156 | case "$destdir" in 157 | [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; 158 | *) thisdir="$thisdir/$destdir" ;; 159 | esac 160 | fi 161 | 162 | file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'` 163 | file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` 164 | done 165 | 166 | # Usually 'no', except on cygwin/mingw when embedded into 167 | # the cwrapper. 168 | WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no 169 | if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then 170 | # special case for '.' 171 | if test "$thisdir" = "."; then 172 | thisdir=`pwd` 173 | fi 174 | # remove .libs from thisdir 175 | case "$thisdir" in 176 | *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;; 177 | .libs ) thisdir=. ;; 178 | esac 179 | fi 180 | 181 | # Try to get the absolute directory name. 182 | absdir=`cd "$thisdir" && pwd` 183 | test -n "$absdir" && thisdir="$absdir" 184 | 185 | program='random-test-server' 186 | progdir="$thisdir/.libs" 187 | 188 | 189 | if test -f "$progdir/$program"; then 190 | # Add our own library path to DYLD_LIBRARY_PATH 191 | DYLD_LIBRARY_PATH="/Users/bruceboty/Data/xGuard/J介器互联/CJ公司产品/BlueJayOS/OpenSource/BaseJay/packages/libmodbus/src/.libs:$DYLD_LIBRARY_PATH" 192 | 193 | # Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH 194 | # The second colon is a workaround for a bug in BeOS R4 sed 195 | DYLD_LIBRARY_PATH=`$ECHO "$DYLD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'` 196 | 197 | export DYLD_LIBRARY_PATH 198 | 199 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then 200 | # Run the actual program with our arguments. 201 | func_exec_program ${1+"$@"} 202 | fi 203 | else 204 | # The program doesn't exist. 205 | $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 206 | $ECHO "This script is just a wrapper for $program." 1>&2 207 | $ECHO "See the libtool documentation for more information." 1>&2 208 | exit 1 209 | fi 210 | fi 211 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/random-test-server.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008-2014 Stéphane Raimbault 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | 7 | #include 8 | #ifndef _MSC_VER 9 | #include 10 | #endif 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | int main(void) 17 | { 18 | int s = -1; 19 | modbus_t *ctx; 20 | modbus_mapping_t *mb_mapping; 21 | 22 | ctx = modbus_new_tcp("0.0.0.0", 502); 23 | /* modbus_set_debug(ctx, TRUE); */ 24 | 25 | mb_mapping = modbus_mapping_new(500, 500, 500, 500); 26 | if (mb_mapping == NULL) { 27 | fprintf(stderr, "Failed to allocate the mapping: %s\n", 28 | modbus_strerror(errno)); 29 | modbus_free(ctx); 30 | return -1; 31 | } 32 | 33 | s = modbus_tcp_listen(ctx, 1); 34 | modbus_tcp_accept(ctx, &s); 35 | 36 | for (;;) { 37 | uint8_t query[MODBUS_TCP_MAX_ADU_LENGTH]; 38 | int rc; 39 | 40 | rc = modbus_receive(ctx, query); 41 | if (rc > 0) { 42 | /* rc is the query size */ 43 | modbus_reply(ctx, query, rc, mb_mapping); 44 | } else if (rc == -1) { 45 | /* Connection closed by the client or error */ 46 | break; 47 | } 48 | } 49 | 50 | printf("Quit the loop: %s\n", modbus_strerror(errno)); 51 | 52 | if (s != -1) { 53 | close(s); 54 | } 55 | modbus_mapping_free(mb_mapping); 56 | modbus_close(ctx); 57 | modbus_free(ctx); 58 | 59 | return 0; 60 | } 61 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/random-test-server.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/PC-Server/tests/random-test-server.o -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/stamp-h2: -------------------------------------------------------------------------------- 1 | timestamp for tests/unit-test.h 2 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/unit-test-client: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # unit-test-client - temporary wrapper script for .libs/unit-test-client 4 | # Generated by libtool (GNU libtool) 2.4.6 5 | # 6 | # The unit-test-client program cannot be directly executed until all the libtool 7 | # libraries that it depends on are installed. 8 | # 9 | # This wrapper script should never be moved out of the build directory. 10 | # If it is, it will not operate correctly. 11 | 12 | # Sed substitution that helps us do robust quoting. It backslashifies 13 | # metacharacters that are still active within double-quoted strings. 14 | sed_quote_subst='s|\([`"$\\]\)|\\\1|g' 15 | 16 | # Be Bourne compatible 17 | if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then 18 | emulate sh 19 | NULLCMD=: 20 | # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which 21 | # is contrary to our usage. Disable this feature. 22 | alias -g '${1+"$@"}'='"$@"' 23 | setopt NO_GLOB_SUBST 24 | else 25 | case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac 26 | fi 27 | BIN_SH=xpg4; export BIN_SH # for Tru64 28 | DUALCASE=1; export DUALCASE # for MKS sh 29 | 30 | # The HP-UX ksh and POSIX shell print the target directory to stdout 31 | # if CDPATH is set. 32 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 33 | 34 | relink_command="" 35 | 36 | # This environment variable determines our operation mode. 37 | if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then 38 | # install mode needs the following variables: 39 | generated_by_libtool_version='2.4.6' 40 | notinst_deplibs=' ../src/libmodbus.la' 41 | else 42 | # When we are sourced in execute mode, $file and $ECHO are already set. 43 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then 44 | file="$0" 45 | 46 | # A function that is used when there is no print builtin or printf. 47 | func_fallback_echo () 48 | { 49 | eval 'cat <<_LTECHO_EOF 50 | $1 51 | _LTECHO_EOF' 52 | } 53 | ECHO="printf %s\\n" 54 | fi 55 | 56 | # Very basic option parsing. These options are (a) specific to 57 | # the libtool wrapper, (b) are identical between the wrapper 58 | # /script/ and the wrapper /executable/ that is used only on 59 | # windows platforms, and (c) all begin with the string --lt- 60 | # (application programs are unlikely to have options that match 61 | # this pattern). 62 | # 63 | # There are only two supported options: --lt-debug and 64 | # --lt-dump-script. There is, deliberately, no --lt-help. 65 | # 66 | # The first argument to this parsing function should be the 67 | # script's ../libtool value, followed by no. 68 | lt_option_debug= 69 | func_parse_lt_options () 70 | { 71 | lt_script_arg0=$0 72 | shift 73 | for lt_opt 74 | do 75 | case "$lt_opt" in 76 | --lt-debug) lt_option_debug=1 ;; 77 | --lt-dump-script) 78 | lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` 79 | test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. 80 | lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'` 81 | cat "$lt_dump_D/$lt_dump_F" 82 | exit 0 83 | ;; 84 | --lt-*) 85 | $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 86 | exit 1 87 | ;; 88 | esac 89 | done 90 | 91 | # Print the debug banner immediately: 92 | if test -n "$lt_option_debug"; then 93 | echo "unit-test-client:unit-test-client:$LINENO: libtool wrapper (GNU libtool) 2.4.6" 1>&2 94 | fi 95 | } 96 | 97 | # Used when --lt-debug. Prints its arguments to stdout 98 | # (redirection is the responsibility of the caller) 99 | func_lt_dump_args () 100 | { 101 | lt_dump_args_N=1; 102 | for lt_arg 103 | do 104 | $ECHO "unit-test-client:unit-test-client:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" 105 | lt_dump_args_N=`expr $lt_dump_args_N + 1` 106 | done 107 | } 108 | 109 | # Core function for launching the target application 110 | func_exec_program_core () 111 | { 112 | 113 | if test -n "$lt_option_debug"; then 114 | $ECHO "unit-test-client:unit-test-client:$LINENO: newargv[0]: $progdir/$program" 1>&2 115 | func_lt_dump_args ${1+"$@"} 1>&2 116 | fi 117 | exec "$progdir/$program" ${1+"$@"} 118 | 119 | $ECHO "$0: cannot exec $program $*" 1>&2 120 | exit 1 121 | } 122 | 123 | # A function to encapsulate launching the target application 124 | # Strips options in the --lt-* namespace from $@ and 125 | # launches target application with the remaining arguments. 126 | func_exec_program () 127 | { 128 | case " $* " in 129 | *\ --lt-*) 130 | for lt_wr_arg 131 | do 132 | case $lt_wr_arg in 133 | --lt-*) ;; 134 | *) set x "$@" "$lt_wr_arg"; shift;; 135 | esac 136 | shift 137 | done ;; 138 | esac 139 | func_exec_program_core ${1+"$@"} 140 | } 141 | 142 | # Parse options 143 | func_parse_lt_options "$0" ${1+"$@"} 144 | 145 | # Find the directory that this script lives in. 146 | thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` 147 | test "x$thisdir" = "x$file" && thisdir=. 148 | 149 | # Follow symbolic links until we get to the real thisdir. 150 | file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` 151 | while test -n "$file"; do 152 | destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` 153 | 154 | # If there was a directory component, then change thisdir. 155 | if test "x$destdir" != "x$file"; then 156 | case "$destdir" in 157 | [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; 158 | *) thisdir="$thisdir/$destdir" ;; 159 | esac 160 | fi 161 | 162 | file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'` 163 | file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` 164 | done 165 | 166 | # Usually 'no', except on cygwin/mingw when embedded into 167 | # the cwrapper. 168 | WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no 169 | if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then 170 | # special case for '.' 171 | if test "$thisdir" = "."; then 172 | thisdir=`pwd` 173 | fi 174 | # remove .libs from thisdir 175 | case "$thisdir" in 176 | *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;; 177 | .libs ) thisdir=. ;; 178 | esac 179 | fi 180 | 181 | # Try to get the absolute directory name. 182 | absdir=`cd "$thisdir" && pwd` 183 | test -n "$absdir" && thisdir="$absdir" 184 | 185 | program='unit-test-client' 186 | progdir="$thisdir/.libs" 187 | 188 | 189 | if test -f "$progdir/$program"; then 190 | # Add our own library path to DYLD_LIBRARY_PATH 191 | DYLD_LIBRARY_PATH="/Users/bruceboty/Data/xGuard/J介器互联/CJ公司产品/BlueJayOS/OpenSource/BaseJay/packages/libmodbus/src/.libs:$DYLD_LIBRARY_PATH" 192 | 193 | # Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH 194 | # The second colon is a workaround for a bug in BeOS R4 sed 195 | DYLD_LIBRARY_PATH=`$ECHO "$DYLD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'` 196 | 197 | export DYLD_LIBRARY_PATH 198 | 199 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then 200 | # Run the actual program with our arguments. 201 | func_exec_program ${1+"$@"} 202 | fi 203 | else 204 | # The program doesn't exist. 205 | $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 206 | $ECHO "This script is just a wrapper for $program." 1>&2 207 | $ECHO "See the libtool documentation for more information." 1>&2 208 | exit 1 209 | fi 210 | fi 211 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/unit-test-client.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/PC-Server/tests/unit-test-client.o -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/unit-test-server: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # unit-test-server - temporary wrapper script for .libs/unit-test-server 4 | # Generated by libtool (GNU libtool) 2.4.6 5 | # 6 | # The unit-test-server program cannot be directly executed until all the libtool 7 | # libraries that it depends on are installed. 8 | # 9 | # This wrapper script should never be moved out of the build directory. 10 | # If it is, it will not operate correctly. 11 | 12 | # Sed substitution that helps us do robust quoting. It backslashifies 13 | # metacharacters that are still active within double-quoted strings. 14 | sed_quote_subst='s|\([`"$\\]\)|\\\1|g' 15 | 16 | # Be Bourne compatible 17 | if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then 18 | emulate sh 19 | NULLCMD=: 20 | # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which 21 | # is contrary to our usage. Disable this feature. 22 | alias -g '${1+"$@"}'='"$@"' 23 | setopt NO_GLOB_SUBST 24 | else 25 | case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac 26 | fi 27 | BIN_SH=xpg4; export BIN_SH # for Tru64 28 | DUALCASE=1; export DUALCASE # for MKS sh 29 | 30 | # The HP-UX ksh and POSIX shell print the target directory to stdout 31 | # if CDPATH is set. 32 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 33 | 34 | relink_command="" 35 | 36 | # This environment variable determines our operation mode. 37 | if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then 38 | # install mode needs the following variables: 39 | generated_by_libtool_version='2.4.6' 40 | notinst_deplibs=' ../src/libmodbus.la' 41 | else 42 | # When we are sourced in execute mode, $file and $ECHO are already set. 43 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then 44 | file="$0" 45 | 46 | # A function that is used when there is no print builtin or printf. 47 | func_fallback_echo () 48 | { 49 | eval 'cat <<_LTECHO_EOF 50 | $1 51 | _LTECHO_EOF' 52 | } 53 | ECHO="printf %s\\n" 54 | fi 55 | 56 | # Very basic option parsing. These options are (a) specific to 57 | # the libtool wrapper, (b) are identical between the wrapper 58 | # /script/ and the wrapper /executable/ that is used only on 59 | # windows platforms, and (c) all begin with the string --lt- 60 | # (application programs are unlikely to have options that match 61 | # this pattern). 62 | # 63 | # There are only two supported options: --lt-debug and 64 | # --lt-dump-script. There is, deliberately, no --lt-help. 65 | # 66 | # The first argument to this parsing function should be the 67 | # script's ../libtool value, followed by no. 68 | lt_option_debug= 69 | func_parse_lt_options () 70 | { 71 | lt_script_arg0=$0 72 | shift 73 | for lt_opt 74 | do 75 | case "$lt_opt" in 76 | --lt-debug) lt_option_debug=1 ;; 77 | --lt-dump-script) 78 | lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` 79 | test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. 80 | lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'` 81 | cat "$lt_dump_D/$lt_dump_F" 82 | exit 0 83 | ;; 84 | --lt-*) 85 | $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 86 | exit 1 87 | ;; 88 | esac 89 | done 90 | 91 | # Print the debug banner immediately: 92 | if test -n "$lt_option_debug"; then 93 | echo "unit-test-server:unit-test-server:$LINENO: libtool wrapper (GNU libtool) 2.4.6" 1>&2 94 | fi 95 | } 96 | 97 | # Used when --lt-debug. Prints its arguments to stdout 98 | # (redirection is the responsibility of the caller) 99 | func_lt_dump_args () 100 | { 101 | lt_dump_args_N=1; 102 | for lt_arg 103 | do 104 | $ECHO "unit-test-server:unit-test-server:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" 105 | lt_dump_args_N=`expr $lt_dump_args_N + 1` 106 | done 107 | } 108 | 109 | # Core function for launching the target application 110 | func_exec_program_core () 111 | { 112 | 113 | if test -n "$lt_option_debug"; then 114 | $ECHO "unit-test-server:unit-test-server:$LINENO: newargv[0]: $progdir/$program" 1>&2 115 | func_lt_dump_args ${1+"$@"} 1>&2 116 | fi 117 | exec "$progdir/$program" ${1+"$@"} 118 | 119 | $ECHO "$0: cannot exec $program $*" 1>&2 120 | exit 1 121 | } 122 | 123 | # A function to encapsulate launching the target application 124 | # Strips options in the --lt-* namespace from $@ and 125 | # launches target application with the remaining arguments. 126 | func_exec_program () 127 | { 128 | case " $* " in 129 | *\ --lt-*) 130 | for lt_wr_arg 131 | do 132 | case $lt_wr_arg in 133 | --lt-*) ;; 134 | *) set x "$@" "$lt_wr_arg"; shift;; 135 | esac 136 | shift 137 | done ;; 138 | esac 139 | func_exec_program_core ${1+"$@"} 140 | } 141 | 142 | # Parse options 143 | func_parse_lt_options "$0" ${1+"$@"} 144 | 145 | # Find the directory that this script lives in. 146 | thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` 147 | test "x$thisdir" = "x$file" && thisdir=. 148 | 149 | # Follow symbolic links until we get to the real thisdir. 150 | file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` 151 | while test -n "$file"; do 152 | destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` 153 | 154 | # If there was a directory component, then change thisdir. 155 | if test "x$destdir" != "x$file"; then 156 | case "$destdir" in 157 | [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; 158 | *) thisdir="$thisdir/$destdir" ;; 159 | esac 160 | fi 161 | 162 | file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'` 163 | file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` 164 | done 165 | 166 | # Usually 'no', except on cygwin/mingw when embedded into 167 | # the cwrapper. 168 | WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no 169 | if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then 170 | # special case for '.' 171 | if test "$thisdir" = "."; then 172 | thisdir=`pwd` 173 | fi 174 | # remove .libs from thisdir 175 | case "$thisdir" in 176 | *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;; 177 | .libs ) thisdir=. ;; 178 | esac 179 | fi 180 | 181 | # Try to get the absolute directory name. 182 | absdir=`cd "$thisdir" && pwd` 183 | test -n "$absdir" && thisdir="$absdir" 184 | 185 | program='unit-test-server' 186 | progdir="$thisdir/.libs" 187 | 188 | 189 | if test -f "$progdir/$program"; then 190 | # Add our own library path to DYLD_LIBRARY_PATH 191 | DYLD_LIBRARY_PATH="/Users/bruceboty/Data/xGuard/J介器互联/CJ公司产品/BlueJayOS/OpenSource/BaseJay/packages/libmodbus/src/.libs:$DYLD_LIBRARY_PATH" 192 | 193 | # Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH 194 | # The second colon is a workaround for a bug in BeOS R4 sed 195 | DYLD_LIBRARY_PATH=`$ECHO "$DYLD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'` 196 | 197 | export DYLD_LIBRARY_PATH 198 | 199 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then 200 | # Run the actual program with our arguments. 201 | func_exec_program ${1+"$@"} 202 | fi 203 | else 204 | # The program doesn't exist. 205 | $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 206 | $ECHO "This script is just a wrapper for $program." 1>&2 207 | $ECHO "See the libtool documentation for more information." 1>&2 208 | exit 1 209 | fi 210 | fi 211 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/unit-test-server.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008-2014 Stéphane Raimbault 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #ifdef _WIN32 14 | # include 15 | #else 16 | # include 17 | #endif 18 | 19 | /* For MinGW */ 20 | #ifndef MSG_NOSIGNAL 21 | # define MSG_NOSIGNAL 0 22 | #endif 23 | 24 | #include "unit-test.h" 25 | 26 | enum { 27 | TCP, 28 | TCP_PI, 29 | RTU 30 | }; 31 | 32 | int main(int argc, char*argv[]) 33 | { 34 | int s = -1; 35 | modbus_t *ctx; 36 | modbus_mapping_t *mb_mapping; 37 | int rc; 38 | int i; 39 | int use_backend; 40 | uint8_t *query; 41 | int header_length; 42 | 43 | if (argc > 1) { 44 | if (strcmp(argv[1], "tcp") == 0) { 45 | use_backend = TCP; 46 | } else if (strcmp(argv[1], "tcppi") == 0) { 47 | use_backend = TCP_PI; 48 | } else if (strcmp(argv[1], "rtu") == 0) { 49 | use_backend = RTU; 50 | } else { 51 | printf("Usage:\n %s [tcp|tcppi|rtu] - Modbus server for unit testing\n\n", argv[0]); 52 | return -1; 53 | } 54 | } else { 55 | /* By default */ 56 | use_backend = TCP; 57 | } 58 | 59 | if (use_backend == TCP) { 60 | ctx = modbus_new_tcp("0.0.0.0", 502); 61 | query = malloc(MODBUS_TCP_MAX_ADU_LENGTH); 62 | } else if (use_backend == TCP_PI) { 63 | ctx = modbus_new_tcp_pi("::0", "1502"); 64 | query = malloc(MODBUS_TCP_MAX_ADU_LENGTH); 65 | } else { 66 | ctx = modbus_new_rtu("/dev/ttyUSB0", 115200, 'N', 8, 1); 67 | modbus_set_slave(ctx, SERVER_ID); 68 | query = malloc(MODBUS_RTU_MAX_ADU_LENGTH); 69 | } 70 | header_length = modbus_get_header_length(ctx); 71 | 72 | modbus_set_debug(ctx, TRUE); 73 | 74 | mb_mapping = modbus_mapping_new_start_address( 75 | UT_BITS_ADDRESS, UT_BITS_NB, 76 | UT_INPUT_BITS_ADDRESS, UT_INPUT_BITS_NB, 77 | UT_REGISTERS_ADDRESS, UT_REGISTERS_NB_MAX, 78 | UT_INPUT_REGISTERS_ADDRESS, UT_INPUT_REGISTERS_NB); 79 | if (mb_mapping == NULL) { 80 | fprintf(stderr, "Failed to allocate the mapping: %s\n", 81 | modbus_strerror(errno)); 82 | modbus_free(ctx); 83 | return -1; 84 | } 85 | 86 | /* Examples from PI_MODBUS_300.pdf. 87 | Only the read-only input values are assigned. */ 88 | 89 | /* Initialize input values that's can be only done server side. */ 90 | modbus_set_bits_from_bytes(mb_mapping->tab_input_bits, 0, UT_INPUT_BITS_NB, 91 | UT_INPUT_BITS_TAB); 92 | 93 | /* Initialize values of INPUT REGISTERS */ 94 | for (i=0; i < UT_INPUT_REGISTERS_NB; i++) { 95 | mb_mapping->tab_input_registers[i] = UT_INPUT_REGISTERS_TAB[i];; 96 | } 97 | 98 | if (use_backend == TCP) { 99 | s = modbus_tcp_listen(ctx, 1); 100 | modbus_tcp_accept(ctx, &s); 101 | } else if (use_backend == TCP_PI) { 102 | s = modbus_tcp_pi_listen(ctx, 1); 103 | modbus_tcp_pi_accept(ctx, &s); 104 | } else { 105 | rc = modbus_connect(ctx); 106 | if (rc == -1) { 107 | fprintf(stderr, "Unable to connect %s\n", modbus_strerror(errno)); 108 | modbus_free(ctx); 109 | return -1; 110 | } 111 | } 112 | 113 | for (;;) { 114 | do { 115 | rc = modbus_receive(ctx, query); 116 | /* Filtered queries return 0 */ 117 | } while (rc == 0); 118 | 119 | /* The connection is not closed on errors which require on reply such as 120 | bad CRC in RTU. */ 121 | if (rc == -1 && errno != EMBBADCRC) { 122 | /* Quit */ 123 | break; 124 | } 125 | 126 | /* Special server behavior to test client */ 127 | if (query[header_length] == 0x03) { 128 | /* Read holding registers */ 129 | 130 | if (MODBUS_GET_INT16_FROM_INT8(query, header_length + 3) 131 | == UT_REGISTERS_NB_SPECIAL) { 132 | printf("Set an incorrect number of values\n"); 133 | MODBUS_SET_INT16_TO_INT8(query, header_length + 3, 134 | UT_REGISTERS_NB_SPECIAL - 1); 135 | } else if (MODBUS_GET_INT16_FROM_INT8(query, header_length + 1) 136 | == UT_REGISTERS_ADDRESS_SPECIAL) { 137 | printf("Reply to this special register address by an exception\n"); 138 | modbus_reply_exception(ctx, query, 139 | MODBUS_EXCEPTION_SLAVE_OR_SERVER_BUSY); 140 | continue; 141 | } else if (MODBUS_GET_INT16_FROM_INT8(query, header_length + 1) 142 | == UT_REGISTERS_ADDRESS_INVALID_TID_OR_SLAVE) { 143 | const int RAW_REQ_LENGTH = 5; 144 | uint8_t raw_req[] = { 145 | (use_backend == RTU) ? INVALID_SERVER_ID : 0xFF, 146 | 0x03, 147 | 0x02, 0x00, 0x00 148 | }; 149 | 150 | printf("Reply with an invalid TID or slave\n"); 151 | modbus_send_raw_request(ctx, raw_req, RAW_REQ_LENGTH * sizeof(uint8_t)); 152 | continue; 153 | } else if (MODBUS_GET_INT16_FROM_INT8(query, header_length + 1) 154 | == UT_REGISTERS_ADDRESS_SLEEP_500_MS) { 155 | printf("Sleep 0.5 s before replying\n"); 156 | usleep(500000); 157 | } else if (MODBUS_GET_INT16_FROM_INT8(query, header_length + 1) 158 | == UT_REGISTERS_ADDRESS_BYTE_SLEEP_5_MS) { 159 | /* Test low level only available in TCP mode */ 160 | /* Catch the reply and send reply byte a byte */ 161 | uint8_t req[] = "\x00\x1C\x00\x00\x00\x05\xFF\x03\x02\x00\x00"; 162 | int req_length = 11; 163 | int w_s = modbus_get_socket(ctx); 164 | if (w_s == -1) { 165 | fprintf(stderr, "Unable to get a valid socket in special test\n"); 166 | continue; 167 | } 168 | 169 | /* Copy TID */ 170 | req[1] = query[1]; 171 | for (i=0; i < req_length; i++) { 172 | printf("(%.2X)", req[i]); 173 | usleep(5000); 174 | rc = send(w_s, (const char*)(req + i), 1, MSG_NOSIGNAL); 175 | if (rc == -1) { 176 | break; 177 | } 178 | } 179 | continue; 180 | } 181 | } 182 | 183 | rc = modbus_reply(ctx, query, rc, mb_mapping); 184 | if (rc == -1) { 185 | break; 186 | } 187 | } 188 | 189 | printf("Quit the loop: %s\n", modbus_strerror(errno)); 190 | 191 | if (use_backend == TCP) { 192 | if (s != -1) { 193 | close(s); 194 | } 195 | } 196 | modbus_mapping_free(mb_mapping); 197 | free(query); 198 | /* For RTU */ 199 | modbus_close(ctx); 200 | modbus_free(ctx); 201 | 202 | return 0; 203 | } 204 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/unit-test-server.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/PC-Server/tests/unit-test-server.o -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/unit-test.h: -------------------------------------------------------------------------------- 1 | /* tests/unit-test.h. Generated from unit-test.h.in by configure. */ 2 | /* 3 | * Copyright © 2008-2014 Stéphane Raimbault 4 | * 5 | * SPDX-License-Identifier: BSD-3-Clause 6 | */ 7 | 8 | #ifndef _UNIT_TEST_H_ 9 | #define _UNIT_TEST_H_ 10 | 11 | /* Constants defined by configure.ac */ 12 | #define HAVE_INTTYPES_H 1 13 | #define HAVE_STDINT_H 1 14 | 15 | #ifdef HAVE_INTTYPES_H 16 | #include 17 | #endif 18 | #ifdef HAVE_STDINT_H 19 | # ifndef _MSC_VER 20 | # include 21 | # else 22 | # include "stdint.h" 23 | # endif 24 | #endif 25 | 26 | #define SERVER_ID 17 27 | #define INVALID_SERVER_ID 18 28 | 29 | const uint16_t UT_BITS_ADDRESS = 0x130; 30 | const uint16_t UT_BITS_NB = 0x25; 31 | const uint8_t UT_BITS_TAB[] = { 0xCD, 0x6B, 0xB2, 0x0E, 0x1B }; 32 | 33 | const uint16_t UT_INPUT_BITS_ADDRESS = 0x1C4; 34 | const uint16_t UT_INPUT_BITS_NB = 0x16; 35 | const uint8_t UT_INPUT_BITS_TAB[] = { 0xAC, 0xDB, 0x35 }; 36 | 37 | const uint16_t UT_REGISTERS_ADDRESS = 0x160; 38 | const uint16_t UT_REGISTERS_NB = 0x3; 39 | const uint16_t UT_REGISTERS_NB_MAX = 0x20; 40 | const uint16_t UT_REGISTERS_TAB[] = { 0x022B, 0x0001, 0x0064 }; 41 | 42 | /* Raise a manual exception when this address is used for the first byte */ 43 | const uint16_t UT_REGISTERS_ADDRESS_SPECIAL = 0x170; 44 | /* The response of the server will contains an invalid TID or slave */ 45 | const uint16_t UT_REGISTERS_ADDRESS_INVALID_TID_OR_SLAVE = 0x171; 46 | /* The server will wait for 1 second before replying to test timeout */ 47 | const uint16_t UT_REGISTERS_ADDRESS_SLEEP_500_MS = 0x172; 48 | /* The server will wait for 5 ms before sending each byte */ 49 | const uint16_t UT_REGISTERS_ADDRESS_BYTE_SLEEP_5_MS = 0x173; 50 | 51 | /* If the following value is used, a bad response is sent. 52 | It's better to test with a lower value than 53 | UT_REGISTERS_NB_POINTS to try to raise a segfault. */ 54 | const uint16_t UT_REGISTERS_NB_SPECIAL = 0x2; 55 | 56 | const uint16_t UT_INPUT_REGISTERS_ADDRESS = 0x108; 57 | const uint16_t UT_INPUT_REGISTERS_NB = 0x1; 58 | const uint16_t UT_INPUT_REGISTERS_TAB[] = { 0x000A }; 59 | 60 | const float UT_REAL = 123456.00; 61 | 62 | const uint32_t UT_IREAL_ABCD = 0x0020F147; 63 | const uint32_t UT_IREAL_DCBA = 0x47F12000; 64 | const uint32_t UT_IREAL_BADC = 0x200047F1; 65 | const uint32_t UT_IREAL_CDAB = 0xF1470020; 66 | 67 | /* const uint32_t UT_IREAL_ABCD = 0x47F12000); 68 | const uint32_t UT_IREAL_DCBA = 0x0020F147; 69 | const uint32_t UT_IREAL_BADC = 0xF1470020; 70 | const uint32_t UT_IREAL_CDAB = 0x200047F1;*/ 71 | 72 | #endif /* _UNIT_TEST_H_ */ 73 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/unit-test.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008-2014 Stéphane Raimbault 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | 7 | #ifndef _UNIT_TEST_H_ 8 | #define _UNIT_TEST_H_ 9 | 10 | /* Constants defined by configure.ac */ 11 | #define HAVE_INTTYPES_H @HAVE_INTTYPES_H@ 12 | #define HAVE_STDINT_H @HAVE_STDINT_H@ 13 | 14 | #ifdef HAVE_INTTYPES_H 15 | #include 16 | #endif 17 | #ifdef HAVE_STDINT_H 18 | # ifndef _MSC_VER 19 | # include 20 | # else 21 | # include "stdint.h" 22 | # endif 23 | #endif 24 | 25 | #define SERVER_ID 17 26 | #define INVALID_SERVER_ID 18 27 | 28 | const uint16_t UT_BITS_ADDRESS = 0x130; 29 | const uint16_t UT_BITS_NB = 0x25; 30 | const uint8_t UT_BITS_TAB[] = { 0xCD, 0x6B, 0xB2, 0x0E, 0x1B }; 31 | 32 | const uint16_t UT_INPUT_BITS_ADDRESS = 0x1C4; 33 | const uint16_t UT_INPUT_BITS_NB = 0x16; 34 | const uint8_t UT_INPUT_BITS_TAB[] = { 0xAC, 0xDB, 0x35 }; 35 | 36 | const uint16_t UT_REGISTERS_ADDRESS = 0x160; 37 | const uint16_t UT_REGISTERS_NB = 0x3; 38 | const uint16_t UT_REGISTERS_NB_MAX = 0x20; 39 | const uint16_t UT_REGISTERS_TAB[] = { 0x022B, 0x0001, 0x0064 }; 40 | 41 | /* Raise a manual exception when this address is used for the first byte */ 42 | const uint16_t UT_REGISTERS_ADDRESS_SPECIAL = 0x170; 43 | /* The response of the server will contains an invalid TID or slave */ 44 | const uint16_t UT_REGISTERS_ADDRESS_INVALID_TID_OR_SLAVE = 0x171; 45 | /* The server will wait for 1 second before replying to test timeout */ 46 | const uint16_t UT_REGISTERS_ADDRESS_SLEEP_500_MS = 0x172; 47 | /* The server will wait for 5 ms before sending each byte */ 48 | const uint16_t UT_REGISTERS_ADDRESS_BYTE_SLEEP_5_MS = 0x173; 49 | 50 | /* If the following value is used, a bad response is sent. 51 | It's better to test with a lower value than 52 | UT_REGISTERS_NB_POINTS to try to raise a segfault. */ 53 | const uint16_t UT_REGISTERS_NB_SPECIAL = 0x2; 54 | 55 | const uint16_t UT_INPUT_REGISTERS_ADDRESS = 0x108; 56 | const uint16_t UT_INPUT_REGISTERS_NB = 0x1; 57 | const uint16_t UT_INPUT_REGISTERS_TAB[] = { 0x000A }; 58 | 59 | const float UT_REAL = 123456.00; 60 | 61 | const uint32_t UT_IREAL_ABCD = 0x0020F147; 62 | const uint32_t UT_IREAL_DCBA = 0x47F12000; 63 | const uint32_t UT_IREAL_BADC = 0x200047F1; 64 | const uint32_t UT_IREAL_CDAB = 0xF1470020; 65 | 66 | /* const uint32_t UT_IREAL_ABCD = 0x47F12000); 67 | const uint32_t UT_IREAL_DCBA = 0x0020F147; 68 | const uint32_t UT_IREAL_BADC = 0xF1470020; 69 | const uint32_t UT_IREAL_CDAB = 0x200047F1;*/ 70 | 71 | #endif /* _UNIT_TEST_H_ */ 72 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/unit-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | client_log=unit-test-client.log 4 | server_log=unit-test-server.log 5 | 6 | rm -f $client_log $server_log 7 | 8 | echo "Starting server" 9 | ./unit-test-server > $server_log 2>&1 & 10 | 11 | sleep 1 12 | 13 | echo "Starting client" 14 | ./unit-test-client > $client_log 2>&1 15 | rc=$? 16 | 17 | killall unit-test-server 18 | exit $rc 19 | 20 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/version: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # version - temporary wrapper script for .libs/version 4 | # Generated by libtool (GNU libtool) 2.4.6 5 | # 6 | # The version program cannot be directly executed until all the libtool 7 | # libraries that it depends on are installed. 8 | # 9 | # This wrapper script should never be moved out of the build directory. 10 | # If it is, it will not operate correctly. 11 | 12 | # Sed substitution that helps us do robust quoting. It backslashifies 13 | # metacharacters that are still active within double-quoted strings. 14 | sed_quote_subst='s|\([`"$\\]\)|\\\1|g' 15 | 16 | # Be Bourne compatible 17 | if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then 18 | emulate sh 19 | NULLCMD=: 20 | # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which 21 | # is contrary to our usage. Disable this feature. 22 | alias -g '${1+"$@"}'='"$@"' 23 | setopt NO_GLOB_SUBST 24 | else 25 | case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac 26 | fi 27 | BIN_SH=xpg4; export BIN_SH # for Tru64 28 | DUALCASE=1; export DUALCASE # for MKS sh 29 | 30 | # The HP-UX ksh and POSIX shell print the target directory to stdout 31 | # if CDPATH is set. 32 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 33 | 34 | relink_command="" 35 | 36 | # This environment variable determines our operation mode. 37 | if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then 38 | # install mode needs the following variables: 39 | generated_by_libtool_version='2.4.6' 40 | notinst_deplibs=' ../src/libmodbus.la' 41 | else 42 | # When we are sourced in execute mode, $file and $ECHO are already set. 43 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then 44 | file="$0" 45 | 46 | # A function that is used when there is no print builtin or printf. 47 | func_fallback_echo () 48 | { 49 | eval 'cat <<_LTECHO_EOF 50 | $1 51 | _LTECHO_EOF' 52 | } 53 | ECHO="printf %s\\n" 54 | fi 55 | 56 | # Very basic option parsing. These options are (a) specific to 57 | # the libtool wrapper, (b) are identical between the wrapper 58 | # /script/ and the wrapper /executable/ that is used only on 59 | # windows platforms, and (c) all begin with the string --lt- 60 | # (application programs are unlikely to have options that match 61 | # this pattern). 62 | # 63 | # There are only two supported options: --lt-debug and 64 | # --lt-dump-script. There is, deliberately, no --lt-help. 65 | # 66 | # The first argument to this parsing function should be the 67 | # script's ../libtool value, followed by no. 68 | lt_option_debug= 69 | func_parse_lt_options () 70 | { 71 | lt_script_arg0=$0 72 | shift 73 | for lt_opt 74 | do 75 | case "$lt_opt" in 76 | --lt-debug) lt_option_debug=1 ;; 77 | --lt-dump-script) 78 | lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` 79 | test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. 80 | lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'` 81 | cat "$lt_dump_D/$lt_dump_F" 82 | exit 0 83 | ;; 84 | --lt-*) 85 | $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 86 | exit 1 87 | ;; 88 | esac 89 | done 90 | 91 | # Print the debug banner immediately: 92 | if test -n "$lt_option_debug"; then 93 | echo "version:version:$LINENO: libtool wrapper (GNU libtool) 2.4.6" 1>&2 94 | fi 95 | } 96 | 97 | # Used when --lt-debug. Prints its arguments to stdout 98 | # (redirection is the responsibility of the caller) 99 | func_lt_dump_args () 100 | { 101 | lt_dump_args_N=1; 102 | for lt_arg 103 | do 104 | $ECHO "version:version:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" 105 | lt_dump_args_N=`expr $lt_dump_args_N + 1` 106 | done 107 | } 108 | 109 | # Core function for launching the target application 110 | func_exec_program_core () 111 | { 112 | 113 | if test -n "$lt_option_debug"; then 114 | $ECHO "version:version:$LINENO: newargv[0]: $progdir/$program" 1>&2 115 | func_lt_dump_args ${1+"$@"} 1>&2 116 | fi 117 | exec "$progdir/$program" ${1+"$@"} 118 | 119 | $ECHO "$0: cannot exec $program $*" 1>&2 120 | exit 1 121 | } 122 | 123 | # A function to encapsulate launching the target application 124 | # Strips options in the --lt-* namespace from $@ and 125 | # launches target application with the remaining arguments. 126 | func_exec_program () 127 | { 128 | case " $* " in 129 | *\ --lt-*) 130 | for lt_wr_arg 131 | do 132 | case $lt_wr_arg in 133 | --lt-*) ;; 134 | *) set x "$@" "$lt_wr_arg"; shift;; 135 | esac 136 | shift 137 | done ;; 138 | esac 139 | func_exec_program_core ${1+"$@"} 140 | } 141 | 142 | # Parse options 143 | func_parse_lt_options "$0" ${1+"$@"} 144 | 145 | # Find the directory that this script lives in. 146 | thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` 147 | test "x$thisdir" = "x$file" && thisdir=. 148 | 149 | # Follow symbolic links until we get to the real thisdir. 150 | file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` 151 | while test -n "$file"; do 152 | destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` 153 | 154 | # If there was a directory component, then change thisdir. 155 | if test "x$destdir" != "x$file"; then 156 | case "$destdir" in 157 | [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; 158 | *) thisdir="$thisdir/$destdir" ;; 159 | esac 160 | fi 161 | 162 | file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'` 163 | file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` 164 | done 165 | 166 | # Usually 'no', except on cygwin/mingw when embedded into 167 | # the cwrapper. 168 | WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no 169 | if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then 170 | # special case for '.' 171 | if test "$thisdir" = "."; then 172 | thisdir=`pwd` 173 | fi 174 | # remove .libs from thisdir 175 | case "$thisdir" in 176 | *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;; 177 | .libs ) thisdir=. ;; 178 | esac 179 | fi 180 | 181 | # Try to get the absolute directory name. 182 | absdir=`cd "$thisdir" && pwd` 183 | test -n "$absdir" && thisdir="$absdir" 184 | 185 | program='version' 186 | progdir="$thisdir/.libs" 187 | 188 | 189 | if test -f "$progdir/$program"; then 190 | # Add our own library path to DYLD_LIBRARY_PATH 191 | DYLD_LIBRARY_PATH="/Users/bruceboty/Data/xGuard/J介器互联/CJ公司产品/BlueJayOS/OpenSource/BaseJay/packages/libmodbus/src/.libs:$DYLD_LIBRARY_PATH" 192 | 193 | # Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH 194 | # The second colon is a workaround for a bug in BeOS R4 sed 195 | DYLD_LIBRARY_PATH=`$ECHO "$DYLD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'` 196 | 197 | export DYLD_LIBRARY_PATH 198 | 199 | if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then 200 | # Run the actual program with our arguments. 201 | func_exec_program ${1+"$@"} 202 | fi 203 | else 204 | # The program doesn't exist. 205 | $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 206 | $ECHO "This script is just a wrapper for $program." 1>&2 207 | $ECHO "See the libtool documentation for more information." 1>&2 208 | exit 1 209 | fi 210 | fi 211 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/version.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008-2014 Stéphane Raimbault 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | int main(void) 11 | { 12 | printf("Compiled with libmodbus version %s (%06X)\n", LIBMODBUS_VERSION_STRING, LIBMODBUS_VERSION_HEX); 13 | printf("Linked with libmodbus version %d.%d.%d\n", 14 | libmodbus_version_major, libmodbus_version_minor, libmodbus_version_micro); 15 | 16 | if (LIBMODBUS_VERSION_CHECK(2, 1, 0)) { 17 | printf("The functions to read/write float values are available (2.1.0).\n"); 18 | } 19 | 20 | if (LIBMODBUS_VERSION_CHECK(2, 1, 1)) { 21 | printf("Oh gosh, brand new API (2.1.1)!\n"); 22 | } 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/PC-Server/tests/version.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/PC-Server/tests/version.o -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/bandwidth-client: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/client-box/bandwidth-client -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/random-test-client: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/client-box/random-test-client -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/.deps/random-test-server.Po: -------------------------------------------------------------------------------- 1 | random-test-server.o: random-test-server.c \ 2 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/stdc-predef.h \ 3 | ../config.h \ 4 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/stdio.h \ 5 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/features.h \ 6 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/cdefs.h \ 7 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/wordsize.h \ 8 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/gnu/stubs.h \ 9 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/gnu/stubs-soft.h \ 10 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include/stddef.h \ 11 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/types.h \ 12 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/typesizes.h \ 13 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/libio.h \ 14 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/_G_config.h \ 15 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/wchar.h \ 16 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include/stdarg.h \ 17 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/stdio_lim.h \ 18 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sys_errlist.h \ 19 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/stdio.h \ 20 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/unistd.h \ 21 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/posix_opt.h \ 22 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/environments.h \ 23 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/confname.h \ 24 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/getopt.h \ 25 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/stdlib.h \ 26 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/waitflags.h \ 27 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/waitstatus.h \ 28 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/endian.h \ 29 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/endian.h \ 30 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/byteswap.h \ 31 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/byteswap-16.h \ 32 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/xlocale.h \ 33 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/types.h \ 34 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/time.h \ 35 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/select.h \ 36 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/select.h \ 37 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigset.h \ 38 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/time.h \ 39 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/sysmacros.h \ 40 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/pthreadtypes.h \ 41 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/alloca.h \ 42 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/stdlib-bsearch.h \ 43 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/stdlib-float.h \ 44 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/errno.h \ 45 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/errno.h \ 46 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/linux/errno.h \ 47 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm/errno.h \ 48 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm-generic/errno.h \ 49 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm-generic/errno-base.h \ 50 | ../src/modbus.h \ 51 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/param.h \ 52 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include-fixed/limits.h \ 53 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include-fixed/syslimits.h \ 54 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/limits.h \ 55 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/posix1_lim.h \ 56 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/local_lim.h \ 57 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/linux/limits.h \ 58 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/posix2_lim.h \ 59 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/xopen_lim.h \ 60 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/signal.h \ 61 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/signum.h \ 62 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/siginfo.h \ 63 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigaction.h \ 64 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigcontext.h \ 65 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm/sigcontext.h \ 66 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigstack.h \ 67 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/ucontext.h \ 68 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigthread.h \ 69 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/param.h \ 70 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/linux/param.h \ 71 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm/param.h \ 72 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm-generic/param.h \ 73 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include/stdint.h \ 74 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/stdint.h \ 75 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/wchar.h \ 76 | ../src/modbus-version.h ../src/modbus-tcp.h ../src/modbus.h \ 77 | ../src/modbus-rtu.h 78 | 79 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/stdc-predef.h: 80 | 81 | ../config.h: 82 | 83 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/stdio.h: 84 | 85 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/features.h: 86 | 87 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/cdefs.h: 88 | 89 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/wordsize.h: 90 | 91 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/gnu/stubs.h: 92 | 93 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/gnu/stubs-soft.h: 94 | 95 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include/stddef.h: 96 | 97 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/types.h: 98 | 99 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/typesizes.h: 100 | 101 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/libio.h: 102 | 103 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/_G_config.h: 104 | 105 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/wchar.h: 106 | 107 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include/stdarg.h: 108 | 109 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/stdio_lim.h: 110 | 111 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sys_errlist.h: 112 | 113 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/stdio.h: 114 | 115 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/unistd.h: 116 | 117 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/posix_opt.h: 118 | 119 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/environments.h: 120 | 121 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/confname.h: 122 | 123 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/getopt.h: 124 | 125 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/stdlib.h: 126 | 127 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/waitflags.h: 128 | 129 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/waitstatus.h: 130 | 131 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/endian.h: 132 | 133 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/endian.h: 134 | 135 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/byteswap.h: 136 | 137 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/byteswap-16.h: 138 | 139 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/xlocale.h: 140 | 141 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/types.h: 142 | 143 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/time.h: 144 | 145 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/select.h: 146 | 147 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/select.h: 148 | 149 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigset.h: 150 | 151 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/time.h: 152 | 153 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/sysmacros.h: 154 | 155 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/pthreadtypes.h: 156 | 157 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/alloca.h: 158 | 159 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/stdlib-bsearch.h: 160 | 161 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/stdlib-float.h: 162 | 163 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/errno.h: 164 | 165 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/errno.h: 166 | 167 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/linux/errno.h: 168 | 169 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm/errno.h: 170 | 171 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm-generic/errno.h: 172 | 173 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm-generic/errno-base.h: 174 | 175 | ../src/modbus.h: 176 | 177 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/param.h: 178 | 179 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include-fixed/limits.h: 180 | 181 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include-fixed/syslimits.h: 182 | 183 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/limits.h: 184 | 185 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/posix1_lim.h: 186 | 187 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/local_lim.h: 188 | 189 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/linux/limits.h: 190 | 191 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/posix2_lim.h: 192 | 193 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/xopen_lim.h: 194 | 195 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/signal.h: 196 | 197 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/signum.h: 198 | 199 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/siginfo.h: 200 | 201 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigaction.h: 202 | 203 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigcontext.h: 204 | 205 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm/sigcontext.h: 206 | 207 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigstack.h: 208 | 209 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/ucontext.h: 210 | 211 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigthread.h: 212 | 213 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/param.h: 214 | 215 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/linux/param.h: 216 | 217 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm/param.h: 218 | 219 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm-generic/param.h: 220 | 221 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include/stdint.h: 222 | 223 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/stdint.h: 224 | 225 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/wchar.h: 226 | 227 | ../src/modbus-version.h: 228 | 229 | ../src/modbus-tcp.h: 230 | 231 | ../src/modbus.h: 232 | 233 | ../src/modbus-rtu.h: 234 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/.deps/version.Po: -------------------------------------------------------------------------------- 1 | version.o: version.c \ 2 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/stdc-predef.h \ 3 | ../config.h \ 4 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/stdio.h \ 5 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/features.h \ 6 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/cdefs.h \ 7 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/wordsize.h \ 8 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/gnu/stubs.h \ 9 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/gnu/stubs-soft.h \ 10 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include/stddef.h \ 11 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/types.h \ 12 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/typesizes.h \ 13 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/libio.h \ 14 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/_G_config.h \ 15 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/wchar.h \ 16 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include/stdarg.h \ 17 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/stdio_lim.h \ 18 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sys_errlist.h \ 19 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/stdio.h \ 20 | ../src/modbus.h \ 21 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/param.h \ 22 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/types.h \ 23 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/time.h \ 24 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/endian.h \ 25 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/endian.h \ 26 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/byteswap.h \ 27 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/byteswap-16.h \ 28 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/select.h \ 29 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/select.h \ 30 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigset.h \ 31 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/time.h \ 32 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/sysmacros.h \ 33 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/pthreadtypes.h \ 34 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include-fixed/limits.h \ 35 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include-fixed/syslimits.h \ 36 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/limits.h \ 37 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/posix1_lim.h \ 38 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/local_lim.h \ 39 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/linux/limits.h \ 40 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/posix2_lim.h \ 41 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/xopen_lim.h \ 42 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/signal.h \ 43 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/signum.h \ 44 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/siginfo.h \ 45 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigaction.h \ 46 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigcontext.h \ 47 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm/sigcontext.h \ 48 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigstack.h \ 49 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/ucontext.h \ 50 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigthread.h \ 51 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/param.h \ 52 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/linux/param.h \ 53 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm/param.h \ 54 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm-generic/param.h \ 55 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include/stdint.h \ 56 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/stdint.h \ 57 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/wchar.h \ 58 | ../src/modbus-version.h ../src/modbus-tcp.h ../src/modbus.h \ 59 | ../src/modbus-rtu.h 60 | 61 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/stdc-predef.h: 62 | 63 | ../config.h: 64 | 65 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/stdio.h: 66 | 67 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/features.h: 68 | 69 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/cdefs.h: 70 | 71 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/wordsize.h: 72 | 73 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/gnu/stubs.h: 74 | 75 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/gnu/stubs-soft.h: 76 | 77 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include/stddef.h: 78 | 79 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/types.h: 80 | 81 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/typesizes.h: 82 | 83 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/libio.h: 84 | 85 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/_G_config.h: 86 | 87 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/wchar.h: 88 | 89 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include/stdarg.h: 90 | 91 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/stdio_lim.h: 92 | 93 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sys_errlist.h: 94 | 95 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/stdio.h: 96 | 97 | ../src/modbus.h: 98 | 99 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/param.h: 100 | 101 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/types.h: 102 | 103 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/time.h: 104 | 105 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/endian.h: 106 | 107 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/endian.h: 108 | 109 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/byteswap.h: 110 | 111 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/byteswap-16.h: 112 | 113 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/select.h: 114 | 115 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/select.h: 116 | 117 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigset.h: 118 | 119 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/time.h: 120 | 121 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/sysmacros.h: 122 | 123 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/pthreadtypes.h: 124 | 125 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include-fixed/limits.h: 126 | 127 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include-fixed/syslimits.h: 128 | 129 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/limits.h: 130 | 131 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/posix1_lim.h: 132 | 133 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/local_lim.h: 134 | 135 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/linux/limits.h: 136 | 137 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/posix2_lim.h: 138 | 139 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/xopen_lim.h: 140 | 141 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/signal.h: 142 | 143 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/signum.h: 144 | 145 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/siginfo.h: 146 | 147 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigaction.h: 148 | 149 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigcontext.h: 150 | 151 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm/sigcontext.h: 152 | 153 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigstack.h: 154 | 155 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/sys/ucontext.h: 156 | 157 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/sigthread.h: 158 | 159 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/param.h: 160 | 161 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/linux/param.h: 162 | 163 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm/param.h: 164 | 165 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/asm-generic/param.h: 166 | 167 | /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/lib/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/include/stdint.h: 168 | 169 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/stdint.h: 170 | 171 | /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/bits/wchar.h: 172 | 173 | ../src/modbus-version.h: 174 | 175 | ../src/modbus-tcp.h: 176 | 177 | ../src/modbus.h: 178 | 179 | ../src/modbus-rtu.h: 180 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2014 by Stéphane Raimbault 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above 12 | copyright notice, this list of conditions and the following 13 | disclaimer in the documentation and/or other materials provided 14 | with the distribution. 15 | 16 | * The names of the contributors may not be used to endorse or 17 | promote products derived from this software without specific 18 | prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = README.md unit-tests.sh 2 | 3 | noinst_PROGRAMS = \ 4 | bandwidth-server-one \ 5 | bandwidth-server-many-up \ 6 | bandwidth-client \ 7 | random-test-server \ 8 | random-test-client \ 9 | unit-test-server \ 10 | unit-test-client \ 11 | version 12 | 13 | common_ldflags = \ 14 | $(top_builddir)/src/libmodbus.la 15 | 16 | bandwidth_server_one_SOURCES = bandwidth-server-one.c 17 | bandwidth_server_one_LDADD = $(common_ldflags) 18 | 19 | bandwidth_server_many_up_SOURCES = bandwidth-server-many-up.c 20 | bandwidth_server_many_up_LDADD = $(common_ldflags) 21 | 22 | bandwidth_client_SOURCES = bandwidth-client.c 23 | bandwidth_client_LDADD = $(common_ldflags) 24 | 25 | random_test_server_SOURCES = random-test-server.c 26 | random_test_server_LDADD = $(common_ldflags) 27 | 28 | random_test_client_SOURCES = random-test-client.c 29 | random_test_client_LDADD = $(common_ldflags) 30 | 31 | unit_test_server_SOURCES = unit-test-server.c unit-test.h 32 | unit_test_server_LDADD = $(common_ldflags) 33 | 34 | unit_test_client_SOURCES = unit-test-client.c unit-test.h 35 | unit_test_client_LDADD = $(common_ldflags) 36 | 37 | version_SOURCES = version.c 38 | version_LDADD = $(common_ldflags) 39 | 40 | AM_CPPFLAGS = \ 41 | -include $(top_builddir)/config.h \ 42 | -DSYSCONFDIR=\""$(sysconfdir)"\" \ 43 | -DLIBEXECDIR=\""$(libexecdir)"\" \ 44 | -I${top_srcdir}/src \ 45 | -I${top_builddir}/src 46 | 47 | AM_CFLAGS = ${my_CFLAGS} 48 | 49 | CLEANFILES = *~ *.log 50 | 51 | noinst_SCRIPTS=unit-tests.sh 52 | TESTS=./unit-tests.sh 53 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/README.md: -------------------------------------------------------------------------------- 1 | # License 2 | Test programs of this directory are provided under BSD license (see associated 3 | LICENSE file). 4 | 5 | # Compilation 6 | After installation, you can use pkg-config to compile these tests. 7 | For example, to compile random-test-server run: 8 | 9 | gcc random-test-server.c -o random-test-server `pkg-config --libs --cflags libmodbus` 10 | 11 | - `random-test-server` is necessary to launch a server before running 12 | random-test-client. By default, it receives and replies to Modbus query on the 13 | localhost and port 1502. 14 | 15 | - `random-test-client` sends many different queries to a large range of 16 | addresses and values to test the communication between the client and the 17 | server. 18 | 19 | - `unit-test-server` and `unit-test-client` run a full unit test suite. These 20 | programs are essential to test the Modbus protocol implementation and libmodbus 21 | behavior. 22 | 23 | - `bandwidth-server-one`, `bandwidth-server-many-up` and `bandwidth-client` 24 | return very useful information about the performance of transfert rate between 25 | the server and the client. `bandwidth-server-one` can only handles one 26 | connection at once with a client whereas `bandwidth-server-many-up` opens a 27 | connection for each new clients (with a limit). 28 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/bandwidth-client: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/client-box/tests/bandwidth-client -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/bandwidth-client.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008-2014 Stéphane Raimbault 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | 7 | #include 8 | #ifndef _MSC_VER 9 | #include 10 | #include 11 | #endif 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | 19 | #define G_MSEC_PER_SEC 1000 20 | 21 | static uint32_t gettime_ms(void) 22 | { 23 | struct timeval tv; 24 | #if !defined(_MSC_VER) 25 | gettimeofday(&tv, NULL); 26 | return (uint32_t) tv.tv_sec * 1000 + tv.tv_usec / 1000; 27 | #else 28 | return GetTickCount(); 29 | #endif 30 | } 31 | 32 | enum { 33 | TCP, 34 | RTU 35 | }; 36 | 37 | /* Tests based on PI-MBUS-300 documentation */ 38 | int main(int argc, char *argv[]) 39 | { 40 | uint8_t *tab_bit; 41 | uint16_t *tab_reg; 42 | modbus_t *ctx; 43 | int i; 44 | int nb_points; 45 | double elapsed; 46 | uint32_t start; 47 | uint32_t end; 48 | uint32_t bytes; 49 | uint32_t rate; 50 | int rc; 51 | int n_loop; 52 | int use_backend; 53 | 54 | if (argc > 1) { 55 | if (strcmp(argv[1], "tcp") == 0) { 56 | use_backend = TCP; 57 | n_loop = 100000; 58 | } else if (strcmp(argv[1], "rtu") == 0) { 59 | use_backend = RTU; 60 | n_loop = 100; 61 | } else { 62 | printf("Usage:\n %s [tcp|rtu] - Modbus client to measure data bandwith\n\n", argv[0]); 63 | exit(1); 64 | } 65 | } else { 66 | /* By default */ 67 | use_backend = TCP; 68 | n_loop = 100000; 69 | } 70 | 71 | if (use_backend == TCP) { 72 | ctx = modbus_new_tcp("192.168.2.46", 502); 73 | } else { 74 | ctx = modbus_new_rtu("/dev/ttyUSB1", 115200, 'N', 8, 1); 75 | modbus_set_slave(ctx, 1); 76 | } 77 | if (modbus_connect(ctx) == -1) { 78 | fprintf(stderr, "Connection failed: %s\n", 79 | modbus_strerror(errno)); 80 | modbus_free(ctx); 81 | return -1; 82 | } 83 | 84 | /* Allocate and initialize the memory to store the status */ 85 | tab_bit = (uint8_t *) malloc(MODBUS_MAX_READ_BITS * sizeof(uint8_t)); 86 | memset(tab_bit, 0, MODBUS_MAX_READ_BITS * sizeof(uint8_t)); 87 | 88 | /* Allocate and initialize the memory to store the registers */ 89 | tab_reg = (uint16_t *) malloc(MODBUS_MAX_READ_REGISTERS * sizeof(uint16_t)); 90 | memset(tab_reg, 0, MODBUS_MAX_READ_REGISTERS * sizeof(uint16_t)); 91 | 92 | printf("READ BITS\n\n"); 93 | 94 | nb_points = MODBUS_MAX_READ_BITS; 95 | start = gettime_ms(); 96 | for (i=0; i 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | #if defined(_WIN32) 17 | #include 18 | #else 19 | #include 20 | #include 21 | #include 22 | #include 23 | #endif 24 | 25 | #define NB_CONNECTION 5 26 | 27 | static modbus_t *ctx = NULL; 28 | static modbus_mapping_t *mb_mapping; 29 | 30 | static int server_socket = -1; 31 | 32 | static void close_sigint(int dummy) 33 | { 34 | if (server_socket != -1) { 35 | close(server_socket); 36 | } 37 | modbus_free(ctx); 38 | modbus_mapping_free(mb_mapping); 39 | 40 | exit(dummy); 41 | } 42 | 43 | int main(void) 44 | { 45 | uint8_t query[MODBUS_TCP_MAX_ADU_LENGTH]; 46 | int master_socket; 47 | int rc; 48 | fd_set refset; 49 | fd_set rdset; 50 | /* Maximum file descriptor number */ 51 | int fdmax; 52 | 53 | ctx = modbus_new_tcp("0.0.0.0", 502); 54 | 55 | mb_mapping = modbus_mapping_new(MODBUS_MAX_READ_BITS, 0, 56 | MODBUS_MAX_READ_REGISTERS, 0); 57 | if (mb_mapping == NULL) { 58 | fprintf(stderr, "Failed to allocate the mapping: %s\n", 59 | modbus_strerror(errno)); 60 | modbus_free(ctx); 61 | return -1; 62 | } 63 | 64 | server_socket = modbus_tcp_listen(ctx, NB_CONNECTION); 65 | if (server_socket == -1) { 66 | fprintf(stderr, "Unable to listen TCP connection\n"); 67 | modbus_free(ctx); 68 | return -1; 69 | } 70 | 71 | signal(SIGINT, close_sigint); 72 | 73 | /* Clear the reference set of socket */ 74 | FD_ZERO(&refset); 75 | /* Add the server socket */ 76 | FD_SET(server_socket, &refset); 77 | 78 | /* Keep track of the max file descriptor */ 79 | fdmax = server_socket; 80 | 81 | for (;;) { 82 | rdset = refset; 83 | if (select(fdmax+1, &rdset, NULL, NULL, NULL) == -1) { 84 | perror("Server select() failure."); 85 | close_sigint(1); 86 | } 87 | 88 | /* Run through the existing connections looking for data to be 89 | * read */ 90 | for (master_socket = 0; master_socket <= fdmax; master_socket++) { 91 | 92 | if (!FD_ISSET(master_socket, &rdset)) { 93 | continue; 94 | } 95 | 96 | if (master_socket == server_socket) { 97 | /* A client is asking a new connection */ 98 | socklen_t addrlen; 99 | struct sockaddr_in clientaddr; 100 | int newfd; 101 | 102 | /* Handle new connections */ 103 | addrlen = sizeof(clientaddr); 104 | memset(&clientaddr, 0, sizeof(clientaddr)); 105 | newfd = accept(server_socket, (struct sockaddr *)&clientaddr, &addrlen); 106 | if (newfd == -1) { 107 | perror("Server accept() error"); 108 | } else { 109 | FD_SET(newfd, &refset); 110 | 111 | if (newfd > fdmax) { 112 | /* Keep track of the maximum */ 113 | fdmax = newfd; 114 | } 115 | printf("New connection from %s:%d on socket %d\n", 116 | inet_ntoa(clientaddr.sin_addr), clientaddr.sin_port, newfd); 117 | } 118 | } else { 119 | modbus_set_socket(ctx, master_socket); 120 | rc = modbus_receive(ctx, query); 121 | if (rc > 0) { 122 | modbus_reply(ctx, query, rc, mb_mapping); 123 | } else if (rc == -1) { 124 | /* This example server in ended on connection closing or 125 | * any errors. */ 126 | printf("Connection closed on socket %d\n", master_socket); 127 | close(master_socket); 128 | 129 | /* Remove from reference set */ 130 | FD_CLR(master_socket, &refset); 131 | 132 | if (master_socket == fdmax) { 133 | fdmax--; 134 | } 135 | } 136 | } 137 | } 138 | } 139 | 140 | return 0; 141 | } 142 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/bandwidth-server-many-up.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/client-box/tests/bandwidth-server-many-up.o -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/bandwidth-server-one: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/client-box/tests/bandwidth-server-one -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/bandwidth-server-one.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008-2014 Stéphane Raimbault 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | 7 | #include 8 | #ifndef _MSC_VER 9 | #include 10 | #endif 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | #if defined(_WIN32) 18 | #define close closesocket 19 | #endif 20 | 21 | enum { 22 | TCP, 23 | RTU 24 | }; 25 | 26 | int main(int argc, char *argv[]) 27 | { 28 | int s = -1; 29 | modbus_t *ctx = NULL; 30 | modbus_mapping_t *mb_mapping = NULL; 31 | int rc; 32 | int use_backend; 33 | 34 | /* TCP */ 35 | if (argc > 1) { 36 | if (strcmp(argv[1], "tcp") == 0) { 37 | use_backend = TCP; 38 | } else if (strcmp(argv[1], "rtu") == 0) { 39 | use_backend = RTU; 40 | } else { 41 | printf("Usage:\n %s [tcp|rtu] - Modbus client to measure data bandwith\n\n", argv[0]); 42 | exit(1); 43 | } 44 | } else { 45 | /* By default */ 46 | use_backend = TCP; 47 | } 48 | 49 | if (use_backend == TCP) { 50 | ctx = modbus_new_tcp("0.0.0.0", 502); 51 | s = modbus_tcp_listen(ctx, 1); 52 | modbus_tcp_accept(ctx, &s); 53 | 54 | } else { 55 | ctx = modbus_new_rtu("/dev/ttyUSB0", 115200, 'N', 8, 1); 56 | modbus_set_slave(ctx, 1); 57 | modbus_connect(ctx); 58 | } 59 | 60 | mb_mapping = modbus_mapping_new(MODBUS_MAX_READ_BITS, 0, 61 | MODBUS_MAX_READ_REGISTERS, 0); 62 | if (mb_mapping == NULL) { 63 | fprintf(stderr, "Failed to allocate the mapping: %s\n", 64 | modbus_strerror(errno)); 65 | modbus_free(ctx); 66 | return -1; 67 | } 68 | 69 | for(;;) { 70 | uint8_t query[MODBUS_TCP_MAX_ADU_LENGTH]; 71 | 72 | rc = modbus_receive(ctx, query); 73 | if (rc > 0) { 74 | modbus_reply(ctx, query, rc, mb_mapping); 75 | } else if (rc == -1) { 76 | /* Connection closed by the client or error */ 77 | break; 78 | } 79 | } 80 | 81 | printf("Quit the loop: %s\n", modbus_strerror(errno)); 82 | 83 | modbus_mapping_free(mb_mapping); 84 | if (s != -1) { 85 | close(s); 86 | } 87 | /* For RTU, skipped by TCP (no TCP connect) */ 88 | modbus_close(ctx); 89 | modbus_free(ctx); 90 | 91 | return 0; 92 | } 93 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/bandwidth-server-one.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/client-box/tests/bandwidth-server-one.o -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/random-test-client: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/client-box/tests/random-test-client -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/random-test-client.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008-2014 Stéphane Raimbault 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | 7 | #include 8 | #ifndef _MSC_VER 9 | #include 10 | #endif 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | /* The goal of this program is to check all major functions of 18 | libmodbus: 19 | - write_coil 20 | - read_bits 21 | - write_coils 22 | - write_register 23 | - read_registers 24 | - write_registers 25 | - read_registers 26 | 27 | All these functions are called with random values on a address 28 | range defined by the following defines. 29 | */ 30 | #define LOOP 1 31 | #define SERVER_ID 17 32 | #define ADDRESS_START 0 33 | #define ADDRESS_END 99 34 | 35 | /* At each loop, the program works in the range ADDRESS_START to 36 | * ADDRESS_END then ADDRESS_START + 1 to ADDRESS_END and so on. 37 | */ 38 | int main(void) 39 | { 40 | modbus_t *ctx; 41 | int rc; 42 | int nb_fail; 43 | int nb_loop; 44 | int addr; 45 | int nb; 46 | uint8_t *tab_rq_bits; 47 | uint8_t *tab_rp_bits; 48 | uint16_t *tab_rq_registers; 49 | uint16_t *tab_rw_rq_registers; 50 | uint16_t *tab_rp_registers; 51 | 52 | /* RTU */ 53 | /* 54 | ctx = modbus_new_rtu("/dev/ttyUSB0", 19200, 'N', 8, 1); 55 | modbus_set_slave(ctx, SERVER_ID); 56 | */ 57 | 58 | /* TCP */ 59 | ctx = modbus_new_tcp("192.168.2.46", 502); 60 | modbus_set_debug(ctx, TRUE); 61 | 62 | if (modbus_connect(ctx) == -1) { 63 | fprintf(stderr, "Connection failed: %s\n", 64 | modbus_strerror(errno)); 65 | modbus_free(ctx); 66 | return -1; 67 | } 68 | 69 | /* Allocate and initialize the different memory spaces */ 70 | nb = ADDRESS_END - ADDRESS_START; 71 | 72 | tab_rq_bits = (uint8_t *) malloc(nb * sizeof(uint8_t)); 73 | memset(tab_rq_bits, 0, nb * sizeof(uint8_t)); 74 | 75 | tab_rp_bits = (uint8_t *) malloc(nb * sizeof(uint8_t)); 76 | memset(tab_rp_bits, 0, nb * sizeof(uint8_t)); 77 | 78 | tab_rq_registers = (uint16_t *) malloc(nb * sizeof(uint16_t)); 79 | memset(tab_rq_registers, 0, nb * sizeof(uint16_t)); 80 | 81 | tab_rp_registers = (uint16_t *) malloc(nb * sizeof(uint16_t)); 82 | memset(tab_rp_registers, 0, nb * sizeof(uint16_t)); 83 | 84 | tab_rw_rq_registers = (uint16_t *) malloc(nb * sizeof(uint16_t)); 85 | memset(tab_rw_rq_registers, 0, nb * sizeof(uint16_t)); 86 | 87 | nb_loop = nb_fail = 0; 88 | while (nb_loop++ < LOOP) { 89 | for (addr = ADDRESS_START; addr < ADDRESS_END; addr++) { 90 | int i; 91 | 92 | /* Random numbers (short) */ 93 | for (i=0; i 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | 7 | #include 8 | #ifndef _MSC_VER 9 | #include 10 | #endif 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | int main(void) 17 | { 18 | int s = -1; 19 | modbus_t *ctx; 20 | modbus_mapping_t *mb_mapping; 21 | 22 | ctx = modbus_new_tcp("0.0.0.0", 502); 23 | /* modbus_set_debug(ctx, TRUE); */ 24 | 25 | mb_mapping = modbus_mapping_new(500, 500, 500, 500); 26 | if (mb_mapping == NULL) { 27 | fprintf(stderr, "Failed to allocate the mapping: %s\n", 28 | modbus_strerror(errno)); 29 | modbus_free(ctx); 30 | return -1; 31 | } 32 | 33 | s = modbus_tcp_listen(ctx, 1); 34 | modbus_tcp_accept(ctx, &s); 35 | 36 | for (;;) { 37 | uint8_t query[MODBUS_TCP_MAX_ADU_LENGTH]; 38 | int rc; 39 | 40 | rc = modbus_receive(ctx, query); 41 | if (rc > 0) { 42 | /* rc is the query size */ 43 | modbus_reply(ctx, query, rc, mb_mapping); 44 | } else if (rc == -1) { 45 | /* Connection closed by the client or error */ 46 | break; 47 | } 48 | } 49 | 50 | printf("Quit the loop: %s\n", modbus_strerror(errno)); 51 | 52 | if (s != -1) { 53 | close(s); 54 | } 55 | modbus_mapping_free(mb_mapping); 56 | modbus_close(ctx); 57 | modbus_free(ctx); 58 | 59 | return 0; 60 | } 61 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/random-test-server.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/client-box/tests/random-test-server.o -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/stamp-h2: -------------------------------------------------------------------------------- 1 | timestamp for tests/unit-test.h 2 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/unit-test-client: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/client-box/tests/unit-test-client -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/unit-test-client.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/client-box/tests/unit-test-client.o -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/unit-test-server: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/client-box/tests/unit-test-server -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/unit-test-server.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008-2014 Stéphane Raimbault 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #ifdef _WIN32 14 | # include 15 | #else 16 | # include 17 | #endif 18 | 19 | /* For MinGW */ 20 | #ifndef MSG_NOSIGNAL 21 | # define MSG_NOSIGNAL 0 22 | #endif 23 | 24 | #include "unit-test.h" 25 | 26 | enum { 27 | TCP, 28 | TCP_PI, 29 | RTU 30 | }; 31 | 32 | int main(int argc, char*argv[]) 33 | { 34 | int s = -1; 35 | modbus_t *ctx; 36 | modbus_mapping_t *mb_mapping; 37 | int rc; 38 | int i; 39 | int use_backend; 40 | uint8_t *query; 41 | int header_length; 42 | 43 | if (argc > 1) { 44 | if (strcmp(argv[1], "tcp") == 0) { 45 | use_backend = TCP; 46 | } else if (strcmp(argv[1], "tcppi") == 0) { 47 | use_backend = TCP_PI; 48 | } else if (strcmp(argv[1], "rtu") == 0) { 49 | use_backend = RTU; 50 | } else { 51 | printf("Usage:\n %s [tcp|tcppi|rtu] - Modbus server for unit testing\n\n", argv[0]); 52 | return -1; 53 | } 54 | } else { 55 | /* By default */ 56 | use_backend = TCP; 57 | } 58 | 59 | if (use_backend == TCP) { 60 | ctx = modbus_new_tcp("0.0.0.0", 502); 61 | query = malloc(MODBUS_TCP_MAX_ADU_LENGTH); 62 | } else if (use_backend == TCP_PI) { 63 | ctx = modbus_new_tcp_pi("::0", "1502"); 64 | query = malloc(MODBUS_TCP_MAX_ADU_LENGTH); 65 | } else { 66 | ctx = modbus_new_rtu("/dev/ttyUSB0", 115200, 'N', 8, 1); 67 | modbus_set_slave(ctx, SERVER_ID); 68 | query = malloc(MODBUS_RTU_MAX_ADU_LENGTH); 69 | } 70 | header_length = modbus_get_header_length(ctx); 71 | 72 | modbus_set_debug(ctx, TRUE); 73 | 74 | mb_mapping = modbus_mapping_new_start_address( 75 | UT_BITS_ADDRESS, UT_BITS_NB, 76 | UT_INPUT_BITS_ADDRESS, UT_INPUT_BITS_NB, 77 | UT_REGISTERS_ADDRESS, UT_REGISTERS_NB_MAX, 78 | UT_INPUT_REGISTERS_ADDRESS, UT_INPUT_REGISTERS_NB); 79 | if (mb_mapping == NULL) { 80 | fprintf(stderr, "Failed to allocate the mapping: %s\n", 81 | modbus_strerror(errno)); 82 | modbus_free(ctx); 83 | return -1; 84 | } 85 | 86 | /* Examples from PI_MODBUS_300.pdf. 87 | Only the read-only input values are assigned. */ 88 | 89 | /* Initialize input values that's can be only done server side. */ 90 | modbus_set_bits_from_bytes(mb_mapping->tab_input_bits, 0, UT_INPUT_BITS_NB, 91 | UT_INPUT_BITS_TAB); 92 | 93 | /* Initialize values of INPUT REGISTERS */ 94 | for (i=0; i < UT_INPUT_REGISTERS_NB; i++) { 95 | mb_mapping->tab_input_registers[i] = UT_INPUT_REGISTERS_TAB[i];; 96 | } 97 | 98 | if (use_backend == TCP) { 99 | s = modbus_tcp_listen(ctx, 1); 100 | modbus_tcp_accept(ctx, &s); 101 | } else if (use_backend == TCP_PI) { 102 | s = modbus_tcp_pi_listen(ctx, 1); 103 | modbus_tcp_pi_accept(ctx, &s); 104 | } else { 105 | rc = modbus_connect(ctx); 106 | if (rc == -1) { 107 | fprintf(stderr, "Unable to connect %s\n", modbus_strerror(errno)); 108 | modbus_free(ctx); 109 | return -1; 110 | } 111 | } 112 | 113 | for (;;) { 114 | do { 115 | rc = modbus_receive(ctx, query); 116 | /* Filtered queries return 0 */ 117 | } while (rc == 0); 118 | 119 | /* The connection is not closed on errors which require on reply such as 120 | bad CRC in RTU. */ 121 | if (rc == -1 && errno != EMBBADCRC) { 122 | /* Quit */ 123 | break; 124 | } 125 | 126 | /* Special server behavior to test client */ 127 | if (query[header_length] == 0x03) { 128 | /* Read holding registers */ 129 | 130 | if (MODBUS_GET_INT16_FROM_INT8(query, header_length + 3) 131 | == UT_REGISTERS_NB_SPECIAL) { 132 | printf("Set an incorrect number of values\n"); 133 | MODBUS_SET_INT16_TO_INT8(query, header_length + 3, 134 | UT_REGISTERS_NB_SPECIAL - 1); 135 | } else if (MODBUS_GET_INT16_FROM_INT8(query, header_length + 1) 136 | == UT_REGISTERS_ADDRESS_SPECIAL) { 137 | printf("Reply to this special register address by an exception\n"); 138 | modbus_reply_exception(ctx, query, 139 | MODBUS_EXCEPTION_SLAVE_OR_SERVER_BUSY); 140 | continue; 141 | } else if (MODBUS_GET_INT16_FROM_INT8(query, header_length + 1) 142 | == UT_REGISTERS_ADDRESS_INVALID_TID_OR_SLAVE) { 143 | const int RAW_REQ_LENGTH = 5; 144 | uint8_t raw_req[] = { 145 | (use_backend == RTU) ? INVALID_SERVER_ID : 0xFF, 146 | 0x03, 147 | 0x02, 0x00, 0x00 148 | }; 149 | 150 | printf("Reply with an invalid TID or slave\n"); 151 | modbus_send_raw_request(ctx, raw_req, RAW_REQ_LENGTH * sizeof(uint8_t)); 152 | continue; 153 | } else if (MODBUS_GET_INT16_FROM_INT8(query, header_length + 1) 154 | == UT_REGISTERS_ADDRESS_SLEEP_500_MS) { 155 | printf("Sleep 0.5 s before replying\n"); 156 | usleep(500000); 157 | } else if (MODBUS_GET_INT16_FROM_INT8(query, header_length + 1) 158 | == UT_REGISTERS_ADDRESS_BYTE_SLEEP_5_MS) { 159 | /* Test low level only available in TCP mode */ 160 | /* Catch the reply and send reply byte a byte */ 161 | uint8_t req[] = "\x00\x1C\x00\x00\x00\x05\xFF\x03\x02\x00\x00"; 162 | int req_length = 11; 163 | int w_s = modbus_get_socket(ctx); 164 | if (w_s == -1) { 165 | fprintf(stderr, "Unable to get a valid socket in special test\n"); 166 | continue; 167 | } 168 | 169 | /* Copy TID */ 170 | req[1] = query[1]; 171 | for (i=0; i < req_length; i++) { 172 | printf("(%.2X)", req[i]); 173 | usleep(5000); 174 | rc = send(w_s, (const char*)(req + i), 1, MSG_NOSIGNAL); 175 | if (rc == -1) { 176 | break; 177 | } 178 | } 179 | continue; 180 | } 181 | } 182 | 183 | rc = modbus_reply(ctx, query, rc, mb_mapping); 184 | if (rc == -1) { 185 | break; 186 | } 187 | } 188 | 189 | printf("Quit the loop: %s\n", modbus_strerror(errno)); 190 | 191 | if (use_backend == TCP) { 192 | if (s != -1) { 193 | close(s); 194 | } 195 | } 196 | modbus_mapping_free(mb_mapping); 197 | free(query); 198 | /* For RTU */ 199 | modbus_close(ctx); 200 | modbus_free(ctx); 201 | 202 | return 0; 203 | } 204 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/unit-test-server.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/client-box/tests/unit-test-server.o -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/unit-test.h: -------------------------------------------------------------------------------- 1 | /* tests/unit-test.h. Generated from unit-test.h.in by configure. */ 2 | /* 3 | * Copyright © 2008-2014 Stéphane Raimbault 4 | * 5 | * SPDX-License-Identifier: BSD-3-Clause 6 | */ 7 | 8 | #ifndef _UNIT_TEST_H_ 9 | #define _UNIT_TEST_H_ 10 | 11 | /* Constants defined by configure.ac */ 12 | #define HAVE_INTTYPES_H 1 13 | #define HAVE_STDINT_H 1 14 | 15 | #ifdef HAVE_INTTYPES_H 16 | #include 17 | #endif 18 | #ifdef HAVE_STDINT_H 19 | # ifndef _MSC_VER 20 | # include 21 | # else 22 | # include "stdint.h" 23 | # endif 24 | #endif 25 | 26 | #define SERVER_ID 17 27 | #define INVALID_SERVER_ID 18 28 | 29 | const uint16_t UT_BITS_ADDRESS = 0x130; 30 | const uint16_t UT_BITS_NB = 0x25; 31 | const uint8_t UT_BITS_TAB[] = { 0xCD, 0x6B, 0xB2, 0x0E, 0x1B }; 32 | 33 | const uint16_t UT_INPUT_BITS_ADDRESS = 0x1C4; 34 | const uint16_t UT_INPUT_BITS_NB = 0x16; 35 | const uint8_t UT_INPUT_BITS_TAB[] = { 0xAC, 0xDB, 0x35 }; 36 | 37 | const uint16_t UT_REGISTERS_ADDRESS = 0x160; 38 | const uint16_t UT_REGISTERS_NB = 0x3; 39 | const uint16_t UT_REGISTERS_NB_MAX = 0x20; 40 | const uint16_t UT_REGISTERS_TAB[] = { 0x022B, 0x0001, 0x0064 }; 41 | 42 | /* Raise a manual exception when this address is used for the first byte */ 43 | const uint16_t UT_REGISTERS_ADDRESS_SPECIAL = 0x170; 44 | /* The response of the server will contains an invalid TID or slave */ 45 | const uint16_t UT_REGISTERS_ADDRESS_INVALID_TID_OR_SLAVE = 0x171; 46 | /* The server will wait for 1 second before replying to test timeout */ 47 | const uint16_t UT_REGISTERS_ADDRESS_SLEEP_500_MS = 0x172; 48 | /* The server will wait for 5 ms before sending each byte */ 49 | const uint16_t UT_REGISTERS_ADDRESS_BYTE_SLEEP_5_MS = 0x173; 50 | 51 | /* If the following value is used, a bad response is sent. 52 | It's better to test with a lower value than 53 | UT_REGISTERS_NB_POINTS to try to raise a segfault. */ 54 | const uint16_t UT_REGISTERS_NB_SPECIAL = 0x2; 55 | 56 | const uint16_t UT_INPUT_REGISTERS_ADDRESS = 0x108; 57 | const uint16_t UT_INPUT_REGISTERS_NB = 0x1; 58 | const uint16_t UT_INPUT_REGISTERS_TAB[] = { 0x000A }; 59 | 60 | const float UT_REAL = 123456.00; 61 | 62 | const uint32_t UT_IREAL_ABCD = 0x0020F147; 63 | const uint32_t UT_IREAL_DCBA = 0x47F12000; 64 | const uint32_t UT_IREAL_BADC = 0x200047F1; 65 | const uint32_t UT_IREAL_CDAB = 0xF1470020; 66 | 67 | /* const uint32_t UT_IREAL_ABCD = 0x47F12000); 68 | const uint32_t UT_IREAL_DCBA = 0x0020F147; 69 | const uint32_t UT_IREAL_BADC = 0xF1470020; 70 | const uint32_t UT_IREAL_CDAB = 0x200047F1;*/ 71 | 72 | #endif /* _UNIT_TEST_H_ */ 73 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/unit-test.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008-2014 Stéphane Raimbault 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | 7 | #ifndef _UNIT_TEST_H_ 8 | #define _UNIT_TEST_H_ 9 | 10 | /* Constants defined by configure.ac */ 11 | #define HAVE_INTTYPES_H @HAVE_INTTYPES_H@ 12 | #define HAVE_STDINT_H @HAVE_STDINT_H@ 13 | 14 | #ifdef HAVE_INTTYPES_H 15 | #include 16 | #endif 17 | #ifdef HAVE_STDINT_H 18 | # ifndef _MSC_VER 19 | # include 20 | # else 21 | # include "stdint.h" 22 | # endif 23 | #endif 24 | 25 | #define SERVER_ID 17 26 | #define INVALID_SERVER_ID 18 27 | 28 | const uint16_t UT_BITS_ADDRESS = 0x130; 29 | const uint16_t UT_BITS_NB = 0x25; 30 | const uint8_t UT_BITS_TAB[] = { 0xCD, 0x6B, 0xB2, 0x0E, 0x1B }; 31 | 32 | const uint16_t UT_INPUT_BITS_ADDRESS = 0x1C4; 33 | const uint16_t UT_INPUT_BITS_NB = 0x16; 34 | const uint8_t UT_INPUT_BITS_TAB[] = { 0xAC, 0xDB, 0x35 }; 35 | 36 | const uint16_t UT_REGISTERS_ADDRESS = 0x160; 37 | const uint16_t UT_REGISTERS_NB = 0x3; 38 | const uint16_t UT_REGISTERS_NB_MAX = 0x20; 39 | const uint16_t UT_REGISTERS_TAB[] = { 0x022B, 0x0001, 0x0064 }; 40 | 41 | /* Raise a manual exception when this address is used for the first byte */ 42 | const uint16_t UT_REGISTERS_ADDRESS_SPECIAL = 0x170; 43 | /* The response of the server will contains an invalid TID or slave */ 44 | const uint16_t UT_REGISTERS_ADDRESS_INVALID_TID_OR_SLAVE = 0x171; 45 | /* The server will wait for 1 second before replying to test timeout */ 46 | const uint16_t UT_REGISTERS_ADDRESS_SLEEP_500_MS = 0x172; 47 | /* The server will wait for 5 ms before sending each byte */ 48 | const uint16_t UT_REGISTERS_ADDRESS_BYTE_SLEEP_5_MS = 0x173; 49 | 50 | /* If the following value is used, a bad response is sent. 51 | It's better to test with a lower value than 52 | UT_REGISTERS_NB_POINTS to try to raise a segfault. */ 53 | const uint16_t UT_REGISTERS_NB_SPECIAL = 0x2; 54 | 55 | const uint16_t UT_INPUT_REGISTERS_ADDRESS = 0x108; 56 | const uint16_t UT_INPUT_REGISTERS_NB = 0x1; 57 | const uint16_t UT_INPUT_REGISTERS_TAB[] = { 0x000A }; 58 | 59 | const float UT_REAL = 123456.00; 60 | 61 | const uint32_t UT_IREAL_ABCD = 0x0020F147; 62 | const uint32_t UT_IREAL_DCBA = 0x47F12000; 63 | const uint32_t UT_IREAL_BADC = 0x200047F1; 64 | const uint32_t UT_IREAL_CDAB = 0xF1470020; 65 | 66 | /* const uint32_t UT_IREAL_ABCD = 0x47F12000); 67 | const uint32_t UT_IREAL_DCBA = 0x0020F147; 68 | const uint32_t UT_IREAL_BADC = 0xF1470020; 69 | const uint32_t UT_IREAL_CDAB = 0x200047F1;*/ 70 | 71 | #endif /* _UNIT_TEST_H_ */ 72 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/unit-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | client_log=unit-test-client.log 4 | server_log=unit-test-server.log 5 | 6 | rm -f $client_log $server_log 7 | 8 | echo "Starting server" 9 | ./unit-test-server > $server_log 2>&1 & 10 | 11 | sleep 1 12 | 13 | echo "Starting client" 14 | ./unit-test-client > $client_log 2>&1 15 | rc=$? 16 | 17 | killall unit-test-server 18 | exit $rc 19 | 20 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/version: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/client-box/tests/version -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/version.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008-2014 Stéphane Raimbault 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | int main(void) 11 | { 12 | printf("Compiled with libmodbus version %s (%06X)\n", LIBMODBUS_VERSION_STRING, LIBMODBUS_VERSION_HEX); 13 | printf("Linked with libmodbus version %d.%d.%d\n", 14 | libmodbus_version_major, libmodbus_version_minor, libmodbus_version_micro); 15 | 16 | if (LIBMODBUS_VERSION_CHECK(2, 1, 0)) { 17 | printf("The functions to read/write float values are available (2.1.0).\n"); 18 | } 19 | 20 | if (LIBMODBUS_VERSION_CHECK(2, 1, 1)) { 21 | printf("Oh gosh, brand new API (2.1.1)!\n"); 22 | } 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/tests/version.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/client-box/tests/version.o -------------------------------------------------------------------------------- /build/modbus-test-with-PC-Box/client-box/unit-test-client: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/modbus-test-with-PC-Box/client-box/unit-test-client -------------------------------------------------------------------------------- /build/zstd/zstd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/build/zstd/zstd -------------------------------------------------------------------------------- /docker_scripts/build-fanuc.sh: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2020-08-07 Yong the first version 7 | 8 | #!/bin/bash 9 | cd /fanuc-control \ 10 | && source /environment-setup-armv7a-vfp-neon-oe-linux-gnueabi \ 11 | && make clean && make 12 | -------------------------------------------------------------------------------- /docker_scripts/build-helloworld.sh: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2019-07-31 tr.yang the first version 7 | 8 | #!/bin/bash 9 | cd /helloworld && source /environment-setup-armv7a-vfp-neon-oe-linux-gnueabi && make clean && make -------------------------------------------------------------------------------- /docker_scripts/build-iperf.sh: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2020-08-07 Yong the first version 7 | 8 | #!/bin/bash 9 | cd /iperf \ 10 | && sh bootstrap.sh \ 11 | && source /environment-setup-armv7a-vfp-neon-oe-linux-gnueabi \ 12 | && autoreconf -i \ 13 | && ./configure --host=arm \ 14 | && make clean && make 15 | -------------------------------------------------------------------------------- /docker_scripts/build-libmodbus.sh: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2020-08-07 Yong the first version 7 | 8 | #!/bin/bash 9 | cd /libmodbus \ 10 | && sh autogen.sh \ 11 | && source /environment-setup-armv7a-vfp-neon-oe-linux-gnueabi \ 12 | && autoreconf -i \ 13 | && ./configure --host=arm \ 14 | && make clean && make 15 | -------------------------------------------------------------------------------- /docker_scripts/build-mqtt.sh: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2020-08-07 Yong the first version 7 | 8 | #!/bin/bash 9 | cd MQTT-C \ 10 | && rm -rf build && mkdir build \ 11 | && cd build \ 12 | && source /environment-setup-armv7a-vfp-neon-oe-linux-gnueabi \ 13 | && cmake .. \ 14 | && make 15 | -------------------------------------------------------------------------------- /docker_scripts/build-pnet.sh: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2020-08-07 Yong the first version 7 | 8 | #!/bin/bash 9 | cd /p-net \ 10 | && rm -rf build && mkdir build \ 11 | && cd build \ 12 | && source /environment-setup-armv7a-vfp-neon-oe-linux-gnueabi \ 13 | && cmake .. \ 14 | && make all 15 | -------------------------------------------------------------------------------- /docker_scripts/build-soem.sh: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2020-08-07 Yong the first version 7 | 8 | #!/bin/bash 9 | cd /soem \ 10 | && rm -rf build && mkdir build \ 11 | && cd build \ 12 | && source /environment-setup-armv7a-vfp-neon-oe-linux-gnueabi \ 13 | && cmake .. \ 14 | && make 15 | -------------------------------------------------------------------------------- /docker_scripts/build-zstd.sh: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2020-08-07 Yong the first version 7 | 8 | #!/bin/bash 9 | cd /zstd \ 10 | && source /environment-setup-armv7a-vfp-neon-oe-linux-gnueabi \ 11 | && make 12 | -------------------------------------------------------------------------------- /dockerfile: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2019-07-31 tr.yang the first version 7 | # 2020-08-09 Yong the second version 8 | 9 | 10 | FROM ubuntu:18.04 11 | RUN apt-get update 12 | # RUN apt-get install apt-transport-https ca-certificates gnupg software-properties-common wget -y 13 | # RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null 14 | # RUN apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' 15 | RUN apt-get update 16 | RUN apt-get install -y gcc git make screen vim nmap python perl cpio automake libtool pkg-config liblzo2-2 cmake clang-tools doxygen graphviz wget libboost-all-dev libxml2-dev 17 | 18 | COPY external/sdk /sdk 19 | COPY external/sdk/environment-setup-armv7a-vfp-neon-oe-linux-gnueabi / 20 | RUN export PERL_MM_USE_DEFAULT=1 && cpan -i FindBin 21 | RUN echo "escape \`\`" > /root/.screenrc 22 | RUN echo "defshell -bash" >> /root/.screenrc 23 | RUN cd /sdk && ./oecore-x86_64-armv7a-vfp-neon-toolchain-nodistro.0.sh -y 24 | 25 | ## fix the arm-oe-linux-gnueabi-g++ -- broken issue when compile p-net 26 | RUN mv /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib/libstdc++.so /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib/libstdc++.so.old 27 | RUN ln -s /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib/libstdc++.so.6 /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib/libstdc++.so 28 | RUN apt-get install libc6-armhf-cross -y 29 | # /lib/ld-linux.so.3: No such file or directory 30 | RUN ln -s /usr/arm-linux-gnueabihf/lib/ld-linux.so.3 /lib/ld-linux.so.3 31 | RUN cp /usr/arm-linux-gnueabihf/lib/* /usr/lib/ 32 | 33 | # COPY YOUR OWN CODE INTO THE DOCKER 34 | COPY packages/* / 35 | COPY docker_scripts/* / 36 | 37 | WORKDIR / 38 | CMD ["bash"] 39 | -------------------------------------------------------------------------------- /external/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/external/.DS_Store -------------------------------------------------------------------------------- /external/sdk/environment-setup-armv7a-vfp-neon-oe-linux-gnueabi: -------------------------------------------------------------------------------- 1 | export SDKTARGETSYSROOT=/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi 2 | export PATH=$PATH:/usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin:/usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi 3 | export CCACHE_PATH=$sdkpathnative$bindir:$sdkpathnative$bindir/arm-oe-linux-gnueabi:$CCACHE_PATH 4 | # export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT 5 | # export PKG_CONFIG_PATH=$SDKTARGETSYSROOT/usr/lib/pkgconfig 6 | export CONFIG_SITE=/usr/local/oecore-x86_64/site-config-armv7a-vfp-neon-oe-linux-gnueabi 7 | export OECORE_NATIVE_SYSROOT="/usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux" 8 | export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT" 9 | export OECORE_ACLOCAL_OPTS="-I /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/share/aclocal" 10 | export PYTHONHOME=/usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr 11 | export CC="arm-oe-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=$SDKTARGETSYSROOT" 12 | export CXX="arm-oe-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=$SDKTARGETSYSROOT" 13 | export CPP="arm-oe-linux-gnueabi-gcc -E -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=$SDKTARGETSYSROOT" 14 | export AS="arm-oe-linux-gnueabi-as " 15 | export LD="arm-oe-linux-gnueabi-ld --sysroot=$SDKTARGETSYSROOT" 16 | export GDB=arm-oe-linux-gnueabi-gdb 17 | export STRIP=arm-oe-linux-gnueabi-strip 18 | export RANLIB=arm-oe-linux-gnueabi-ranlib 19 | export OBJCOPY=arm-oe-linux-gnueabi-objcopy 20 | export OBJDUMP=arm-oe-linux-gnueabi-objdump 21 | export AR=arm-oe-linux-gnueabi-ar 22 | export NM=arm-oe-linux-gnueabi-nm 23 | export M4=m4 24 | export TARGET_PREFIX=arm-oe-linux-gnueabi- 25 | export CONFIGURE_FLAGS="--target=arm-oe-linux-gnueabi --host=arm-oe-linux-gnueabi --build=x86_64-linux --with-libtool-sysroot=$SDKTARGETSYSROOT" 26 | export CFLAGS=" -O2 -fexpensive-optimizations -frename-registers -fomit-frame-pointer" 27 | export CXXFLAGS=" -O2 -fexpensive-optimizations -frename-registers -fomit-frame-pointer" 28 | export LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed" 29 | export CPPFLAGS="" 30 | export KCFLAGS="--sysroot=$SDKTARGETSYSROOT" 31 | export OECORE_DISTRO_VERSION="201708081026" 32 | export OECORE_SDK_VERSION="nodistro.0" 33 | export ARCH=arm 34 | # export CROSS_COMPILE=arm-oe-linux-gnueabi- 35 | 36 | # Append environment subscripts 37 | if [ -d "$OECORE_TARGET_SYSROOT/environment-setup.d" ]; then 38 | for envfile in $OECORE_TARGET_SYSROOT/environment-setup.d/*.sh; do 39 | source $envfile 40 | done 41 | fi 42 | if [ -d "$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then 43 | for envfile in $OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do 44 | source $envfile 45 | done 46 | fi 47 | -------------------------------------------------------------------------------- /external/sdk/oecore-x86_64-armv7a-vfp-neon-toolchain-nodistro.0.manifest: -------------------------------------------------------------------------------- 1 | packagegroup-core-standalone-sdk-target-dbg all 1.0-r8 2 | glibc-localedata-i18n armv7a-vfp-neon 2.21-r0 3 | libc6-utils armv7a-vfp-neon 2.21-r0 4 | libc6 armv7a-vfp-neon 2.21-r0 5 | qemuwrapper-cross-dev armv7a-vfp-neon 1.0-r0 6 | glibc-localedata-translit-neutral armv7a-vfp-neon 2.21-r0 7 | libc6-extra-nss armv7a-vfp-neon 2.21-r0 8 | packagegroup-core-standalone-sdk-target-dev all 1.0-r8 9 | libstdc++-dev armv7a-vfp-neon 4.9.2-r0 10 | gcc-runtime-dbg armv7a-vfp-neon 4.9.2-r0 11 | glibc-localedata-iso14651-t1-common armv7a-vfp-neon 2.21-r0 12 | libstdc++6 armv7a-vfp-neon 4.9.2-r0 13 | glibc-localedata-translit-compat armv7a-vfp-neon 2.21-r0 14 | glibc-locale-dbg armv7a-vfp-neon 2.21-r0 15 | glibc-localedata-translit-narrow armv7a-vfp-neon 2.21-r0 16 | glibc-localedata-translit-small armv7a-vfp-neon 2.21-r0 17 | glibc-gconv armv7a-vfp-neon 2.21-r0 18 | linux-libc-headers-dev armv7a-vfp-neon 3.19-r0 19 | qemuwrapper-cross armv7a-vfp-neon 1.0-r0 20 | glibc-localedata-translit-circle armv7a-vfp-neon 2.21-r0 21 | glibc-localedata-translit-fraction armv7a-vfp-neon 2.21-r0 22 | glibc-localedata-iso14651-t1 armv7a-vfp-neon 2.21-r0 23 | packagegroup-core-standalone-sdk-target all 1.0-r8 24 | libc6-thread-db armv7a-vfp-neon 2.21-r0 25 | libc6-dbg armv7a-vfp-neon 2.21-r0 26 | libsegfault armv7a-vfp-neon 2.21-r0 27 | libgcc-s-dbg armv7a-vfp-neon 4.9.2-r0 28 | libgcov-dev armv7a-vfp-neon 4.9.2-r0 29 | glibc-gconv-cp1252 armv7a-vfp-neon 2.21-r0 30 | libc6-dev armv7a-vfp-neon 2.21-r0 31 | glibc-gconv-iso8859-1 armv7a-vfp-neon 2.21-r0 32 | libgcc-s-dev armv7a-vfp-neon 4.9.2-r0 33 | libcidn1 armv7a-vfp-neon 2.21-r0 34 | glibc-localedata-translit-cjk-compat armv7a-vfp-neon 2.21-r0 35 | glibc-localedata-translit-wide armv7a-vfp-neon 2.21-r0 36 | glibc-gconv-iso8859-15 armv7a-vfp-neon 2.21-r0 37 | libgcc1 armv7a-vfp-neon 4.9.2-r0 38 | glibc-gconv-ibm850 armv7a-vfp-neon 2.21-r0 39 | glibc-localedata-translit-font armv7a-vfp-neon 2.21-r0 40 | qemuwrapper-cross-dbg armv7a-vfp-neon 1.0-r0 -------------------------------------------------------------------------------- /external/sdk/oecore-x86_64-armv7a-vfp-neon-toolchain-nodistro.0.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieqiio/BaseJay/8a6ddea2c02929101cec2f1ecd7b2d25ed09d727/external/sdk/oecore-x86_64-armv7a-vfp-neon-toolchain-nodistro.0.sh -------------------------------------------------------------------------------- /packages/helloworld/helloworld.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() { 3 | printf("Bring the machine to the future!"); 4 | return 0; 5 | } -------------------------------------------------------------------------------- /packages/helloworld/makefile: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS=-I. 3 | RM = rm -rf 4 | OBJ = helloworld.o 5 | APP = helloworld 6 | %.o: %.c) 7 | $(CC) -c -o $@ $< $(CFLAGS) 8 | helloworld: $(OBJ) 9 | $(CC) -o $@ $^ $(CFLAGS) 10 | clean: 11 | $(RM) $(OBJ) $(APP) 12 | -------------------------------------------------------------------------------- /scripts/buildall.sh: -------------------------------------------------------------------------------- 1 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 2 | # SPDX-License-Identifier: GPL 3.0 3 | # Change Logs: 4 | # Date Author Notes 5 | # 2019-07-31 tr.yang the first version 6 | 7 | #!/bin/bash 8 | mkdir -p build 9 | ./scripts/deploy-*.sh $1 10 | -------------------------------------------------------------------------------- /scripts/deploy-fanuc.sh: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2020-08-07 Yong the first version 7 | 8 | 9 | #!/bin/sh 10 | docker cp packages/fanuc-control $1:/ \ 11 | && docker cp ./docker_scripts/build-fanuc.sh $1:/ \ 12 | && docker exec $1 bash -c "/build-fanuc.sh" \ 13 | && rm -rf build/fanuc \ 14 | && docker cp $1:/fanuc-control/bin build/fanuc 15 | -------------------------------------------------------------------------------- /scripts/deploy-helloworld.sh: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2019-07-31 tr.yang the first version 7 | 8 | #!/bin/sh 9 | docker cp packages/helloworld $1:/ \ 10 | && docker exec $1 bash -c "/build-helloworld.sh" \ 11 | && rm -rf build/helloworld && mkdir build/hellworld \ 12 | && docker cp $1:/helloworld/helloworld build/hellworld/ 13 | -------------------------------------------------------------------------------- /scripts/deploy-iperf.sh: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2020-08-07 Yong the first version 7 | 8 | 9 | #!/bin/sh 10 | docker cp packages/iperf $1:/ \ 11 | && docker cp ./docker_scripts/build-iperf.sh $1:/ \ 12 | && docker exec $1 bash -c "/build-iperf.sh" \ 13 | && rm -rf build/iperf && mkdir build/iperf \ 14 | && docker cp $1:/iperf/src/iperf3 build/iperf/ 15 | -------------------------------------------------------------------------------- /scripts/deploy-libmodbus.sh: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2020-08-07 Yong the first version 7 | 8 | 9 | #!/bin/sh 10 | docker cp packages/libmodbus $1:/libmodbus \ 11 | && docker cp ./docker_scripts/build-libmodbus.sh $1:/ \ 12 | && docker exec $1 bash -c "/build-libmodbus.sh" \ 13 | && rm -rf build/libmodbus && mkdir build/libmodbus \ 14 | && docker cp $1:/libmodbus/tests build/libmodbus/ 15 | -------------------------------------------------------------------------------- /scripts/deploy-mqtt.sh: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2020-08-07 Yong the first version 7 | 8 | 9 | #!/bin/sh 10 | docker cp packages/MQTT-C $1:/ \ 11 | && docker cp ./docker_scripts/build-mqtt.sh $1:/ \ 12 | && docker exec $1 bash -c "/build-mqtt.sh" \ 13 | && rm -rf build/MQTT-C && mkdir MQTT-C \ 14 | && docker cp $1:/MQTT-C build/MQTT-C 15 | -------------------------------------------------------------------------------- /scripts/deploy-pnet.sh: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2020-08-07 Yong the first version 7 | 8 | 9 | #!/bin/sh 10 | docker cp packages/p-net $1:/ \ 11 | && docker cp ./docker_scripts/build-pnet.sh $1:/ \ 12 | && docker exec $1 bash -c "/build-pnet.sh" \ 13 | && rm -rf build/p-net && mkdir build/p-net \ 14 | && docker cp $1:/p-net/build/ build/p-net/ 15 | -------------------------------------------------------------------------------- /scripts/deploy-soem.sh: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2020-08-07 Yong the first version 7 | 8 | 9 | #!/bin/sh 10 | docker cp soem $1:/ \ 11 | && docker cp ./docker_scripts/build-soem.sh $1:/ \ 12 | && docker exec $1 bash -c "/build-soem.sh" \ 13 | && rm -rf build/soem \ 14 | && docker cp $1:/soem build/soem 15 | -------------------------------------------------------------------------------- /scripts/deploy-zstd.sh: -------------------------------------------------------------------------------- 1 | 2 | # COPYRIGHT (C) 2019. JIEQI EdgeComputing Ltd. 3 | # SPDX-License-Identifier: GPL 3.0 4 | # Change Logs: 5 | # Date Author Notes 6 | # 2020-08-07 Yong the first version 7 | 8 | 9 | #!/bin/sh 10 | docker cp packages/zstd $1:/ \ 11 | && docker cp ./docker_scripts/build-zstd.sh $1:/ \ 12 | && docker exec $1 bash -c "/build-zstd.sh" \ 13 | && rm -rf build/zstd && mkdir build/zstd \ 14 | && docker cp $1:/zstd/zstd build/zstd/ 15 | --------------------------------------------------------------------------------