public class Rs232ControllerBuilder extends Object
controller = new Rs232ControllerBuilder()
.withRs232(portName, baud)
.withMenuTree(menuTree)
.withLocalName("myApp")
.build();
| Constructor | Description |
|---|---|
Rs232ControllerBuilder() |
| Modifier and Type | Method | Description |
|---|---|---|
RemoteMenuController |
build() |
Once the above methods have been called to fill in the blanks, then call build to get
the actual instance.
|
Rs232ControllerBuilder |
withClock(java.time.Clock clock) |
Optional, defaults to system clock but can be overriden
|
Rs232ControllerBuilder |
withExecutor(ScheduledExecutorService executor) |
Optional, defaults to creating a suitable executor for single connectivity
|
Rs232ControllerBuilder |
withHeartbeatFrequency(int frequency) |
Optional, defaults to 10 seconds between heartbeats.
|
Rs232ControllerBuilder |
withLocalName(String name) |
Optional, Set the name of this connection, defaults to NoName
|
Rs232ControllerBuilder |
withMenuTree(MenuTree tree) |
Mandatory, the menuTree instance to store the menu items retrieved from the remote side.
|
Rs232ControllerBuilder |
withProtocol(MenuCommandProtocol protocol) |
Optional, defaults to the standard protocol.
|
Rs232ControllerBuilder |
withRs232(String port,
int baud) |
Mandatory, specifies the port name and baud rate for rs232.
|
public Rs232ControllerBuilder withRs232(String port, int baud)
port - the name of the portbaud - the baud ratepublic Rs232ControllerBuilder withClock(java.time.Clock clock)
clock - the clock to usepublic Rs232ControllerBuilder withExecutor(ScheduledExecutorService executor)
executor - the executor which must implement ScheduledExecutorServicepublic Rs232ControllerBuilder withHeartbeatFrequency(int frequency)
frequency - the frequency, must align with remote device.public Rs232ControllerBuilder withMenuTree(MenuTree tree)
tree - the menu tree to be populated (only use a menu tree with one remote)public Rs232ControllerBuilder withProtocol(MenuCommandProtocol protocol)
protocol - a protocol object.public Rs232ControllerBuilder withLocalName(String name)
name - the name the remote will see.public RemoteMenuController build()
Copyright © 2018. All rights reserved.