// Path: src/net/sourcewalker/olv/messages/LiveViewCall.java
// public abstract class LiveViewCall extends LiveViewMessage {
// 
//     /**
//      * Header consists of two bytes and a int value (4 bytes).
//      */
//     private static final int HEADER_LENGTH = 6;
// 
//     public LiveViewCall(byte id) {
//         super(id);
//     }
// 
//     protected abstract byte[] getPayload();
// 
//     public byte[] getEncoded() {
//         byte[] payload = getPayload();
//         int msgLength = payload.length + HEADER_LENGTH;
//         ByteBuffer msgBuffer = ByteBuffer.allocate(msgLength);
//         msgBuffer.order(ByteOrder.BIG_ENDIAN);
//         msgBuffer.put(getId());
//         msgBuffer.put((byte) 4);
//         msgBuffer.putInt(payload.length);
//         msgBuffer.put(payload);
//         return msgBuffer.array();
//     }
// 
// }
// 
// Path: src/net/sourcewalker/olv/messages/MessageConstants.java
// public final class MessageConstants {
// 
//     public static final byte MSG_GETCAPS = 1;
//     public static final byte MSG_GETCAPS_RESP = 2;
// 
//     public static final byte MSG_DISPLAYTEXT = 3;
//     public static final byte MSG_DISPLAYTEXT_ACK = 4;
// 
//     public static final byte MSG_DISPLAYPANEL = 5;
//     public static final byte MSG_DISPLAYPANEL_ACK = 6;
// 
//     public static final byte MSG_DEVICESTATUS = 7;
//     public static final byte MSG_DEVICESTATUS_ACK = 8;
// 
//     public static final byte MSG_DISPLAYBITMAP = 19;
//     public static final byte MSG_DISPLAYBITMAP_ACK = 20;
// 
//     public static final byte MSG_CLEARDISPLAY = 21;
//     public static final byte MSG_CLEARDISPLAY_ACK = 22;
// 
//     public static final byte MSG_SETMENUSIZE = 23;
//     public static final byte MSG_SETMENUSIZE_ACK = 24;
// 
//     public static final byte MSG_GETMENUITEM = 25;
//     public static final byte MSG_GETMENUITEM_RESP = 26;
// 
//     public static final byte MSG_GETALERT = 27;
//     public static final byte MSG_GETALERT_RESP = 28;
// 
//     public static final byte MSG_NAVIGATION = 29;
//     public static final byte MSG_NAVIGATION_RESP = 30;
// 
//     public static final byte MSG_SETSTATUSBAR = 33;
//     public static final byte MSG_SETSTATUSBAR_ACK = 34;
// 
//     public static final byte MSG_GETMENUITEMS = 35;
// 
//     public static final byte MSG_SETMENUSETTINGS = 36;
//     public static final byte MSG_SETMENUSETTINGS_ACK = 37;
// 
//     public static final byte MSG_GETTIME = 38;
//     public static final byte MSG_GETTIME_RESP = 39;
// 
//     public static final byte MSG_SETLED = 40;
//     public static final byte MSG_SETLED_ACK = 41;
// 
//     public static final byte MSG_SETVIBRATE = 42;
//     public static final byte MSG_SETVIBRATE_ACK = 43;
// 
//     public static final byte MSG_ACK = 44;
// 
//     public static final byte MSG_SETSCREENMODE = 64;
//     public static final byte MSG_SETSCREENMODE_ACK = 65;
// 
//     public static final byte MSG_GETSCREENMODE = 66;
//     public static final byte MSG_GETSCREENMODE_RESP = 67;
// 
//     public static final int DEVICESTATUS_OFF = 0;
//     public static final int DEVICESTATUS_ON = 1;
//     public static final int DEVICESTATUS_MENU = 2;
// 
//     public static final byte RESULT_OK = 0;
//     public static final byte RESULT_ERROR = 1;
//     public static final byte RESULT_OOM = 2;
//     public static final byte RESULT_EXIT = 3;
//     public static final byte RESULT_CANCEL = 4;
// 
//     public static final int NAVACTION_PRESS = 0;
//     public static final int NAVACTION_LONGPRESS = 1;
//     public static final int NAVACTION_DOUBLEPRESS = 2;
// 
//     public static final int NAVTYPE_UP = 0;
//     public static final int NAVTYPE_DOWN = 1;
//     public static final int NAVTYPE_LEFT = 2;
//     public static final int NAVTYPE_RIGHT = 3;
//     public static final int NAVTYPE_SELECT = 4;
//     public static final int NAVTYPE_MENUSELECT = 5;
// 
//     public static final int ALERTACTION_CURRENT = 0;
//     public static final int ALERTACTION_FIRST = 1;
//     public static final int ALERTACTION_LAST = 2;
//     public static final int ALERTACTION_NEXT = 3;
//     public static final int ALERTACTION_PREV = 4;
// 
//     public static final int BRIGHTNESS_OFF = 48;
//     public static final int BRIGHTNESS_DIM = 49;
//     public static final int BRIGHTNESS_MAX = 50;
// 
//     public static final String CLIENT_SOFTWARE_VERSION = "0.0.3";
// 
// }
// 
// Path: src/net/sourcewalker/olv/messages/UShort.java
// public class UShort {
// 
//     private int value;
// 
//     public short getValue() {
//         return (short) (value & 0xFFFF);
//     }
// 
//     public void setValue(short value) {
//         this.value = (int) (value & 0xFFFF);
//     }
// 
//     public UShort(short value) {
//         setValue(value);
//     }
// 
//     /*
//      * (non-Javadoc)
//      * @see java.lang.Object#toString()
//      */
//     @Override
//     public String toString() {
//         return Integer.toString(value);
//     }
// }


