Skip to content

Commit 7f2cd24

Browse files
author
Jonas
committed
Improve javadoc syntax
1 parent 5ad4f19 commit 7f2cd24

6 files changed

Lines changed: 36 additions & 32 deletions

File tree

src/main/java/io/github/joblo2213/sma/speedwire/Speedwire.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
/**
1717
* <p>
1818
* Main class for interacting with speedwire devices.
19-
* </p><br><p>
19+
* </p><p>
2020
* All devices that use the speedwire protocol send data periodically via
2121
* <a href="https://en.wikipedia.org/wiki/User_Datagram_Protocol">UDP</a>
2222
* <a href="https://en.wikipedia.org/wiki/Multicast">Multicast</a>, by default to group {@code 239.12.255.254}
2323
* on port {@code 9522}.
24-
* </p><br><p>
24+
* </p><p>
2525
* To join the multicast group and listen for incoming data call the {@code start()} method.<br>
2626
* The thread will read all incoming data and parse the telegrams.<br>
2727
* Register callbacks that receive the parsed telegrams from the thread by using {@code onData()}.<br>
2828
* Callbacks that handle occurring errors or timeouts can also be registered but aren't mandatory.<br>
29-
* </p><br><p>
29+
* </p><p>
3030
* <b>Example:</b>
3131
* </p><pre>{@code
3232
* Speedwire sw = new Speedwire();
@@ -129,7 +129,7 @@ private static InetAddress getLocalAddress() throws IOException {
129129
* Callbacks are allowed to be registered while the speedwire thread is running, although it is advised to register
130130
* them before calling {@code start()}.<br>
131131
* The callback will be run on the speedwire thread so avoid blocking or very slow operations.
132-
* </p><br><p>
132+
* </p><p>
133133
* <b>Note:</b><br>
134134
* Telegrams send from your host address will be redirected back by the multicast group and are therefore
135135
* filtered out. They will not trigger this callback.
@@ -183,7 +183,7 @@ public void send(byte[] packet) {
183183
* Every speedwire device will answer this request with a {@link DiscoveryResponse} for which you can listen
184184
* using {@code onData()}.<br>
185185
* This allows detecting all unknown devices and determining their ip addresses by using {@link Telegram#getOrigin()}.
186-
* </p><br><p>
186+
* </p><p>
187187
* More information on speedwire device discovery can be found in
188188
* <a href="https://www.sma.de/fileadmin/content/global/Partner/Documents/sma_developer/SpeedwireDD-TI-en-10.pdf">
189189
* SpeedwireDD-TI-en-10.pdf

src/main/java/io/github/joblo2213/sma/speedwire/SpeedwireCallback.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
/**
66
* <p>
77
* The callback that is run on any received data packets over sma speedwire.
8-
* </p><br><p>
8+
* </p><p>
99
* If you want to listen for specific telegrams or parse special data, check if the provided data is of a
1010
* specific subclass of telegram.
11-
* </p><br><p>
11+
* </p><p>
1212
* Currently implemented telegrams:<br>
13-
* {@link DiscoveryResponse}, {@link EnergyMeterTelegram}
14-
* </p><br><p>
13+
* <ul>
14+
* <li>{@link DiscoveryResponse}</li>
15+
* <li>{@link EnergyMeterTelegram}</li>
16+
* </ul></p><p>
1517
* <b>Example:</b>
1618
* <pre>{@code
1719
* speedwire.onData(data -> {

src/main/java/io/github/joblo2213/sma/speedwire/SpeedwireErrorHandler.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@
99
/**
1010
* <p>
1111
* The callback that is run on any occurring exceptions while reading incoming packets from sma speedwire.
12-
* </p><br><p>
12+
* </p><p>
1313
* If you want to listen for specific types of exceptions, check the type with {@code instanceof}.
14-
* </p><br><p>
14+
* </p><p>
1515
* Likely exceptions are:<br>
16-
* {@link TelegramInvalidException} - if an incoming packet can't be parsed as valid speedwire telegram
17-
* {@link IOException} – if an I/O error occurs.<br>
18-
* {@link PortUnreachableException} – may be thrown if the socket is connected to a currently unreachable destination.
19-
* Note, there is no guarantee that the exception will be thrown.<br>
20-
* {@link IllegalBlockingModeException} – if the socket has an associated channel,
21-
* and the channel is in non-blocking mode.<br>
22-
* </p><br><p>
16+
* <ul>
17+
* <li>{@link TelegramInvalidException} - if an incoming packet can't be parsed as valid speedwire telegram</li>
18+
* <li>{@link IOException} – if an I/O error occurs.</li>
19+
* <li>{@link PortUnreachableException} – may be thrown if the socket is connected to a currently unreachable destination.
20+
* Note, there is no guarantee that the exception will be thrown.</li>
21+
* <li>{@link IllegalBlockingModeException} – if the socket has an associated channel,
22+
* and the channel is in non-blocking mode.</li>
23+
* </ul></p><p>
2324
* <b>Example:</b>
2425
* <pre>{@code
2526
* speedwire.onError(e -> {

src/main/java/io/github/joblo2213/sma/speedwire/protocol/OBISIdentifier.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
* <p>
77
* OBIS identifiers are used to identify measurement values in a telegram.<br>
88
* They are defined in the <b>ICE 62056-61</b> standard.
9-
* </p><br><p>
9+
* </p><p>
1010
* Each OBIS identifier consists of the following groups:<br>
11-
* <i><b>Group A</b> - specifies the medium (1 = electricity)</i> <b>omitted</b><br>
12-
* <b>Group B</b> - specifies the channel (default 0)<br>
13-
* <b>Group C</b> - specifies the index of the physical value<br>
14-
* <b>Group D</b> - specifies the type of measurement<br>
15-
* <b>Group E</b> - specifies the tariff (default 0)<br>
16-
* </p>
11+
* <ul>
12+
* <li><i><b>Group A</b> - specifies the medium (1 = electricity)</i> <b>omitted</b></li>
13+
* <li><b>Group B</b> - specifies the channel (default 0)</li>
14+
* <li><b>Group C</b> - specifies the index of the physical value</li>
15+
* <li><b>Group D</b> - specifies the type of measurement</li>
16+
* <li><b>Group E</b> - specifies the tariff (default 0)</li>
17+
* </ul></p>
1718
*/
1819
public class OBISIdentifier {
1920

@@ -45,7 +46,7 @@ public OBISIdentifier(byte[] data) {
4546
* <b>OBIS group B</b><br>
4647
* Some devices have multiple measurement channels that generate multiple measurement results for the same index.<br>
4748
* These devices can separate the results into different channels.
48-
* </p><br><p>
49+
* </p><p>
4950
* SMA Devices initially use channel 0 for internal measurements and can use additional channels for additional
5051
* connected circuits.
5152
* </p>
@@ -98,7 +99,7 @@ public int getDataLength() {
9899
/**
99100
* <p>
100101
* Returns the identifier as String with the syntax B:C.D.E
101-
* </p><br><p>
102+
* </p><p>
102103
* <b>Example:</b> {@code 0:14.4.0} (net frequency)
103104
* </p>
104105
*/

src/main/java/io/github/joblo2213/sma/speedwire/protocol/telegrams/EnergyMeterTelegram.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private void loadMeasurements(int from, int to) throws TelegramInvalidException
9797
/**
9898
* <p>
9999
* Returns the devices SUSy ID.
100-
* </p><br><p>
100+
* </p><p>
101101
* The SUSy ID is a 2 byte long (unsigned) identifier of SMA hardware, located in the first two bytes of a devices
102102
* SMA device address.
103103
* </p>
@@ -124,7 +124,7 @@ public Quantity<Time> getMeasuringTime() {
124124
/**
125125
* <p>
126126
* Returns the software version string of the smart meter
127-
* </p><br><p>
127+
* </p><p>
128128
* Syntax:<br>
129129
* <center><b>Major.Minor.Build.Revision</b></center><br>
130130
* </p>

src/main/java/io/github/joblo2213/sma/speedwire/protocol/telegrams/Telegram.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class Telegram {
3131
* Parses the given datagram packet into a telegram<br>
3232
* The returned telegram will be of a specific subclass if the data from the packet matches the subclasses
3333
* requirements.
34-
* </p><br><p>
34+
* </p><p>
3535
* Currently implemented subclasses:<br>
3636
* {@link DiscoveryResponse}, {@link EnergyMeterTelegram}
3737
* </p>
@@ -110,7 +110,7 @@ public int length() {
110110
/**
111111
* <p>
112112
* Returns the raw value from the specified position of the telegrams data
113-
* </p><br><p>
113+
* </p><p>
114114
* <b>Telegrams contain unsigned bytes while java byte is signed.<br>
115115
* It's in most cases better to use {@link #getUnsigned(int)}!</b>
116116
* </p>
@@ -135,7 +135,7 @@ public int getUnsigned(int index) {
135135
/**
136136
* <p>
137137
* Returns an array of multiple bytes from the telegrams data
138-
* </p><br><p>
138+
* </p><p>
139139
* <b>Telegrams contain unsigned bytes while java byte is signed.<br>
140140
* It's in most cases better to use {@link #getUnsigned(int, int)}!</b>
141141
* </p>

0 commit comments

Comments
 (0)