Solved

Port Addressing

Posted on 1998-11-14
3
187 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
ID: 1291581
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
ID: 1291582
Thank you Hansriet for your answer.  but what programming applications did you used?

0
 

Expert Comment

by:hansriet
ID: 1291583
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

911 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

19 Experts available now in Live!

Get 1:1 Help Now