Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UV-278 - Modbus Adapter #1

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

UV-278 - Modbus Adapter #1

wants to merge 19 commits into from

Conversation

SammyOina
Copy link

@SammyOina SammyOina commented Aug 17, 2023

What does this do?

Creates Modbus adapter on mainflux edge

Which issue(s) does this PR fix/relate to?

https://github.com/ultravioletrs/issues/issues/278

List any changes that modify/break current functionality

Have you included tests for your changes?

Did you document any new/modified functionality?

Notes

To test using a simulated device,

version: "2.1"
services:
  modbus:
    image: techplex/modbus-sim:latest
    container_name: modbus
    ports:
      - 1502:1502
    restart: unless-stopped

See readme for examples

Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
@SammyOina SammyOina marked this pull request as ready for review August 21, 2023 14:36
Signed-off-by: SammyOina <[email protected]>
Makefile Outdated Show resolved Hide resolved
docker/docker-compose.yml Outdated Show resolved Hide resolved
examples/publish/main.go Show resolved Hide resolved
examples/publish/main.go Show resolved Hide resolved
examples/subscribe/main.go Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
modbus/api/endpoint.go Outdated Show resolved Hide resolved
Refactor the modbus adapter codebase by removing unnecessary imports and unused constants.

Signed-off-by: SammyOina <[email protected]>
The Makefile test command was modified to remove the "-mod=vendor" flag and the proto generation commands were removed as they are unnecessary.

This commit fixes the Makefile test command and removes unnecessary proto generation commands.

Signed-off-by: SammyOina <[email protected]>
cmd/modbus/main.go Outdated Show resolved Hide resolved
docker/docker-compose.yml Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
modbus/modbus.go Outdated Show resolved Hide resolved
modbus/setup_test.go Outdated Show resolved Hide resolved
modbus/README.md Outdated Show resolved Hide resolved
modbus/README.md Outdated Show resolved Hide resolved
modbus/README.md Show resolved Hide resolved
modbus/README.md Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
The logger output in the modbus service was not being properly formatted. This commit fixes the issue by using the logger.Info function to print the modbus service listening information.

- Update logger output in modbus service to use logger.Info function
- Fix formatting issue with logger output in modbus service

Signed-off-by: SammyOina <[email protected]>
This commit fixes bugs related to subscription and publishing in the examples/publish/main.go and examples/subscribe/main.go files. The changes include adding the context package and passing the context to the Publish and Subscribe functions. This ensures that the functions have the necessary context for proper execution.

The bug in the examples/publish/main.go file is fixed by adding the context package and passing the context to the Publish function. Previously, the Publish function was called without a context, which could lead to unexpected behavior.

The bug in the examples/subscribe/main.go file is fixed in a similar manner. The context package is imported, and the context is passed to the Subscribe function. This ensures that the Subscribe function has the necessary context for proper execution.

These changes ensure that the subscription and publishing functionalities work correctly in the examples.

Signed-off-by: SammyOina <[email protected]>
modbus/adapter.go Show resolved Hide resolved
internal/apiutil/transport.go Outdated Show resolved Hide resolved
internal/apiutil/token.go Outdated Show resolved Hide resolved
internal/apiutil/errors.go Outdated Show resolved Hide resolved
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants