snd_afm_set_vin_stream()

Set the current Vehicle Input (VIN) data for an AFM.

Synopsis:

#include <sys/asoundlib.h>

int snd_afm_set_vin_stream( snd_afm_t *handle,
                            snd_afm_vin_pair_t *stream,
                            int num );
 

Arguments:

handle
The handle for the AFM device, which you must have opened by calling snd_afm_open_name() or snd_afm_open().
stream
An array of snd_afm_vin_pair_t entries to set; see below.
num
The number of entries in the array.

Library:

libasound

Use the -l asound option with qcc to link against this library.

Description:

Note: This function can only be used if you have QNX Acoustic Management Platform 3.0 installed.

The snd_afm_set_vin_stream function sets the current Vehicle Input data for an AFM. This function should be called when the VIN data changes while the AFM is running.

The stream should be an array of snd_afm_vin_pair_t structures corresponding to the VINS retrieved with snd_afm_get_vin_list(). The snd_afm_vin_pair_t structure is defined as follows:

typedef struct snd_afm_vin_pair
{
   int16_t key;
   int16_t value;
} snd_afm_vin_pair_t;

The members include:

key
A unique key that's used to identify this parameter.
value
The current value of this parameter to send to the AFM(s).

The snd_afm_set_vin_stream() function is used to send vehicle information (e.g., RPM, vehicle speed, etc.) to the ASD AFMs. This information is expected to change rapidly, and this API provides the means to pass data to the AFMs regularly while they're processing. The stream should contain one snd_afm_vin_pair_t for each afm_vin_list_item_t returned from snd_afm_get_vin_list(), with the keys set to match. The value should be between the minimum and maximum values returned in the afm_vin_list_item_t.

Returns:

EOK on success, or a negative errno value upon failure.

This function can also return the return values of devctl() (see devctl() in the QNX Neutrino C Library Reference).

Errors:

-E2BIG
The stream array is too big.
-EAGAIN
The AFM isn't running.
-EINVAL
The value of handle or stream is NULL.
-ENOTSUP
The AFM doesn't support VIN lists.

Classification:

QNX Neutrino

Safety:  
Cancellation point Yes
Interrupt handler No
Signal handler Yes
Thread Yes

Caveats:

This function is not thread safe if the handle (snd_afm_t) is used across multiple threads.