toCmd method

HLSender toCmd()

Implementation

HLSender toCmd(){
  if (length >= 3) {
    final entry = this[1];
    int pid = -1;
    if (entry == 0xe5) {
      pid = this[2];
    }else if(entry == 0xe6){
      pid = this[6];
    }
    return HLSender(entry: entry, datas: Uint8List.fromList(sublist(2)), pid: pid);
  }if (length >= 2) {
    return HLSender(entry: this[1], datas: Uint8List.fromList(sublist(2)), pid: -1);
  }else{
    return HLSender(entry: 0, datas: Uint8List.fromList([]), pid: -1);
  }
}