public class OledSsd1306 extends Service implements I2CControl
cfgDir, dnaPool, MESSAGE_RECORDING_FORMAT_BINARY, MESSAGE_RECORDING_FORMAT_XML
Constructor and Description |
---|
OledSsd1306(java.lang.String n) |
Modifier and Type | Method and Description |
---|---|
void |
attach(Attachable service)
This attach when overriden "routes" to the appropriately typed parameterized
attach within a service.
|
void |
attach(I2CController controller,
java.lang.String deviceBus,
java.lang.String deviceAddress) |
void |
attach(java.lang.String service)
Attachable.attach(serviceName) - routes to reference parameter
Attachable.attach(Attachable)
|
void |
attach(java.lang.String controllerName,
java.lang.String deviceBus,
java.lang.String deviceAddress) |
void |
attachI2CController(I2CController controller) |
void |
clearRect(int x,
int y,
int width,
int height,
boolean on) |
void |
detach(Attachable service)
This detach when overriden "routes" to the appropriately typed parameterized
detach within a service.
|
void |
detach(java.lang.String service)
Attachable.detach(serviceName) - routes to reference parameter
Attachable.detach(Attachable)
|
void |
detachI2CController(I2CController controller) |
void |
display() |
void |
display(int[] image) |
void |
drawChar(char c,
int x,
int y,
boolean on) |
void |
drawImage(java.awt.image.BufferedImage image,
int x,
int y) |
void |
drawString(java.lang.String string,
int x,
int y,
boolean on) |
void |
drawStringCentered(java.lang.String string,
int y,
boolean on) |
java.util.Set<java.lang.String> |
getAttached()
Returns all the currently attached services
|
java.lang.String |
getDeviceAddress() |
java.lang.String |
getDeviceBus() |
static ServiceType |
getMetaData()
This static method returns all the details of the class without it having
to be constructed.
|
boolean |
isAttached(Attachable instance)
the "routing" isAttached - when overridden by a service this
"routes" to the appropriate typed isAttached
|
boolean |
isAttached(java.lang.String name)
returns if the Attachable has been set or not - name interface
|
static void |
main(java.lang.String[] args) |
void |
onRegistered(ServiceInterface s) |
void |
refreshControllers() |
void |
setDeviceAddress(java.lang.String deviceAddress) |
void |
setDeviceBus(java.lang.String deviceBus) |
void |
setDisplayType(int displayType) |
void |
setPixel(int x,
int y,
boolean on) |
void |
stopService()
Stops the service.
|
addListener, addListener, addTask, addTask, addTask, addTaskOneShot, allowDisplay, allowDisplay, broadcastState, buildDna, buildDna, buildDnaKeys, buildDnaNames, clearLastError, close, containsTask, copyShallowFrom, createPeer, createPeer, createRootReserved, detach, echoHeartbeat, error, error, error, getCfgDir, getComm, getDeclaredMethodNames, getDeclaredMethods, getDescription, getDna, getDnaString, getHostName, getInbox, getInstanceId, getIntanceName, getInterfaceSet, getLastError, getMessageSet, getMetaData, getMethodMap, getMethodNames, getMethods, getMethodToolTip, getMsg, getName, getNotifyList, getNotifyListKeySet, getOutbox, getPeerKey, getPeerName, getServiceResourceFile, getSimpleName, getTasks, getThisThread, getType, hasError, hasPeers, help, help, in, info, info, invoke, invoke, invoke, invokeOn, isLocal, isReady, isRunning, isRuntime, isVirtual, load, load, logTimeEnable, mergeDna, mergeDna, mergePeerDna, movePeerDna, out, out, preProcessHook, preRoutingHook, publishError, publishQueueStats, publishState, publishStats, publishStatus, purgeTask, purgeTasks, releasePeers, releaseService, removeAllListeners, removeListener, requiresSecurity, reserve, reserve, reserveRoot, reserveRoot, reserveRootAs, run, save, save, save, send, send, send, send, sendBlocking, sendBlocking, sendBlocking, sendBlocking, sendPeer, setInstanceId, setName, setPeer, setSecurityProvider, setState, setThisThread, setVirtual, sleep, stackToString, startHeartbeat, startPeer, startPeer, startRecording, startService, stopHeartbeat, stopMsgRecording, subscribe, subscribe, subscribe, toString, unsubscribe, unsubscribe, unsubscribe, updateStats, warn, warn
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
detach, isLocal
getName
public static final org.slf4j.Logger log
public static final int HIGH
public static final int LOW
public static final int INPUT
public static final int OUTPUT
public java.util.List<java.lang.String> controllers
public java.lang.String controllerName
public transient I2CController controller
public java.util.List<java.lang.String> deviceAddressList
public java.lang.String deviceAddress
public java.util.List<java.lang.String> deviceBusList
public java.lang.String deviceBus
public static short SSD1306_SETCONTRAST
public static short SSD1306_DISPLAYALLON_RESUME
public static short SSD1306_DISPLAYALLON
public static short SSD1306_NORMALDISPLAY
public static short SSD1306_INVERTDISPLAY
public static short SSD1306_DISPLAYOFF
public static short SSD1306_DISPLAYON
public static short SSD1306_SETDISPLAYOFFSET
public static short SSD1306_SETCOMPINS
public static short SSD1306_SETVCOMDETECT
public static short SSD1306_SETDISPLAYCLOCKDIV
public static short SSD1306_SETPRECHARGE
public static short SSD1306_SETMULTIPLEX
public static short SSD1306_SETLOWCOLUMN
public static short SSD1306_SETHIGHCOLUMN
public static short SSD1306_SETSTARTLINE
public static short SSD1306_MEMORYMODE
public static short SSD1306_COLUMNADDR
public static short SSD1306_PAGEADDR
public static short SSD1306_COMSCANINC
public static short SSD1306_COMSCANDEC
public static short SSD1306_SEGREMAP
public static short SSD1306_CHARGEPUMP
public static short SSD1306_EXTERNALVCC
public static short SSD1306_SWITCHCAPVCC
public static int SSD1306_128_64
public static int SSD1306_128_32
public static int SSD1306_96_16
public int oledType
public static final int BLACK
public static final int WHITE
public static final int INVERSE
public static int SSD1306_ACTIVATE_SCROLL
public static int SSD1306_DEACTIVATE_SCROLL
public static int SSD1306_SET_VERTICAL_SCROLL_AREA
public static int SSD1306_RIGHT_HORIZONTAL_SCROLL
public static int SSD1306_LEFT_HORIZONTAL_SCROLL
public static int SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL
public static int SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL
public int SSD1306_LCDWIDTH
public int SSD1306_LCDHEIGHT
public int[] buffer
public boolean isAttached
public static void main(java.lang.String[] args)
public void onRegistered(ServiceInterface s)
public void refreshControllers()
public void setDeviceBus(java.lang.String deviceBus)
setDeviceBus
in interface I2CControl
public void setDeviceAddress(java.lang.String deviceAddress)
setDeviceAddress
in interface I2CControl
public void setDisplayType(int displayType)
public void setPixel(int x, int y, boolean on)
public void drawString(java.lang.String string, int x, int y, boolean on)
public void drawStringCentered(java.lang.String string, int y, boolean on)
public void clearRect(int x, int y, int width, int height, boolean on)
public void drawChar(char c, int x, int y, boolean on)
public void drawImage(java.awt.image.BufferedImage image, int x, int y)
public void display(int[] image)
public void display()
public static ServiceType getMetaData()
public boolean isAttached(java.lang.String name)
Attachable
isAttached
in interface Attachable
isAttached
in class Service
name
- - name of servicepublic void attach(java.lang.String service) throws java.lang.Exception
Service
attach
in interface Attachable
attach
in class Service
service
- - service namejava.lang.Exception
- - thrown if errorpublic void attach(Attachable service) throws java.lang.Exception
Service
public void attach(Attachable service) { if (ServoControl.class.isAssignableFrom(service.getClass())) { attachServoControl((ServoControl) service); return; } ... route to more attach functions .... error("%s doesn't know how to attach a %s", getClass().getSimpleName(), service.getClass().getSimpleName()); } And within attachServoControl : public void attachServoControl(ServoControl service) { // guard if (!isAttached(service)){ return; } ... attach logic .... // call to attaching service service.attach(this); }
attach
in interface Attachable
attach
in class Service
service
- - the service to attach from this servicejava.lang.Exception
- - throws on error and cannot attachpublic void attach(java.lang.String controllerName, java.lang.String deviceBus, java.lang.String deviceAddress)
attach
in interface I2CControl
public void attach(I2CController controller, java.lang.String deviceBus, java.lang.String deviceAddress)
attach
in interface I2CControl
public void attachI2CController(I2CController controller)
attachI2CController
in interface I2CControl
public void detach(java.lang.String service)
Service
detach
in interface Attachable
detach
in class Service
service
- - name of servicepublic void detach(Attachable service)
Service
public void detach(Attachable service) { if (ServoControl.class.isAssignableFrom(service.getClass())) { detachServoControl((ServoControl) service); return; } ... route to more detach functions .... error("%s doesn't know how to detach a %s", getClass().getSimpleName(), service.getClass().getSimpleName()); } And within detachServoControl : public void detachServoControl(ServoControl service) { // guard if (!isAttached(service)){ return; } ... detach logic .... // call to detaching service service.detach(this); }
detach
in interface Attachable
detach
in class Service
service
- - the service to detach from this servicepublic void detachI2CController(I2CController controller)
detachI2CController
in interface I2CControl
public void stopService()
Service
stopService
in interface ServiceInterface
stopService
in class Service
public java.util.Set<java.lang.String> getAttached()
getAttached
in interface Attachable
getAttached
in class Service
public java.lang.String getDeviceBus()
getDeviceBus
in interface I2CControl
public java.lang.String getDeviceAddress()
getDeviceAddress
in interface I2CControl
public boolean isAttached(Attachable instance)
Service
isAttached
in interface Attachable
isAttached
in class Service
instance
- - referenced service to test