Skip to content

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 <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
@SammyOina SammyOina marked this pull request as ready for review August 21, 2023 14:36
Signed-off-by: SammyOina <sammyoina@gmail.com>
Refactor the modbus adapter codebase by removing unnecessary imports and unused constants.

Signed-off-by: SammyOina <sammyoina@gmail.com>
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 <sammyoina@gmail.com>
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 <sammyoina@gmail.com>
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 <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
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