|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.buglabs.bug.module.gps.GPSModlet
public class GPSModlet
The Modlet exports the hardware-level services to the OSGi runtime.
| Field Summary | |
|---|---|
static java.lang.String |
MODULE_ID
|
protected static java.lang.String |
PROPERTY_ANTENNA
|
protected static java.lang.String |
PROPERTY_ANTENNA_ACTIVE
|
protected static java.lang.String |
PROPERTY_ANTENNA_PASSIVE
|
protected static java.lang.String |
PROPERTY_GPS_FIX
|
protected static java.lang.String |
PROPERTY_IOX
|
protected static java.lang.String |
PROPERTY_MODULE_NAME
|
| Fields inherited from interface com.buglabs.bug.module.gps.pub.IGPSModuleControl |
|---|
STATUS_ACTIVE_ANTENNA, STATUS_PASSIVE_ANTENNA |
| Fields inherited from interface com.buglabs.services.ws.PublicWSProvider |
|---|
DELETE, GET, PACKAGE_ID, POST, PUT |
| Constructor Summary | |
|---|---|
GPSModlet(BundleContext context,
int slotId,
java.lang.String moduleId,
java.lang.String moduleName)
|
|
GPSModlet(BundleContext context,
int slotId,
java.lang.String moduleId,
java.lang.String moduleName,
BMIModuleProperties properties)
|
|
| Method Summary | |
|---|---|
PublicWSDefinition |
discover(int operation)
|
IWSResponse |
execute(int operation,
java.lang.String input)
Execute a service. |
java.lang.String |
getDescription()
|
LatLon |
getLatitudeLongitude()
|
java.lang.String |
getModuleId()
Return the MODULE ID. |
java.lang.String |
getModuleName()
Get the human-readable name of this module. |
java.util.List |
getModuleProperties()
Return a list of IModuleProperty elements. |
Position |
getPosition()
|
java.lang.String |
getPublicName()
|
int |
getSlotId()
|
int |
getStatus()
bit 0: GPS FIX Active Low. |
int |
LEDGreenOff()
|
int |
LEDGreenOn()
|
int |
LEDRedOff()
|
int |
LEDRedOn()
|
int |
resume()
Resume the module. |
int |
setActiveAntenna()
Use the active (external) antenna of the gps device. |
int |
setLEDGreen(boolean state)
|
int |
setLEDRed(boolean state)
|
boolean |
setModuleProperty(IModuleProperty property)
Set a property. |
int |
setPassiveAntenna()
Use the passive (internal) antenna of the gps device. |
void |
setPublicName(java.lang.String name)
Set the name of the service. |
void |
setup()
Connect to any devices or do any initialization. |
void |
start()
Begin modlet. |
void |
stop()
Unregister services and release any resources. |
int |
suspend()
Suspend the module. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String PROPERTY_MODULE_NAME
protected static final java.lang.String PROPERTY_IOX
protected static final java.lang.String PROPERTY_GPS_FIX
protected static final java.lang.String PROPERTY_ANTENNA
protected static final java.lang.String PROPERTY_ANTENNA_PASSIVE
protected static final java.lang.String PROPERTY_ANTENNA_ACTIVE
public static final java.lang.String MODULE_ID
| Constructor Detail |
|---|
public GPSModlet(BundleContext context,
int slotId,
java.lang.String moduleId,
java.lang.String moduleName)
context - slotId - moduleId - moduleName -
public GPSModlet(BundleContext context,
int slotId,
java.lang.String moduleId,
java.lang.String moduleName,
BMIModuleProperties properties)
| Method Detail |
|---|
public void start()
throws java.lang.Exception
IModlet
start in interface IModletjava.lang.Exception
public void stop()
throws java.lang.Exception
IModlet
stop in interface IModletjava.lang.Exceptionpublic Position getPosition()
getPosition in interface IPositionProviderpublic java.util.List getModuleProperties()
IModuleControlIModuleProperty elements.
getModuleProperties in interface IModuleControlpublic boolean setModuleProperty(IModuleProperty property)
IModuleControl
setModuleProperty in interface IModuleControlpublic java.lang.String getModuleName()
IModuleControl
getModuleName in interface IModuleControlpublic java.lang.String getModuleId()
IModlet
getModuleId in interface IModletpublic int getSlotId()
getSlotId in interface IModletgetSlotId in interface IModuleControl
public int resume()
throws java.io.IOException
IModuleControl
resume in interface IModuleControljava.io.IOException
public int suspend()
throws java.io.IOException
IModuleControl
suspend in interface IModuleControljava.io.IOExceptionpublic PublicWSDefinition discover(int operation)
discover in interface PublicWSProvideroperation - HTTP operation. See IPublicServiceProvider.GET, etc.
public IWSResponse execute(int operation,
java.lang.String input)
PublicWSProvider
execute in interface PublicWSProvideroperation - PublicWSProvider.GET, .PUT, .POST, .DELETE
public java.lang.String getPublicName()
getPublicName in interface PublicWSProviderpublic java.lang.String getDescription()
getDescription in interface PublicWSProvider
public void setup()
throws java.lang.Exception
IModlet
setup in interface IModletjava.lang.Exceptionpublic LatLon getLatitudeLongitude()
getLatitudeLongitude in interface IPositionProvider
public int LEDGreenOff()
throws java.io.IOException
java.io.IOException
public int LEDGreenOn()
throws java.io.IOException
java.io.IOException
public int LEDRedOff()
throws java.io.IOException
java.io.IOException
public int LEDRedOn()
throws java.io.IOException
java.io.IOException
public int getStatus()
throws java.io.IOException
IGPSModuleControl
getStatus in interface IGPSModuleControljava.io.IOException
public int setActiveAntenna()
throws java.io.IOException
IGPSModuleControl
setActiveAntenna in interface IGPSModuleControljava.io.IOException
public int setPassiveAntenna()
throws java.io.IOException
IGPSModuleControl
setPassiveAntenna in interface IGPSModuleControljava.io.IOException
public int setLEDGreen(boolean state)
throws java.io.IOException
setLEDGreen in interface IModuleLEDControllerjava.io.IOException
public int setLEDRed(boolean state)
throws java.io.IOException
setLEDRed in interface IModuleLEDControllerstate - on = true, off = false;
java.io.IOExceptionpublic void setPublicName(java.lang.String name)
PublicWSProvider2
setPublicName in interface PublicWSProvider2
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||