[Tinyos Core WG] CRC interface

Philip Levis pal at cs.stanford.edu
Tue Sep 25 21:05:50 PDT 2007


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