zsh-users
 help / color / mirror / code / Atom feed
From: Vasiliy Ivanov <beelzebubbie.logs@gmail.com>
To: meino.cramer@gmx.de
Cc: zsh-users@zsh.org
Subject: Re: Doing NMEA command sequences with zsh ... ??!!
Date: Mon, 13 Oct 2014 23:27:52 +0600	[thread overview]
Message-ID: <543C0B98.2080504@gmail.com> (raw)
In-Reply-To: <20141013155806.GA3825@solfire>

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

On 13.10.2014 21:58, meino.cramer@gmx.de 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@gmail.com>
-----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-----


  reply	other threads:[~2014-10-13 17:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-13 15:58 meino.cramer
2014-10-13 17:27 ` Vasiliy Ivanov [this message]
2014-10-14  3:02   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=543C0B98.2080504@gmail.com \
    --to=beelzebubbie.logs@gmail.com \
    --cc=meino.cramer@gmx.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).