(Page 1 of 1 in this chapter)


Chapter 1

About the AGM Library


1.1 Introduction
1.2 About the AGM Library
1.3 AGM Handles
1.4 The AG Configuration File
1.5 Mux Handles
1.6 Error Handlers

1.1 Introduction

This chapter describes the AGM library and introduces the following concepts:

1.2 About the AGM Library

The AGM library provides an application program interface (API) for initializing and monitoring AG boards.

With the AGM library, you can create a program that:

In addition, the AGM library provides interfaces for specifying diagnostic levels, and logging errors and other information. Because the library is designed to be used by system services as well as by user applications, its functions do not perform any console input or output directly (although the application's
error-handler may do so).

Note: The agmon utility shipped with CT Access, which loads and monitors AG boards, is built with functions from the AGM library.

1.3 AGM Handles

The AGM library functions work within a processing context that contains board configuration and status information. This processing context (AGM context) is identified by an AGM handle.

Except for the few functions that operate independently of this processing context, every AGM library function requires a valid AGM handle.

1.4 The AG Configuration File

The AG configuration file, typically named ag.cfg, contains information used for configuring the boards on a system. The name of this file is one of the arguments of agmOpen, which reads it to initialize the context it creates. Other AGM library functions use this information for the board addresses, finding the names of the files to download to the board, etc.

The form and content of this file is described in the AG Runtime Configuration and Developer's Manual.

1.5 Mux Handles

One of the values returned by agmOpenDriver is a mux handle. A mux handle is a wait object of the preferred type for the specific operating system. (Under Windows NT, it is a WaitObject; under UNIX, it is a file descriptor.)

This mux handle is used by the operating system to convey to the application that there is a message available from the underlying AG driver. This is how the library notifies the application that there is a message pending. The message can then be fetched with agmGetAGMessage.

1.6 Error Handlers

One of the agmOpen arguments is a pointer to a callback function, which is to be used as an error handler. The callback function is called by the library to report errors, warnings, and information that cannot be communicated by return codes. The error handler is called with a code specifying whether the condition is an error, a warning, or purely informational, and a text string describing the condition.

Note: If an error can be expressed by a return code, then the error handler is not called.



(Page 1 of 1 in this chapter)


tech_support@nmss.com
Copyright © 1998, Natural MicroSystems, Inc. All rights reserved.