formatA7Data static method

List<int> formatA7Data(
  1. List<int> data
)

Format A7 data, remove CID, packet header, packet trailer and checksum

Implementation

static List<int> formatA7Data(List<int> data) {
  List<int> returnData = [];
  int startIndex = 4;
  //有包头, 2cid, 长度
  int two = data[3] & 0xFF;
  if (data.length >= (two + startIndex)) {
    returnData = data.sublist(startIndex, two + startIndex);
  }
  return returnData;
}