Proactive service library for modbusd
I do continuous integration and deploy docker images after git push by self-hosted drone.io server, circleci service, codecov service and dockerhub service.
CI Server | Target | Status |
---|---|---|
CircleCI | x86 | |
Travis | x86 | |
Drone | armhf |
Why environment variable? Refer to the 12 factors
- CONF_PSMBTCP: config file path
- EP_BACKEND: endpoint of remote service discovery server (optional)
- IProactiveService: proactive service
- IReaderTaskDataStore: read/poll task data store
- IWriterTaskDataStore: write task data store
- IHistoryDataStore: history data store
- IFilterDataStore: filter data store
- IConfig: config management
- I adopted glide as package management system for this repository.
docker-compose build --pull
docker-compose up
wget https://github.com/zeromq/zeromq3-x/releases/download/v3.2.5/zeromq-3.2.5.tar.gz
tar xvzf zeromq-3.2.5.tar.gz
cd zeromq-3.2.5
./configure
make
sudo make install
sudo ldconfig
# install glide
curl https://glide.sh/get | sh
# install dependencies
glide up
# build
cd tcp-srv
go build -o psmbtcp-srv
- binary
- types
- Bytes to 16-bit integer array tests
-
BytesToUInt16s
in big endian order - (1/4) -
BytesToUInt16s
in little endian order - (2/4) -
BytesToInt16s
in big endian order - (3/4) -
BytesToInt16s
in little endian order - (4/4)
-
- Bytes to 32-bit integer array tests
-
BytesToUInt32s
in (ABCD) Big Endian order - (1/4) -
BytesToUInt32s
in (DCBA) Little Endian order - (2/4) -
BytesToUInt32s
in (BADC) Mid-Big Endian order - (3/4) -
BytesToUInt32s
in (CDAB) Mid-Little Endian order - (4/4) -
BytesToInt32s
in (ABCD) Big Endian order - (1/4) -
BytesToInt32s
in (DCBA) Little Endian order - (2/4) -
BytesToInt32s
in (BADC) Mid-Big Endian order - (3/4) -
BytesToInt32s
in (CDAB) Mid-Little Endian order - (4/4)
-
- Bytes to 32-bit float array tests
-
BytesToFloat32s
in (ABCD) Big Endian order - (1/4) -
BytesToFloat32s
in (DCBA) Little Endian order - (2/4) -
BytesToFloat32s
in (BADC) Mid-Big Endian order - (3/4) -
BytesToFloat32s
in (CDAB) Mid-Little Endian order - (4/4)
-
- Bytes/registers utility tests
-
BitStringToUInt8s
test -
BitStringToUInt8s
test - left comma -
BitStringToUInt8s
test - right comma -
BitStringToUInt8s
test - left, right comma -
RegistersToBytes
test -
BytesToHexString
test -
DecimalStringToRegisters
test -
DecimalStringToRegisters
test - left comma -
DecimalStringToRegisters
test - right comma -
DecimalStringToRegisters
test - left, right comma -
HexStringToRegisters
test -
HexStringToRegisters
test - wrong length -
LinearScalingRegisters
test -
LinearScalingRegisters
test - (0,0,0,0) -
LinearScalingRegisters
test - reverse
-
- One-off modbus tcp struct tests
-
mbtcp.once.read
request test -
mbtcp.once.read
response test
-
- get/set modbus tcp timeout struct tests
-
mbtcp.timeout.read
request test -
mbtcp.timeout.read
response test -
mbtcp.timeout.update
request test -
mbtcp.timeout.update
response test -
mbtcp.once.write
request test -
mbtcp.once.write
response test
-
- modbus tcp downstreamstruct tests
-
read
request test -
single read
response test -
multiple read
response test -
single write
request test -
multiple write
request test -
set timeout
request test -
get timeout
response test
-
MIT