/*
 *  TICommon_API.h
 *  TICommon
 *
 *  Created by Stephen L. Reid on Tue Dec 03 2002.
 *  Copyright (c) 2002-2003 Texas Instruments Incorporated. All rights reserved.
 *
 *	Last modification: 7 May 2003 -slr : Add MyTI_FireReadTimeoutTimer
 */

Boolean 	IsFlashObject( UInt8 typeCode );
IOReturn	FlashErrorDecode( UInt8 incoming );
void 		MyTI_GetFolderName( TIObject *myObject, UInt8 *nameBuffer );
void 		MyTI_GetObjectName( TIObject *myObject, UInt8 *nameBuffer );
void 		CalculateAndStoreChecksum( unsigned char *theBuffer, long startIndex, long theLength );
void		ClearMem( UInt8 * inObject, long sizeObject );
void		MoveMem( UInt8 * destination, UInt8 * source, long sizeObject );
void 		SetMemToOne( UInt8 *buffer, Size theSize );
void 		MyTI_Free( UInt8 *inDir );
IOReturn 	MyTI_CheckPipe( TICommunicationsParmBlock *inPB, Boolean inPipe );
void 		MyTI_TimeoutTimerCallback( CFRunLoopTimerRef timer, void *pb );
void 		MyTI_CreateReadTimeoutTimer( void *pb, double timeoutInterval );
void 		MyTI_FireReadTimeoutTimer( void *pb );
void 		QueueReadRequest( TICommunicationsParmBlock *inPB, long nDataTimeout, long nTransactionTimeout, IOAsyncCallback1 ReceiverCallBack );

void		MyTI_CommonDelay( double delayTime );
void 		MyTI_GenerateUniqueIDValue( TICommunicationsParmBlock *pb, char *outBuffer );

IOReturn 	MyTI_QueueRead( TICommunicationsParmBlock *inPB, IOAsyncCallback1 ReceiverCallBack );
IOReturn 	MyTI_QueueReadTO( TICommunicationsParmBlock *inPB, long nDataTimeout, long nCompletionTimeout, IOAsyncCallback1 ReceiverCallBack );
IOReturn 	MyTI_QueueWrite( TICommunicationsParmBlock *inPB, IOAsyncCallback1 SenderCallBack );
IOReturn 	MyTI_QueueWriteTO( TICommunicationsParmBlock *inPB, long nDataTimeout, long nTransTimeout, IOAsyncCallback1 SenderCallBack );

IOReturn 	MyTI_AbortQueuedRead( TICommunicationsParmBlock *inPB );
IOReturn 	TranslateDataTypeToEnumeration(  UInt32 inDescriptor );

// replacements that use newer API's for older deprecated APIs.  still uses older API's on pre
// 10.4 systems.
OSErr		MyTI_LongDateToSeconds( const LongDateRec *theTimeRecord, LongDateTime *theSeconds );
OSErr		MyTI_LongSecondsToDate( LongDateTime *theSeconds, LongDateRec *theTimeRecord );




