Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Compiling and uploading a crontab to my Radioduino

by jwkrahn (Abbot)
on May 30, 2021 at 01:27 UTC ( [id://11133282]=note: print w/replies, xml ) Need Help??


in reply to Compiling and uploading a crontab to my Radioduino

From GSPSupport.pm (frame2packet):

for my $byte ( @frame ) { my $lowbyte = ( $byte & 0x0f ) + 65; my $highbyte = ( $byte >> 4 ) + 65;

I tested this subroutine with numbers ranging from 0 to 9,999,999,999 and I can tell you two things.

1) $lowbyte is not a byte, it only has four bits. It is a nibble.

2) $highbyte is not a byte as it can contain any value above 255 (0xFF).

Replies are listed 'Best First'.
Re^2: Compiling and uploading a crontab to my Radioduino
by cavac (Parson) on May 30, 2021 at 09:56 UTC

    Oh, yes. It's badly named. This function actually turns the bytes (which ARE bytes) from the binary packet frame into "cavac-encoded" half-bytes for serial transmission.

    So, $highbyte (which should actually be $highnibble or something) can't go over 255).

    The reason i'm using this encoding is because it's dead simple to turn it back into real bytes, while allowing proper framing for transmitting over serial.

    perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11133282]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-23 18:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found