Solved

Port Addressing

Posted on 1998-11-14
3
193 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

726 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