This package contains an example of a very simple PalCom device {@link ist.palcom.services.echo.EchoDevice}, implemented using the device framework in {@link ist.palcom.device}. The device provides one service {@link ist.palcom.services.echo.EchoService}, which is implemented using the service framework in {@link ist.palcom.services}. There is also a simulated device {@link ist.palcom.services.echo.EchoDeviceGUI} which runs the device code and shows a small Swing window representing the device "hardware".
The code in the echo device can be used as a starting point when writing a small palpable device.
Figure 1 shows an overview of the classes used with EchoDevice.
Figure 1 EchoDevice and the classes it uses.
The {@link ist.palcom.services.echo.EchoDevice} class extends {@link ist.palcom.device.AbstractDevice}.
run
method is defined that runs a scheduler and
initializes the device.
initDevice
: to stop the echo service.
The main
method of EchoDevice could be the
main
method on a small palpable device. It creates an
EchoDevice object and runs it:
public static void main(String[] args) { EchoDevice device = new EchoDevice(new URN("urn:palcom://echodevice")); device.setName("EchoDevice"); device.run(); }
{@link ist.palcom.services.echo.EchoService} extends {@link ist.palcom.services.AbstractService} and provides a service that is described by a service description.
{@link ist.palcom.services.echo.EchoDeviceGUI} is a simplified example of a simulated device, with no real user interaction. It just serves as a starting point. Figure 2 shows an overview of the classes used with EchoDeviceGUI.
Figure 2 EchoDeviceGUI and the classes it uses.
The main
method uses {@link
ist.palcom.simulated.device.factory.AbstractDeviceFactory} for
starting the simulated device.