Important: The information in this document is obsolete and should not be used for new development.
Summary of the ADB Manager
Pascal Summary
Data Types
TYPE ADBDataBlock = PACKED RECORD devType: SignedByte; {device handler ID} origADBAddr: SignedByte; {default ADB address} dbServiceRtPtr: Ptr; {pointer to device handler} dbDataAreaAddr: Ptr; {pointer to data area} END; ADBDBlkPtr = ^ADBDataBlock; TYPE ADBSetInfoBlock = RECORD siServiceRtPtr: Ptr; {pointer to device handler} siDataAreaAddr: Ptr; {pointer to data area} END; ADBSInfoPtr = ^ADBSetInfoBlock; TYPE ADBOpBlock = RECORD dataBuffPtr: Ptr; {address of data buffer} opServiceRtPtr: Ptr; {pointer to device handler} opDataAreaPtr: Ptr; {pointer to optional data area} END; ADBOpBPtr = ^ADBOpBlock; ADBAddress = SignedByte;ADB Manager Routines
Initializing the ADB Manager
PROCEDURE ADBReInit;Communicating Through the ADB
FUNCTION ADBOp (data: Ptr; compRout: ProcPtr; buffer: Ptr; commandNum: Integer): OSErr;Getting ADB Device Information
FUNCTION CountADBs:Integer; FUNCTION GetIndADB (VAR info: ADBDataBlock; devTableIndex: Integer): ADBAddress; FUNCTION GetADBInfo (VAR info: ADBDataBlock; adbAddr: ADBAddress): OSErr;Setting ADB Device Information
FUNCTION SetADBInfo (VAR info: ADBSetInfoBlock; adbAddr: ADBAddress): OSErr;Application-Defined Routines
PROCEDURE MyDeviceHandler; PROCEDURE MyCompletionRoutine;C Summary
Data Types
typedef char ADBAddress; struct ADBDataBlock { char devType; /*device type*/ char origADBAddr; /*original ADB address*/ Ptr dbServiceRtPtr; /*pointer to device handler*/ Ptr dbDataAreaAdd; /*pointer to data area*/ }; typedef struct ADBDataBlock ADBDataBlock; typedef ADBDataBlock *ADBDBlkPtr; struct ADBSetInfoBlock { Ptr siServiceRtPtr; /*pointer to device handler*/ Ptr siDataAreaAddr; /*pointer to data area*/ }; typedef struct ADBSetInfoBlock ADBSetInfoBlock; typedef ADBSetInfoBlock *ADBSInfoPtr; struct ADBOpBlock { Ptr dataBuffPtr; /*address of data buffer*/ Ptr opServiceRtPtr; /*pointer to device handler*/ Ptr opDataAreaPtr; /*pointer to optional data area*/ }; typedef struct ADBOpBlock ADBOpBlock; typedef ADBOpBlock *ADBOpBPtr;ADB Manager Functions
Initializing the ADB Manager
pascal void ADBReInit(void);Communicating Through the ADB
pascal OSErr ADBOp (Ptr data, ProcPtr compRout, Ptr buffer, short commandNum);Getting ADB Device Information
pascal short CountADBs (void); pascal ADBAddress GetIndADB (ADBDataBlock *info, short devTableIndex); pascal OSErr GetADBInfo (ADBDataBlock *info, ADBAddress adbAddr);Setting ADB Device Information
pascal OSErr SetADBInfo (ADBSetInfoBlock *info, ADBAddress adbAddr);Application-Defined Functions
pascal void MyDeviceHandler (void); pascal void MyCompletionRoutine (void);Assembly-Language Summary
Data Structures
ADB Data Block
0 devType byte device type 1 origADBAddr byte original ADB address 2 dbServiceRtPtr long pointer to completion routine 6 dbDataAreaAddr long pointer to data area ADB Information Block
0 siServiceRtPtr long pointer to completion routine 4 siDataAreaAddr long pointer to data area ADB Operation Block
0 dataBuffPtr long address of data buffer 4 opServiceRtPtr long pointer to completion routine 8 opDataAreaPtr long pointer optional data area Trap Macros
Trap Macro Names
Pascal name Trap macro name ADBReInit _ADBReInit ADBOp _ADBOp CountADBs _CountADBs GetIndADB _GetIndADB GetADBInfo _GetADBInfo SetADBInfo _SetADBInfo Global Variables
JADBProc long Pointer to ADBReInit
preprocessing/postprocessing routine.KbdLast byte ADB address of the keyboard last used. KbdType byte Keyboard type of the keyboard last used. Result Codes
noErr
0 No error errADBop
-1 Unsuccessful completion