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


#include <sys/asoundlib.h>

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


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



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


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:

A unique key that's used to identify this parameter.
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.


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).


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


QNX Neutrino

Cancellation point Yes
Interrupt handler No
Signal handler Yes
Thread Yes


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