Show
Ignore:
Timestamp:
08/11/08 18:14:49 (5 months ago)
Author:
liamstask
Message:

- in XBee_GetPacket, reset the parser state if we get an insane length

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • firmware/trunk/libraries/xbee/xbee.c

    r792 r811  
    247247          packet->length += newChar; 
    248248          if( packet->length > XBEE_MAX_PACKET_SIZE ) // in case we somehow get some garbage 
    249             packet->length = XBEE_MAX_PACKET_SIZE; 
    250           packet->rxState = XBEE_PACKET_RX_PAYLOAD; 
     249            packet->rxState = XBEE_PACKET_RX_START; 
     250          else 
     251            packet->rxState = XBEE_PACKET_RX_PAYLOAD; 
    251252          break; 
    252253        case XBEE_PACKET_RX_PAYLOAD: 
     
    437438  @param params A pointer to the buffer containing the data to be sent. 
    438439  @param datalength The number of bytes to send from the params buffer. 
    439   @return An integer specifying the active state - 1 (active) or 0 (inactive). 
    440440   
    441441  \par Example - Writing