The Cascade Driver implements a mechanism for error reporting that provides as much information as possible from the different product components and layers. Errors can originate from any of the following:
The Cogent API calls made by the user's application, as a result of parameter checks performed within the API functions.
The device driver.
Other products connected to the driver, such as the Cascade DataHub
The QNX or C-library function calls made by the driver or user's application.
To accomplish this, errors from each of these sources are encoded in groups, to ensure that there can be no ambiguity as to the error source. A base error group number in the thousands (1000-9999) is added to the specific error. For example, all errors generated by the driver are in the range 5001-5999. The following list describes the error categories (see Summary of Reported Errors in the appendices, and the Cogent API header file dr_api.h for a complete list of errors):
DR_API_ERRORS group: errors generated by the API functions.
DR_API_ADMIN_ERRORS group: errors generated by the driver.
DR_API_STATUS_ERRORS group: errors generated by the driver or API that are non-subsystem specific statuses. The specific error can be interpreted with reference to the ST_STATUS group of errors.
DR_API_IPC_ERRORS group: errors generated by the interprocess communication subsystem within the driver or API. The specific error can be interpreted with reference to the ST_STATUS group of errors..
All other errors (below 1000): QNX and C-library errors are left unmodified.
Most error sources have an associated table of error descriptions for their group of errors. This is referenced by the API functions to return the appropriate error-string (where available as a parameter).
Errors originating in the driver in many cases provide even more detail, specifying the particular parameter values that caused the error. Driver errors are transferred using the error command format:
(error error_string)
where error_string is as follows:
"error_source error_number (error_time) error_description"
and where:
The module/function generating the error.
The error_code described above.
The time of the error, formatted as yymmdd@hh:mm:ss.
The remainder of the string, providing a detailed explanation of the error.
API functions decode this command to extract the error_string and return it as a parameter. Users of the direct interface may want to perform a similar parsing of the response data on an error condition.
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.