0C001A0001000800030000010501000000800100001003103F002A00
The above Composition Data Page 0 can be described as follows:
0C00 1A00 0100 0800 0300 0001 05 01 0000 0080 0100 0010 0310 3F002A00
0x000C0x001A0x00010x00080x0003 – Relay and Friend features.0x0100510x0000, 0x8000, 0x0001, 0x1000, 0x100Note: The composition data is little-endian.
I know the usage of Arraybuffer and untyped arrays but confused about how to set offset according to extraction of different IDs and SIG Models. I have to make changes in this code (extracting first 4 IDs), particularly:
var string = "0123 4567 89AB";
var string1 = string.split(" ").join("");
var buf = new ArrayBuffer(string1.length/2);
var hex = new Uint16Array(buf)
for (var i=0, strLen=string1.length; i < strLen; i+=4){
hex[i/4] = 0
hex[i/4] += (parseInt(string1[i+0],16) << (4*1))
hex[i/4] += (parseInt(string1[i+1],16) << (4*0))
hex[i/4] += (parseInt(string1[i+2],16) << (4*3))
hex[i/4] += (parseInt(string1[i+3],16) << (4*2))
}
for (var i=0, strLen=string1.length; i < strLen/4; i++){
document.write("0x0" + hex[i].toString(16))
}