DR_ApInitIPC

Cogent API and Utilities: Version 4.1
Prev |  | Next

# `DR_ApInitIPC`

`DR_ApInitIPC` -- opens the connection to the driver.

## Syntax

``int DR_ApInitIPC`(char * taskname, char * admin_name);`

## Arguments

`taskname`

  The name of the user's application. It can be any unique name in the system's namespace.

`admin_name`

  The taskname of the driver (see Driver Startup and Configuration File and Command Specifications in the Device Driver for Hilscher Fieldbus Cards manual). The driver PID can also be used.

## Returns

The integer value `0` (`DR_API_OK`) if the IPC system initialized successfully, otherwise the following error may be reported:

        DR_API_ERROR

## Description

This function opens the connection to the driver. If the Cascade NameServer (nserve) is available, then it is used to locate the driver by name, otherwise the QNX nameloc service is used. Send and reply message buffers are created with a default size of 2048 bytes. Subsequent IPC messages greater than 2048 bytes in length will be truncated.

## Example:

        char		*taskname = "dr_test";
        char		*admin_name = "/dr/cif";

        if (argc > 1)
        {
                taskname = argv[1];
                if (argc > 2)
        	          admin_name = argv[2];
        }

        if (!DR_ApInitIPC (taskname, admin_name))
        {
                printf ("Successfully connected %s to %s\n\n",
                         taskname, admin_name);
        }
        else
                printf ("Failed to connect %s to %s\n", argv[0], argv[1]);

Prev | Home | Next
`DR_ApDescribePnt` | Up | `DR_ApListBuffers`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.