MityDSP Documentation Index

MityDSP::tcDspParseIHex Class Reference

Instances of this class may be used to parse an Intel HEX file into an application-provided buffer. More...

#include <core/DspParseIHex.h>

Inheritance diagram for MityDSP::tcDspParseIHex:
MityDSP::tcDspParserBase

List of all members.

Public Member Functions

 tcDspParseIHex (void *apOutBuf=NULL, int anOutBufLen=4096)
 This constructor is used to create an instance of an Intel HEX record parser.
 ~tcDspParseIHex ()
 This destructor is used to close up and free the resources tied to the associated parser.
bool ResetParser (void *apOutBuf=NULL, int anOutBufLen=0)
 This routine is used to reset a parser to an initialized state.
int AddData (void *apData, int anLength)
 This routine is used to add data to the parser.
void DisableOutput (bool abDisable)
 This method allows writing to the output buffer to be disabled (for instance, when performing only a validation of a file).
void ResetOutputBuffer (char anBlank)
 This method clears the output buffer using the provided character.

Detailed Description

Instances of this class may be used to parse an Intel HEX file into an application-provided buffer.

See also:
tcDspParseIHex Page

Constructor & Destructor Documentation

tcDspParseIHex::tcDspParseIHex ( void *  apOutBuf = NULL,
int  anOutBufLen = 4096 
)

This constructor is used to create an instance of an Intel HEX record parser.

Storage for parser output, and the maximum size of the output, may be optionally provided. If no buffer is provided, the class attempts to create one.

Parameters:
[in] apOutBuf - Address of parser output buffer (default: NULL)
[in] anOutBufLen - Lngth of output buffer (default: 4K)
Returns:
None.
See also:
DspParseIHex.h
tcDspParseIHex::~tcDspParseIHex (  ) 

This destructor is used to close up and free the resources tied to the associated parser.

Returns:
None.
See also:
DspParseIHex.h

Member Function Documentation

bool tcDspParseIHex::ResetParser ( void *  apOutBuf = NULL,
int  anOutBufLen = 0 
) [virtual]

This routine is used to reset a parser to an initialized state.

A new output buffer may optionally be provided.

Parameters:
[in] apOutBuf - Address of new parser output buffer (default: NULL)
[in] anOutBufLen - Length of new output buffer (default: 0)
Returns:
True, if successful.
See also:
DspParseIHex.h

Reimplemented from MityDSP::tcDspParserBase.

int tcDspParseIHex::AddData ( void *  apData,
int  anLength 
) [virtual]

This routine is used to add data to the parser.

In this class, the parse finds a start record, and then decodes data records, until an end record is reached. At this point the registered callback is activated with a status of eeParseOK.

Errors are generated if the start record is not found when expected, if any of the decoded data falls outside the provided output buffer, or if any of the individual record checksums are incorrect.

A running 32-bit checksum is maintained for the entire file, and is passed to the callback upon completion.

Parameters:
[in] apData - Pointer to new data
[in] anLength - Length of new data
Returns:
Integer number of messages completed this call.
See also:
DspParseIHex.h

Reimplemented from MityDSP::tcDspParserBase.

void tcDspParseIHex::DisableOutput ( bool  abDisable  ) 

This method allows writing to the output buffer to be disabled (for instance, when performing only a validation of a file).

Parameters:
[in] abDisable True to disable writing to the output buffer.
Returns:
None.
See also:
DspParseIHex.h
void tcDspParseIHex::ResetOutputBuffer ( char  anBlank  ) 

This method clears the output buffer using the provided character.

Parameters:
[in] anBlank The character to use to clear the buffer.
Returns:
None.
See also:
DspParseIHex.h

  
Generated on Fri Sep 23 16:33:52 2011 for MityDSP Core by  Doxygen Version 1.6.1
Copyright © 2009, Critical Link LLC, All rights reserved.