/* Function: ExtResetSerialConnection ========================================== * Abstract: * Reset the connection with the target by initializing some global variables * and freeing/nulling all allocated memory. */ PRIVATE void ExtResetSerialConnection(void) { while (!isFIFOFreeEmpty()) { free(RemoveFIFOFree()); } while (!isFIFOPktEmpty()) { free(RemoveFIFOPkt()); } free(InBuffer->Buffer); memset(InBuffer, 0, sizeof(ExtSerialPacket)); free(OutBuffer->Buffer); memset(OutBuffer, 0, sizeof(ExtSerialPacket)); PktFIFOHead = PktFIFOTail = NULL; FreeFIFOHead = FreeFIFOTail = NULL; ExtClearSerialConnection(); } /* end ExtResetSerialConnection */
/* Function: ExtCloseConnection ================================================ * Abstract: * Called when the target needs to disconnect from the host (disconnect * procedure is initiated by the host). */ void ExtCloseConnection(ExtUserData *UD) { ExtClearSerialConnection(); } /* end ExtCloseConnection */