Solved

Port Addressing

Posted on 1998-11-14
3
186 Views
Last Modified: 2013-12-26
I need to know the hex number for addressing the communications ports and how to address the SCSI port
0
Comment
Question by:jmcalle
  • 2
3 Comments
 

Accepted Solution

by:
hansriet earned 100 total points
Comment Utility
The SCSI port(s) should be addressed via the SCSI Manager in the Apple Toolbox. This is the safest way to program.
Find the details in the OS_Utils.sit.hqx file on http://www.apple.com/developer/

The same is true for palying around with the serial ports (ADB/printer/modem/USB). Access them via toolbox routines and your code will be safe in the future.
See the ADB manager, PPC manager, AppleTalk manager, Communication Toolbox etc.

Get Inside Macintosh either online, on CD ROM or the old fashioned paperbacks, though they may be a bit outdated.
0
 

Author Comment

by:jmcalle
Comment Utility
Thank you Hansriet for your answer.  but what programming applications did you used?

0
 

Expert Comment

by:hansriet
Comment Utility
I use Metrowerks CodeWarrior Pro3, the languages I use are C and C++.

Here's some code to find serial ports:

#include <CommResources.h>
#include <CRMSerialDevices.h>

#include <stdio.h>

main()
{
    CRMRec      c;
    CRMRecPtr   cPtr = &c;
    CRMSerialPtr    serialPtr;

    printf("Listing of available serial ports\n");
    InitCRM();

    c.crmDeviceType = crmSerialDevice;
    c.crmDeviceID   = 0;
    while (cPtr != nil) {
        cPtr = (CRMRecPtr)CRMSearch((QElemPtr)cPtr);
        if (cPtr) {
            serialPtr = (CRMSerialPtr)cPtr->crmAttributes;
            printf("We have a port called: %#s\n", *(serialPtr->name));
            printf("   input driver named: %#s\n", *(serialPtr->inputDriverName));
            printf("  output driver named: %#s\n\n", *(serialPtr->outputDriverName));
            c.crmDeviceID = cPtr->crmDeviceID;
        }
    }
}

0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now