Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Doing NMEA command sequences with zsh ... ??!!



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 13.10.2014 21:58, meino.cramer@xxxxxx wrote:
> Hi,
> 
> To my embedded system (which runs zsh on Gentoo Linux ;) ) I have atteched an GPS receiver
> chip. This chip spits out NMEA sentences to an UART and is capable of receiving NMEA command
> seqyences.
> 
> An NMEA command sequence consist of $<commandname><parameter,nextparameter,....><*><checksum>
> 
> The checksum is the binary XOR of all characters between '$' and '*'. This checksum is given a
> an hexadecimal number.
> 
> Since it is an embedded system, I would prefer to calculate this checksum with zsh only since
> it already runs if I am logged in.
> 
> Is that possible in any way?
> 
> Thank you very much in advance for any help! Best regards, mcc

Not digging deep into NMEA stuff, only some related hints:

% integer a b; a=16#e7; b=16#3c; print $(([#16]a^b));
16#DB

% c='abcABC'; for i in ${(s..)c}; do print $((#i)); done
97
98
99
65
66
67




- -- 
Regards,
  Vasiliy Ivanov <beelzebubbie.logs@xxxxxxxxx>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJUPAuYAAoJEAnDj7eK12hqw4kH/01EFxLtISDFEdWXL1yP0D7v
tUOi0WZGWhAqPSJ+q+cgpXXnUePGQsQ/phNjikex/S2GyG2MyyWj0e20gN1CLd4R
nIwWdKiLwOsRA3uSgcKDl9APqGyrzwDiDIYBRu6/jbFqSYcmZ0xhc4ekPMlwdYxW
mWGimIUIUtx7XqZpWz+hAwxgB7Bfc+Ur2xmJEs0Y7/9nxqmWEUWeG/bV1W4KLpLn
svZ1fcSih9sPHwgs6dtqDspw4THUlHp2rhTpqqvo6G1qLh4MTxGigqBrZnXaIrps
eg2VUjYrk+R6UmmFmpVXeqeZcLeQxN4GUab3xx+EUFTcViCa7OFtl84Xk72tu2k=
=DWl7
-----END PGP SIGNATURE-----



Messages sorted by: Reverse Date, Date, Thread, Author