COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	Copyright (c) Geoworks 1996.  All rights reserved.

PROJECT:	
MODULE:		
FILE:		dtconn.def

AUTHOR:		Robert Greenwalt, Dec 10, 1996

MACROS:
	Name			Description
	----			-----------

REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	robertg	12/10/96   	Initial revision

DESCRIPTION:

	
		
	$Id: dtconn.def,v 1.1 97/04/04 14:27:05 newdeal Exp $

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@

SetDef __DTCONN

StartLibrary	dtconn

include datax.def
include pccom.def
;---------------------------------------------------------------------------
; 		Enumerated Types
;--------------------------------------------------------------------------

DTCReturnType			etype	word, 0
	DTCRT_NO_ERROR		enum	DTCReturnType
	DTCRT_BUSY		enum	DTCReturnType
	DTCRT_NOT_CONNECTED	enum	DTCReturnType
	DTCRT_MEM_ALL_ERROR	enum	DTCReturnType

DTCConnectionType 		etype 	byte
	DTCCT_SERIAL		enum	DTCConnectionType
	DTCCT_IR		enum	DTCConnectionType

DTCConnectionStatus		etype 	word, 0
	DTCCS_CONNECTING	enum	DTCConnectionStatus
	DTCCS_CONNECTED		enum	DTCConnectionStatus
	DTCCS_CONNECT_FAILED	enum	DTCConnectionStatus
	DTCCS_DISCONNECTING	enum	DTCConnectionStatus
	DTCCS_DISCONNECTED	enum	DTCConnectionStatus
	DTCCS_DISCONNECT_FAILED	enum	DTCConnectionStatus
	DTCCS_PIPE_OPENING	enum	DTCConnectionStatus
	DTCCS_PIPE_OPENED	enum	DTCConnectionStatus
	DTCCS_PIPE_OPEN_FAILED	enum	DTCConnectionStatus
	DTCCS_PIPE_CLOSING	enum	DTCConnectionStatus
	DTCCS_PIPE_CLOSED	enum	DTCConnectionStatus
	DTCCS_PIPE_CLOSE_FAILED	enum	DTCConnectionStatus

;----------------------------------------------------------------------------
;		Structures
;----------------------------------------------------------------------------
;
; PCCom <----> DTConnect Interface Header
;
PCComDataPipeHeader struct
	PDPH_dataPipeSignature	dword
	PDPH_infoWord		DXInfoWord
	PDPH_miscInfo		dword
	PDPH_bufferSize		word
	PDPH_flags		DXFlags
	pad			word
	PDPH_data		label byte
PCComDataPipeHeader ends

;
; PCComDevice ID Response Structure
;
PCComDeviceIDResponse	struct
	PDIR_protoMajor		word
	PDIR_protoMinor		word
	PDIR_deviceID		dword
PCComDeviceIDResponse 	ends
		
;---------------------------------------------------------------------------
;		Class Definitions
;---------------------------------------------------------------------------
;
DTCApplicationClass	class	DataXApplicationClass

MSG_DTCA_INCOMING_DATA	message
;
;
; Context:	Called by PCCom to notify incoming data
; Source:	PCCom
; Destination:  DTCApplicationClass object
; Interception: Shouldn't be intercepted
;
; Pass:
;			
; Return:
;
;	- unchanged
;	- destroyed
;

MSG_DTCA_OUTGOING_DATA	message
;
;
; Context:	Sent when there is outgoing data waiting to go to PCCom
; Source:	Generally someone in the application, not external
; Destination:  DTCApplicationClass object
; Interception: Shouldn't be intercepted
;
; Pass:
;			
; Return:
;
;	- unchanged
;	- destroyed
;

MSG_DTCA_OPEN_CONNECTION	message
;
;
; Context:	Sent to initiate a PCCom connection
; Source:	anybody, generally application sends this to itself to
; 		initiate a connection
; Destination:  DTCApplicationClass object
; Interception: Shouldn't be intercepted
;
; Pass:
;			
; Return:
;
;	- unchanged
;	- destroyed
;

MSG_DTCA_CLOSE_CONNECTION	message
;
;
; Context:	Sent to close a PCCom connection
; Source:	anybody, generally application sends this to itself to
;	        terminate a connection it initiated via 
;		MSG_DTCA_OPEN_CONNECTION
; Destination:  DTCApplicationClass object
; Interception: Shouldn't be intercepted
;
; Pass:
;			
; Return:
;
;	- unchanged
;	- destroyed
;

MSG_DTCA_SHUTDOWN	message
;
;
; Context:	Send this to terminate the pipe if one has been initiated
; Source:	anybody, generally from within the application
; Destination:  DTCApplicationClass object
; Interception: Shouldn't be intercepted
;
; Pass:
;			
; Return:
;
;	- unchanged
;	- destroyed
;

MSG_DTCA_CONNECTION_STATUS	message
;
;
; Context:	Sent to update about status of the connection
; 		library's activities. 
; Source:	DTConn library
; Destination:  DTCApplicationClass object
; Interception: Intercept to receive asynchronous status messages
; 		concerning the connection.
;
; Pass:
;			
; Return:
;
;	- unchanged
;	- destroyed
;


;
; instance data
;

	customDataBlockHandle	hptr

DTCApplicationClass	endc


;
; Exported Routines
;

global	DTConnConnect:far
;
; Desc:		Start listening to the port.  Don't know if anyone's
; 		out there, but we might as well.
;
;		Returns immediately.
;
;		pass 	a notification optr
;			a notification msg
;			a connection type
;			a baud rate
;
;		returns	a DTCReturnType
;

global	DTConnDisconnect:far
;
; Desc:		stop listening to the port.  Abort if needed.
;
;		Returns when disconnected
;
;		pass	nothing
;
;		return	a DTCReturnType
;
EndLibrary	dtconn







