[Documentation] Markdown improvements f to m (#13866)
Signed-off-by: Jerome Luckenbach <github@luckenba.ch>
This commit is contained in:
committed by
GitHub
parent
3c236b3103
commit
0e68936663
@@ -2,7 +2,7 @@
|
||||
|
||||
## Debugging an addon
|
||||
|
||||
Please follow IDE setup guide at https://www.openhab.org/docs/developer/ide/eclipse.html.
|
||||
Please follow IDE setup guide at <https://www.openhab.org/docs/developer/ide/eclipse.html>.
|
||||
|
||||
When configuring dependencies in `openhab-distro/launch/app/pom.xml`, add all dependencies, including the transitive dependencies:
|
||||
|
||||
@@ -32,17 +32,17 @@ When configuring dependencies in `openhab-distro/launch/app/pom.xml`, add all de
|
||||
You can use test serial slaves without any hardware on Linux using these steps:
|
||||
|
||||
1. Set-up virtual null modem emulator using [tty0tty](https://github.com/freemed/tty0tty)
|
||||
2. Download [diagslave](https://www.modbusdriver.com/diagslave.html) and start modbus serial slave up using this command:
|
||||
1. Download [diagslave](https://www.modbusdriver.com/diagslave.html) and start modbus serial slave up using this command:
|
||||
|
||||
```
|
||||
```shell
|
||||
./diagslave -m rtu -a 1 -b 38400 -d 8 -s 1 -p none -4 10 /dev/pts/7
|
||||
```
|
||||
|
||||
3. Configure openHAB's modbus slave to connect to `/dev/pts/8`.
|
||||
1. Configure openHAB's modbus slave to connect to `/dev/pts/8`.
|
||||
|
||||
4. Modify `start.sh` or `start_debug.sh` to include the unconventional port name by adding the following argument to `java`:
|
||||
1. Modify `start.sh` or `start_debug.sh` to include the unconventional port name by adding the following argument to `java`:
|
||||
|
||||
```
|
||||
```text
|
||||
-Dgnu.io.rxtx.SerialPorts=/dev/pts/8
|
||||
```
|
||||
|
||||
@@ -52,12 +52,11 @@ Naturally this is not the same thing as the real thing but helps to identify sim
|
||||
|
||||
1. Download [diagslave](https://www.modbusdriver.com/diagslave.html) and start modbus tcp server (slave) using this command:
|
||||
|
||||
```
|
||||
./diagslave -m tcp -a 1 -p 55502
|
||||
```
|
||||
|
||||
2. Configure openHAB's modbus slave to connect to `127.0.0.1:55502`.
|
||||
```shell
|
||||
./diagslave -m tcp -a 1 -p 55502
|
||||
```
|
||||
|
||||
1. Configure openHAB's modbus slave to connect to `127.0.0.1:55502`.
|
||||
|
||||
## Writing Data
|
||||
|
||||
@@ -65,8 +64,7 @@ See this [community post](https://community.openhab.org/t/something-is-rounding-
|
||||
|
||||
You can also use `modpoll` to write data:
|
||||
|
||||
|
||||
```bash
|
||||
```shell
|
||||
# write value=5 to holding register 40001 (index=0 in the binding)
|
||||
./modpoll -m tcp -a 1 -r 1 -t4 -p 502 127.0.0.1 5
|
||||
# set coil 00001 (index=0 in the binding) to TRUE
|
||||
@@ -153,14 +151,14 @@ public class SunspecDiscoveryParticipant implements ModbusDiscoveryParticipant {
|
||||
|
||||
There are two methods you have to implement:
|
||||
|
||||
- `getSupportedThingTypeUIDs` should return a list of the thing type UIDs that are supported by this discovery participant. This is fairly straightforward.
|
||||
|
||||
- `startDiscovery` method will be called when a discovery process has began. This method receives two parameters:
|
||||
|
||||
- `ModbusEndpointThingHandler` is the endpoint's handler that should be tested if it is known by your bundle. You can start your read requests against this handler.
|
||||
|
||||
- `ModbusDiscoveryListener` this listener instance should be used to report any known devices found and to notify the main discovery process when your binding has finished the discovery.
|
||||
|
||||
- `getSupportedThingTypeUIDs` should return a list of the thing type UIDs that are supported by this discovery participant. This is fairly straightforward.
|
||||
|
||||
- `startDiscovery` method will be called when a discovery process has began. This method receives two parameters:
|
||||
|
||||
- `ModbusEndpointThingHandler` is the endpoint's handler that should be tested if it is known by your bundle. You can start your read requests against this handler.
|
||||
|
||||
- `ModbusDiscoveryListener` this listener instance should be used to report any known devices found and to notify the main discovery process when your binding has finished the discovery.
|
||||
|
||||
Please try to avoid write requests to the endpoint because it could be some unknown device that write requests could misconfigure.
|
||||
|
||||
When a known device is found a `DiscoveryResult` object has to be created then the `thingDiscovered` method has to be called.
|
||||
@@ -170,7 +168,6 @@ For example you could store the start Modbus address of the device or vendor/mod
|
||||
When the discovery process is finished either by detecting a device or by realizing it is not supported you should call the `discoveryFinished` method.
|
||||
This will tear down any resources allocated for the discovery process.
|
||||
|
||||
|
||||
### Discovery Architecture
|
||||
|
||||
The following diagram shows the concept how discovery is implemented in this binding. (Note that some intermediate classes and interfaces are not shown for clarity.)
|
||||
|
||||
Reference in New Issue
Block a user