A.2. Chapter 8—Device Access

A.2.1. Serial Service and Driver Locator

A.2.1.1. com/acme/service/device/serial/SerialService.java
 package com.acme.service.device.serial; import javax.comm.SerialPortEventListener; import org.osgi.service.device.Device; /** * The serial device service represents an available serial port * on the host. If multiple ports are available, we claim * ownership for them and register an instance of this service * for each of the ports. * * It also allows multiple event listeners to be added for * SerialPortEvents, which are delivered to the listeners * synchronously. * * Do not disable the CTS event notification, because DA relies on * that to detect if a device is connected to or disconnected from the * serial port. */ ...

Get Programming Open Service Gateways with Java Embedded Server™ Technology now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.