[ntp:questions] Sure GPS: Programming it now works

unruh unruh at wormhole.physics.ubc.ca
Tue Apr 5 23:36:12 UTC 2011


On 2011-04-05, Terje Mathisen <"terje.mathisen at tmsw.no"> wrote:
> unruh wrote:
>> On 2011-04-05, Terje Mathisen<"terje.mathisen at tmsw.no">  wrote:
>>> I haven't tried without, and it does protect against some line errors,
>>> so why not?
>>
>> because if you are generating the lines by hand and sending it to the
>> chip via say minicom with the Y option, calculating the checksum is not
>> trivial. By the way is it everything between the $ and the * or does it
>> include the $ and *?
>
> I think I'll make a trivial addition to my little hack:
>
> An option to send an arbitrary command:
>
> Something like
>   -p port (default COM1)
>   -b baud (default 9600)
>   -s string (send $string*xxCRLF to mtk
>

Sounds useful. Of course if you were to make a full blown program out of
it, you would put in 20 pages of tables from which the user could select
the options they wanted, and then discover you have forgotten 10^5 of
them. Or as in this just let the user figure it out, and make the
string, which you program then sends. The second sounds more useful, and
could even eventually be the guts of the first.
KISS



>>
>>>
>>> The calculation is after all really trivial:
>>>
>>> 	len = strlen(buffer);
>>> 	// Add trailing '*' if missing:
>>> 	if (buffer[len-1] != '*')
>>> 		buffer[len++] = '*';
>>> 	// XOR sum of all bytes, except the first and last:
>>
>> OK, you are saying, omit the $ and *
>
> Right.
>
> Terje
>




More information about the questions mailing list