package org.etsi.its.uppertester;

/**
 * This interface provides methods to support CAM upper tester
 */
public interface ICamUpperTester extends IUpperTester {

    /** 
     *  Changes the heading 
     *  @param  direction   Integer value form 0 to 28799 (North = 0, East =7200, South = 14400, West = 21600)
     *  @return True if operation is successful, false otherwise
     */
    public boolean changeHeading(int direction);
    
    /**  
     *  Changes the position in the direction of the current heading in meters
     *  @param  distance    Position offset in meters
     *  @return True if operation is successful, false otherwise
     */
    public boolean changePosition(int distance);
    
    /**  
     *  Changes the speed
     *  @param  variation   Speed variation in units of 0.01 m/s
     *  @return True if operation is successful, false otherwise
     */
    public boolean changeSpeed(int variation);
    
    /**  
     *  Sets the crash signal
     *  @param  crashed True if CrashSignal is to be activated, false otherwise
     *  @return True if operation is successful, false otherwise
     */
    public boolean setCrashSignal(boolean crashed);
    
    /**  
     *  Sets the dangerous goods status
     *  @param  dangerousGoodsStatus Integer value from 0 to 8191 (0 = no dangerous goods)
     *  @return True if operation is successful, false otherwise
     */
    public boolean setDangerousGoodsStatus(int dangerousGoodsStatus);
    
    /**  
     *  Sets the length width precision
     *  @param  lengthWidthPrecision    Set to false if Length/Width precision is not precisely determined. True otherwise
     *  @return True if operation is successful, false otherwise
     */
    public boolean setLengthWidthPrecision(boolean lengthWidthPrecision);
    
    /**  
     *  Set the distance to the stop line
     *  @param  distance    Distance in units of 1 meter. From 0 to 65535
     *  @return True if operation is successful, false otherwise
     */
    public boolean setDistanceToStopLine(int distance);
    
    /**  
     *  Sets the turn advice
     *  @param  direction   uTurn = 0, sharpRight = 1, right = 2, slightRight = 3, straight = 4, slightLeft = 5, left = 6, sharpLeft = 7
     *  @param  distance    Distance in units of 1 meter. From 0 to 65535
     *  @return True if operation is successful, false otherwise
     */
    public boolean setTurnAdvice(int direction, int distance);
    
    /**  
     *  Increases or decreases the curvature
     *  @param  curvature   Curvature change from -1023 to 1023
     *  @return True if operation is successful, false otherwise
     */
    public boolean changeCurvature(int curvature);
    
    /**  
     *  Sets the occupancy
     *  @param  occupancy   Occupancy value from 0 to 255
     *  @return True if operation is successful, false otherwise
     */
    public boolean setOccupancy(int occupancy);
    
    /**  
     *  Sets the door status
     *  @param  doorStatus  Bit field indicating door status (bit0 = driver, bit1 = passenger, bit2 = maintenance, bit3 = luggage)
     *  @return True if operation is successful, false otherwise
     */
    public boolean setDoorStatus(byte doorStatus);
    
    /**  
     *  Sets the light bar status
     *  @param  status    Status value (0 = unavailable, 1 = disabled, 2 = enabled, 3 = engaged) 
     *  @return True if operation is successful, false otherwise
     */
    public boolean setLightBarStatus(short status);
    
    /**  
     *  Sets the sirene status
     *  @param  status    Status value (0 = unavailable, 1 = disabled, 2 = enabled, 3 = engaged) 
     *  @return True if operation is successful, false otherwise
     */
    public boolean setSireneStatus(short status);
    
    /**  
     *  Sets the traffic light priority
     *  @param  priority Traffic light priority from 0 to 7
     *  @return True if operation is successful, false otherwise
     */
    public boolean setTrafficLightPriority(short priority);
    
    /**  
     *  Sets the schedule deviation
     *  @param  delay   Schedule deviation from -900 to 3600
     *  @return True if operation is successful, false otherwise
     */
    public boolean setScheduleDeviation(int delay);
    
    /**  
     *  Sets the PT line description
     *  @param  courseOfJourney Course of Journey (PT Line Description)
     *  @param  lineRef         Line Reference (PT Line Description)
     *  @param  routeRef        Route Reference (PT Line Description)
     *  @return True if operation is successful, false otherwise
     */
    public boolean setPtLineDescription(String courseOfJourney, String lineRef, String routeRef);
    
    /**  
     *  Sets the exterior lights status
     *  @param  lightStatus Bit field indicating light status 
     *      lowBeamHeadlightsOn     (0),
     *      highBeamHeadlightsOn    (1),
     *      leftTurnSignalOn        (2),
     *      rightTurnSignalOn       (3),
     *      automaticLightControlOn (4),
     *      daytimeRunningLightsOn  (5),
     *      fogLightOn              (6),
     *      parkingLightsOn         (7)
     *  @return True if operation is successful, false otherwise
     */
    public boolean setExteriorLightsStatus(byte lightStatus);
    
    /**
     *  Checks that IUT transmits specific packet to its upper layer
     *  @param  camPdu  Sent CAM packet
     *  @return True if operation is successful, false otherwise
     */    
    public boolean checkLdm(byte[] camPdu);
} 

