File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ class ModbusPacketDecoder : ByteToMessageDecoder() {
24
24
val st = String .format(" %02X" , `in `.getByte(i))
25
25
print (st)
26
26
}
27
- println ()
28
27
29
28
if (`in `!! .readableBytes() < 6 ) {
30
29
logger.debug(" less than 6 bytes received, ignoring..." )
Original file line number Diff line number Diff line change
1
+ import org.slf4j.LoggerFactory
1
2
import kotlin.random.Random
2
3
3
4
class ModbusServerEventListenerReplyRandomNumbers : IModbusServerEventListener {
4
5
6
+ companion object {
7
+ val logger = LoggerFactory .getLogger(" ModbusServerEventListenerReplyRandomNumbers" )
8
+ }
9
+
5
10
private fun generateRandomLogicList (numberOfRegisters : Int ): List <Boolean > {
6
11
val mutableList = mutableListOf<Boolean >()
7
12
for (i in 0 .. numberOfRegisters)
8
13
mutableList.add(Random .nextBoolean())
9
- println (mutableList.toString())
14
+ logger.debug (mutableList.toString())
10
15
return mutableList
11
16
}
12
17
13
18
private fun generateRandomNumericList (numberOfRegisters : Int ): List <Short > {
14
19
val mutableList = mutableListOf<Short >()
15
20
for (i in 0 .. numberOfRegisters)
16
21
mutableList.add(Random .nextInt(Short .MAX_VALUE .toInt()).toShort())
17
- println (mutableList.toString())
22
+ logger.debug (mutableList.toString())
18
23
return mutableList
19
24
}
20
25
You can’t perform that action at this time.
0 commit comments