Static Public Member Functions
com.github.c77.base_driver.husky.HuskyBaseUtils Class Reference

List of all members.

Static Public Member Functions

static String byteArrayToString (byte[] data)
static char checkSum (byte[] cmdPackage)
static void main (String args[]) throws Exception
static void testChecksum (String inputString, String expectedSum) throws Exception

Detailed Description

Author:
jcerruti@creativa77.com (Julian Cerruti)

Definition at line 10 of file HuskyBaseUtils.java.


Member Function Documentation

static String com.github.c77.base_driver.husky.HuskyBaseUtils.byteArrayToString ( byte[]  data) [inline, static]

Definition at line 105 of file HuskyBaseUtils.java.

static char com.github.c77.base_driver.husky.HuskyBaseUtils.checkSum ( byte[]  cmdPackage) [inline, static]

Calculates the checksum of a given command package. It assumes the provided buffer has space for the checksum at the end (2 bytes) so those two bytes are not included in the checksum calculation

See Appendix A of "clearpath control protocol" doc,to understand how to implement it

  • Polynomial: x16+x12+x5+1 (0x1021)
  • Initial value: 0xFFFF
  • Check constant: 0x1D0F

Definition at line 22 of file HuskyBaseUtils.java.

static void com.github.c77.base_driver.husky.HuskyBaseUtils.main ( String  args[]) throws Exception [inline, static]

Allows running statically for very basic stand-alone testing

Definition at line 72 of file HuskyBaseUtils.java.

static void com.github.c77.base_driver.husky.HuskyBaseUtils.testChecksum ( String  inputString,
String  expectedSum 
) throws Exception [inline, static]

Definition at line 81 of file HuskyBaseUtils.java.


The documentation for this class was generated from the following file:


android_base_controller
Author(s):
autogenerated on Fri Aug 28 2015 10:04:47