Solved

Port Addressing

Posted on 1998-11-14
3
191 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iSeries FTP Exit Program 8 171
maxBlock challenge 30 150
post4 challenge 28 121
Remove Password Protection from pdf (with password) using an command line executable 5 102
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Suggested Courses

737 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