[Tinyos Core WG] CRC interface

David Moss dmm at rincon.com
Tue Sep 25 21:31:45 PDT 2007


Yes, crc16(a, b) is just a call to (may I suggest per Kevin's comment...)
seededCrc16(0, a, b).  The seeded CRC is a more abstract case of the
crc16(a, b) function.

-David




-----Original Message-----
From: Philip Levis [mailto:pal at cs.stanford.edu] 
Sent: Tuesday, September 25, 2007 9:06 PM
To: David Moss
Cc: 'TinyOS Core WG'
Subject: Re: [Tinyos Core WG] CRC interface

On Sep 25, 2007, at 6:40 PM, David Moss wrote:

> The current CRC interface in TinyOS does not allow CRC's to be  
> generated starting with some given CRC value; instead, it uses a  
> seed of 0 for all CRC computations:
>
>
>
>   (tos/interfaces/CRC.h):
>
>   command uint16_t crc16(void* buf, uint8_t len);
>
>
>
> I propose we add an additional command to this CRC interface that  
> will allow developers to generate a CRC with a given start seed:
>
>
>
>   command uint16_t genericCrc16(uint16_t startCrc, void *buf,  
> uint8_t len);
>
>
>
> This would be useful for performing CRC's across multiple sets of  
> discontinuous data, and would use the same CRC implementation as  
> the current crc16 command so memory footprint is kept small.   
> Thoughts?
>
>

Makes sense to me. I'd suggest crc16_seeded rather than genericCrc16,  
though. I assume crc16(a, b) is just a call to crc16_seeded(0, a, b)?

Phil




More information about the Tinyos-2.0wg mailing list