Crea sito


org.zu.ardulink.protocol
Class ProtocolHandler

java.lang.Object
  extended by org.zu.ardulink.protocol.ProtocolHandler

public class ProtocolHandler
extends Object

Ardulink - return to homepage

v0.6.1 Magnum PI

Class to manage the protocol available set. With this class you can install (and set as preferred) a new protocol for ardulink. For instance you can supply a Firmata protocol implementation and install it. A protocol for Ardulink must implements IProtocol interface.

Author:
Luciano Zu project Ardulink http://www.ardulink.org/
See Also:
IProtocol,


Constructor Summary
ProtocolHandler()
           
 
Method Summary
static IProtocol getCurrentProtocolImplementation()
           
static Set<String> getInstalledProtocolImplementationNames()
           
static IProtocol getProtocolImplementation(String implementationName)
           
static boolean installProtocolImplementation(IProtocol protocol)
          Install a protocol.
static boolean setCurrentProtocolImplementation(String implementationName)
          Select a protocol.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtocolHandler

public ProtocolHandler()
Method Detail

getCurrentProtocolImplementation

public static IProtocol getCurrentProtocolImplementation()
Returns:
the current selected protocol (the preferred one)

getProtocolImplementation

public static IProtocol getProtocolImplementation(String implementationName)
Parameters:
implementationName -
Returns:
return the protocol implementation called implementationName (if installed)

getInstalledProtocolImplementationNames

public static Set<String> getInstalledProtocolImplementationNames()
Returns:
all available protocol implementations

setCurrentProtocolImplementation

public static boolean setCurrentProtocolImplementation(String implementationName)
Select a protocol. Set it as preferred.

Parameters:
implementationName -
Returns:
true if protocol is found, if is returned false then remain valid the last selected protocol.

installProtocolImplementation

public static boolean installProtocolImplementation(IProtocol protocol)
Install a protocol.

Parameters:
protocol -
Returns:


Copyright © 2015. All rights reserved.