Android Open Source - BluetoothHidEmu Hid Consumer Payload






From Project

Back to project page BluetoothHidEmu.

License

The source code is released under:

Apache License

If you think the Android project BluetoothHidEmu listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package andraus.bluetoothhidemu.sock.payload;
/*  ww  w .  ja va  2  s. c  om*/

public class HidConsumerPayload extends HidPayload {
    
    private static final int SIZE = 5;
    private static final int REPORT_ID_CONSUMER = 0x03;
    
    private static final int[] USAGE_NULL = { 0x00, 0x00, 0x00 };
    public static final int[] USAGE_MEDIA_PLAY_PAUSE = { 0x00, 0x04, 0x00 };
    public static final int[] USAGE_MEDIA_STOP = { 0x00, 0x08, 0x00 };
    public static final int[] USAGE_MEDIA_PREV = { 0x00, 0x02, 0x00 };
    public static final int[] USAGE_MEDIA_NEXT = { 0x00, 0x01, 0x00 };
    public static final int[] USAGE_MEDIA_CALL_PLAYER = { 0x00, 0x10, 0x00 };
    
    /**
     * 
     */
    public HidConsumerPayload() {
        super(SIZE);
        
        mPayload[0] = (byte)0xa1;
        mPayload[1] = (byte)REPORT_ID_CONSUMER;         // report_id
        mPayload[2] = (byte)0x00;                       // usage_id (bits 7 - 0)
        mPayload[3] = (byte)0x00;                       // numeric keypad (bits 7 - 4 ) | usage_id (bits 11 - 8)
        mPayload[4] = (byte)0x00;
        
    }
    
    /**
     * 
     * @param usage_low
     * @param usage_high
     */
    public void assemble(int[] usage) {
        
        if (usage.length == 3) {
            mPayload[2] = (byte)usage[0];
            mPayload[3] = (byte)usage[1];
            mPayload[4] = (byte)usage[2];
        }
    }
    
    /**
     * 
     */
    @Override
    public void resetBytes() {
        assemble(USAGE_NULL);
    }

}




Java Source Code List

andraus.bluetoothhidemu.BluetoothHidEmuActivity.java
andraus.bluetoothhidemu.ButtonClickListener.java
andraus.bluetoothhidemu.Constants.java
andraus.bluetoothhidemu.KeyboardKeyListener.java
andraus.bluetoothhidemu.KeyboardTextWatcher.java
andraus.bluetoothhidemu.SpecialKeyListener.java
andraus.bluetoothhidemu.TouchpadListener.java
andraus.bluetoothhidemu.settings.BluetoothAdapterStateReceiver.java
andraus.bluetoothhidemu.settings.BluetoothDeviceStateReceiver.java
andraus.bluetoothhidemu.settings.Settings.java
andraus.bluetoothhidemu.sock.BluetoothSocketThread.java
andraus.bluetoothhidemu.sock.SocketManager.java
andraus.bluetoothhidemu.sock.payload.HidConsumerPayload.java
andraus.bluetoothhidemu.sock.payload.HidKeyPair.java
andraus.bluetoothhidemu.sock.payload.HidKeyboardPayload.java
andraus.bluetoothhidemu.sock.payload.HidPayload.java
andraus.bluetoothhidemu.sock.payload.HidPointerPayload.java
andraus.bluetoothhidemu.sock.payload.HidSixaxisPayload.java
andraus.bluetoothhidemu.spoof.BluetoothAdapterSpooferFactory.java
andraus.bluetoothhidemu.spoof.BluetoothAdapterSpooferGeneric.java
andraus.bluetoothhidemu.spoof.BluetoothAdapterSpooferMotoReflect.java
andraus.bluetoothhidemu.spoof.BluetoothAdapterSpooferMoto.java
andraus.bluetoothhidemu.spoof.BluetoothAdapterSpoofer.java
andraus.bluetoothhidemu.spoof.CleanupExceptionHandler.java
andraus.bluetoothhidemu.spoof.Spoof.java
andraus.bluetoothhidemu.spoof.jni.BluetoothSocketJni.java
andraus.bluetoothhidemu.ui.GenericUiControls.java
andraus.bluetoothhidemu.ui.Ps3KeypadUiControls.java
andraus.bluetoothhidemu.ui.UiControls.java
andraus.bluetoothhidemu.util.DoLog.java
andraus.bluetoothhidemu.view.ArrowButton.java
andraus.bluetoothhidemu.view.BluetoothDeviceArrayAdapter.java
andraus.bluetoothhidemu.view.BluetoothDeviceView.java
andraus.bluetoothhidemu.view.EchoEditText.java
andraus.bluetoothhidemu.view.ViewUtils.java