-
Notifications
You must be signed in to change notification settings - Fork 9
feat: support simple cmd payload without register info #48
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
Conversation
Robot Results
Passed Tests
|
90b62ad to
6f03a24
Compare
6f03a24 to
a0fac3e
Compare
| target_device = { | ||
| "protocol": "TCP", | ||
| "ip": ip, | ||
| "ip": ip_address or "127.0.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't directly related to your change (as you just moved the existing logic), but this line is redundant, as the ip_address will never be false because this block is anyway behind an if statement (e.g. if ip_address)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that's fine, we can leave it as is for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. Nice extension, and great to see systems tests
Supports simple cmd payload without register info; made register address 6 and 7 writabl; fixed writing float issue; rename legacy with explicit
a0fac3e to
43ee193
Compare
Now the set_register and set_coil support two kinds of payload, one legacy c8y operation payload with full register info that saved by c8y cloud Fieldbus; one new simple operation payload that only includes registerid/coilid and value.
To be able to handle the new simple payload, the device identity will be extracted from the te topic. devices.toml now has 'name' field for register and coil to help locate the corresponding register or coil.
Now the plugin can also write float value to a register but only with the simple payload.
Added some tests into the tests/modbus_reader/operations.robot, it's working fine locally.