examples.carcontrol
Interface DoorService

All Known Implementing Classes:
DoorServiceImpl

public interface DoorService

This service sets and observes the status of doors in the car.
right front door - 00001 ( 1) left front door - 00010 ( 2) right rear door - 00100 ( 4) left rear door - 01000 ( 8) trunk - 10000 (16)
A set bit within the given bitmask means the door is closed.


Field Summary
static int LEFT_BACK
           
static int LEFT_FRONT
           
static String PUBLISH_KEY
          The path in the environment where the DoorAgent expects this service to be published.
static int REAR
           
static int RIGHT_BACK
           
static int RIGHT_FRONT
           
 
Method Summary
 byte getStatus()
          Returns current state, means the current position of all doors
 boolean isOpen(int which)
          Returns true if door is open
 void setStatus(int newstate)
          Sets the states of all doors.
 

Field Detail

PUBLISH_KEY

public static final String PUBLISH_KEY
The path in the environment where the DoorAgent expects this service to be published.

Value: /local/public/car/doors

See Also:
Constant Field Values

RIGHT_FRONT

public static final int RIGHT_FRONT
See Also:
Constant Field Values

LEFT_FRONT

public static final int LEFT_FRONT
See Also:
Constant Field Values

RIGHT_BACK

public static final int RIGHT_BACK
See Also:
Constant Field Values

LEFT_BACK

public static final int LEFT_BACK
See Also:
Constant Field Values

REAR

public static final int REAR
See Also:
Constant Field Values
Method Detail

getStatus

public byte getStatus()
Returns current state, means the current position of all doors

Returns:
current state representing door position

isOpen

public boolean isOpen(int which)
Returns true if door is open

Parameters:
which - number of the door to be checked. Use the constants defined in DoorService.
Returns:
true is door is open

setStatus

public void setStatus(int newstate)
Sets the states of all doors. JUST FOR TESTING PURPOSES

Parameters:
newstate - the new state status is set to.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.