mikep
Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX
|
|
Posted: 06 January 2007, 19:41 PM Post subject: Suggestion for New API - CRC |
|
|
With all of this recent discussion on calculations of CRC for Modbus and Don's previously posted code for CRC calculations, it seems to make sense to have ZBasic functions that calculate the CRC-16 or CRC-32 for a data buffer. This is a common enough function that would benefit from a VM implementation.
The parameters could include the data buffer, length of data, CRC polynominal, initial CRC value etc.
Alternatively or in addition you could provide constants for the common models and add Modbus to the list. The compiler can expand these models out to VM system functions that implement the "Rocksoft" model. |
|