I tried CAS12 and got no response. And $GNGGA continue to be output. I would expect it to stop for 30 seconds using:
>cas12();
$PCAS12,30*2D
=undefined
$
I'd like to try the CASIC commands @fanoush - do you know if they are supported ?
I tried these but not sure if I have got the checksum calculation correct, its not a simple XOR.
function prt() {
// CFG-PRT cc len id p
// --------- -------- --------- ----
print([0xBA,0xCE,0x00,0x00,0x06,0x00, 0x00, 0xd4,0x00,0x00,0x00]);
Serial1.write([0xBA,0xCE,0x00,0x00,0x06,0x00, 0x00, 0xd4,0x00,0x00,0x00]);
}
// ck = d4040000
function rate() {
// CFG-PRT cc len id p
// --------- -------- --------- ----
print([0xBA,0xCE,0x00,0x00,0x06,0x04, 0x00, 0xd4,0x04,0x00,0x00]);
Serial1.write([0xBA,0xCE,0x00,0x00,0x06,0x04, 0x00, 0xd4,0x04,0x00,0x00]);
}
So far I am trying simple commands with 0 payload as it means the checksum is easier to calculate.
I have written this bit of code to do the first part of the calculation.
function ck(id,len,pl) {
var clas = new Uint32Array(1);
var i = new Uint32Array(1);
var sum = new Uint32Array(1);
clas[0] = 0xBACE;
clas[0] = clas[0] << 24 ;
i[0] = id;
i[0] = i[0] << 16;
// len pl
sum[0] = clas[0] + i[0] + len + 0;
print(sum[0].toString(16));
}
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I tried
CAS12
and got no response. And $GNGGA continue to be output. I would expect it to stop for 30 seconds using:I'd like to try the CASIC commands @fanoush - do you know if they are supported ?
I tried these but not sure if I have got the checksum calculation correct, its not a simple XOR.
So far I am trying simple commands with 0 payload as it means the checksum is easier to calculate.
I have written this bit of code to do the first part of the calculation.