4 package com.neuronrobotics.sdk.bootloader;
6 import java.io.IOException;
7 import java.util.ArrayList;
9 import com.neuronrobotics.sdk.common.ByteList;
23 ArrayList<ByteData> packetList =
new ArrayList<ByteData>();
29 private long base = 0x1D00A000L;
32 private long head = 0x1D01FFFFL;
40 public static String
hex(
long n) {
42 return String.format(
"0x%8s", Long.toHexString(n)).replace(
' ',
'0');
53 if(currentAddress>
head ){
54 throw new RuntimeException(
"Address "+
hex(currentAddress)+
" is larger than "+
hex(
head));
56 if(currentAddress<
base){
57 throw new RuntimeException(
"Address "+
hex(currentAddress)+
" is less than "+
hex(
base));
75 long endOfLastAddress = 0;
77 if (l.getRecordType()==4){
81 }
if (l.getRecordType()==0){
86 currentAddress=l.getStartAddress();
88 if (previousLine !=
null){
91 boolean isSequential = (currentAddress==(endOfLastAddress));
96 if(!isSequential||(tmp.
getData().length > 50)){
101 for (
byte b : l.getDataBytes()){
103 if(!isSequential||(tmp.
getData().length == 128)){
131 return packetList.size();
141 return packetList.get((
int)
dataIndex++);
void checkAddressValidity(long currentAddress, NRBootCoreType type)
static String hex(long n)
IntelHexParser(ArrayList< hexLine > lines, NRBootCoreType type)
static final int convertToInt(byte[] b)