Android Open Source - base_controller Husky Packet

From Project

Back to project page base_controller.


The source code is released under:

Apache License

If you think the Android project base_controller 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 com.github.c77.base_driver.husky;
//  www  .j  a  v a  2  s.  c  o  m
import org.apache.commons.codec.binary.Hex;

* @author (Julian Cerruti)
public class HuskyPacket {
    public static final char TYPE_ENCODER_DATA = (char)0x8800;
    public static final char TYPE_ENCODER_DATA_RAW = (char)0x8801;

    byte soh;
    byte length;
    byte lengthComplement;
    byte version;
    int timestamp;
    byte flags;
    char messageType;
    byte stx;
    byte[] payload;
    char checksum;

    public byte getLength() {
        return length;

    public int getTimestamp() {
        return timestamp;

    public byte getFlags() {
        return flags;

    public byte[] getPayload() {
        return payload;

    public char getMessageType() {
        return messageType;

    public byte getVersion() {
        return version;

    public String toString() {
        return "HuskyPacket{" +
            Integer.toHexString(messageType) + ":" +
            new String(Hex.encodeHex(payload)) +

Java Source Code List