import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import net.sourcewalker.olv.messages.LiveViewCall;
import net.sourcewalker.olv.messages.MessageConstants;
import net.sourcewalker.olv.messages.UShort;
package net.sourcewalker.olv.messages.calls;



public class SetVibrate extends LiveViewCall {

    private final UShort delay;
    private final UShort time;

    public SetVibrate(int delay, int time) {
        super(MessageConstants.MSG_SETVIBRATE);
        this.delay = new UShort((short) delay);
        this.time = new UShort((short) time);
    }

    /*
     * (non-Javadoc)
     * @see net.sourcewalker.olv.messages.LiveViewRequest#getPayload()
     */
    @Override
// Path: src/net/sourcewalker/olv/messages/LiveViewCall.java
// public abstract class LiveViewCall extends LiveViewMessage {
// 
//     /**
//      * Header consists of two bytes and a int value (4 bytes).
//      */
//     private static final int HEADER_LENGTH = 6;
// 
//     public LiveViewCall(byte id) {
//         super(id);
//     }
// 
//     protected abstract byte[] getPayload();
// 
//     public byte[] getEncoded() {
//         byte[] payload = getPayload();
//         int msgLength = payload.length + HEADER_LENGTH;
//         ByteBuffer msgBuffer = ByteBuffer.allocate(msgLength);
//         msgBuffer.order(ByteOrder.BIG_ENDIAN);
//         msgBuffer.put(getId());
//         msgBuffer.put((byte) 4);
//         msgBuffer.putInt(payload.length);
//         msgBuffer.put(payload);
//         return msgBuffer.array();
//     }
// 
// }
// 
// Path: src/net/sourcewalker/olv/messages/MessageConstants.java
// public final class MessageConstants {
// 
//     public static final byte MSG_GETCAPS = 1;
//     public static final byte MSG_GETCAPS_RESP = 2;
// 
//     public static final byte MSG_DISPLAYTEXT = 3;
//     public static final byte MSG_DISPLAYTEXT_ACK = 4;
// 
//     public static final byte MSG_DISPLAYPANEL = 5;
//     public static final byte MSG_DISPLAYPANEL_ACK = 6;
// 
//     public static final byte MSG_DEVICESTATUS = 7;
//     public static final byte MSG_DEVICESTATUS_ACK = 8;
// 
//     public static final byte MSG_DISPLAYBITMAP = 19;
//     public static final byte MSG_DISPLAYBITMAP_ACK = 20;
// 
//     public static final byte MSG_CLEARDISPLAY = 21;
//     public static final byte MSG_CLEARDISPLAY_ACK = 22;
// 
//     public static final byte MSG_SETMENUSIZE = 23;
//     public static final byte MSG_SETMENUSIZE_ACK = 24;
// 
//     public static final byte MSG_GETMENUITEM = 25;
//     public static final byte MSG_GETMENUITEM_RESP = 26;
// 
//     public static final byte MSG_GETALERT = 27;
//     public static final byte MSG_GETALERT_RESP = 28;
// 
//     public static final byte MSG_NAVIGATION = 29;
//     public static final byte MSG_NAVIGATION_RESP = 30;
// 
//     public static final byte MSG_SETSTATUSBAR = 33;
//     public static final byte MSG_SETSTATUSBAR_ACK = 34;
// 
//     public static final byte MSG_GETMENUITEMS = 35;
// 
//     public static final byte MSG_SETMENUSETTINGS = 36;
//     public static final byte MSG_SETMENUSETTINGS_ACK = 37;
// 
//     public static final byte MSG_GETTIME = 38;
//     public static final byte MSG_GETTIME_RESP = 39;
// 
//     public static final byte MSG_SETLED = 40;
//     public static final byte MSG_SETLED_ACK = 41;
// 
//     public static final byte MSG_SETVIBRATE = 42;
//     public static final byte MSG_SETVIBRATE_ACK = 43;
// 
//     public static final byte MSG_ACK = 44;
// 
//     public static final byte MSG_SETSCREENMODE = 64;
//     public static final byte MSG_SETSCREENMODE_ACK = 65;
// 
//     public static final byte MSG_GETSCREENMODE = 66;
//     public static final byte MSG_GETSCREENMODE_RESP = 67;
// 
//     public static final int DEVICESTATUS_OFF = 0;
//     public static final int DEVICESTATUS_ON = 1;
//     public static final int DEVICESTATUS_MENU = 2;
// 
//     public static final byte RESULT_OK = 0;
//     public static final byte RESULT_ERROR = 1;
//     public static final byte RESULT_OOM = 2;
//     public static final byte RESULT_EXIT = 3;
//     public static final byte RESULT_CANCEL = 4;
// 
//     public static final int NAVACTION_PRESS = 0;
//     public static final int NAVACTION_LONGPRESS = 1;
//     public static final int NAVACTION_DOUBLEPRESS = 2;
// 
//     public static final int NAVTYPE_UP = 0;
//     public static final int NAVTYPE_DOWN = 1;
//     public static final int NAVTYPE_LEFT = 2;
//     public static final int NAVTYPE_RIGHT = 3;
//     public static final int NAVTYPE_SELECT = 4;
//     public static final int NAVTYPE_MENUSELECT = 5;
// 
//     public static final int ALERTACTION_CURRENT = 0;
//     public static final int ALERTACTION_FIRST = 1;
//     public static final int ALERTACTION_LAST = 2;
//     public static final int ALERTACTION_NEXT = 3;
//     public static final int ALERTACTION_PREV = 4;
// 
//     public static final int BRIGHTNESS_OFF = 48;
//     public static final int BRIGHTNESS_DIM = 49;
//     public static final int BRIGHTNESS_MAX = 50;
// 
//     public static final String CLIENT_SOFTWARE_VERSION = "0.0.3";
// 
// }
// 
// Path: src/net/sourcewalker/olv/messages/UShort.java
// public class UShort {
// 
//     private int value;
// 
//     public short getValue() {
//         return (short) (value & 0xFFFF);
//     }
// 
//     public void setValue(short value) {
//         this.value = (int) (value & 0xFFFF);
//     }
// 
//     public UShort(short value) {
//         setValue(value);
//     }
// 
//     /*
//      * (non-Javadoc)
//      * @see java.lang.Object#toString()
//      */
//     @Override
//     public String toString() {
//         return Integer.toString(value);
//     }
// }


// Path: src/net/sourcewalker/olv/messages/calls/SetVibrate.java
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import net.sourcewalker.olv.messages.LiveViewCall;
import net.sourcewalker.olv.messages.MessageConstants;
import net.sourcewalker.olv.messages.UShort;

package net.sourcewalker.olv.messages.calls;



public class SetVibrate extends LiveViewCall {

    private final UShort delay;
    private final UShort time;

    public SetVibrate(int delay, int time) {
        super(MessageConstants.MSG_SETVIBRATE);
        this.delay = new UShort((short) delay);
        this.time = new UShort((short) time);
    }

    /*
     * (non-Javadoc)
     * @see net.sourcewalker.olv.messages.LiveViewRequest#getPayload()
     */
    @Override
    protected byte[] getPayload() {