Intelligent Card Support

Download Driver Module

lgo_DownloadDriverModule()

Initiate downloading of driver module into an intelligent board.

Syntax
#include "laygo.h"

LResult lgo_DownloadDriverModule
    (
        LDriverId    driver,
        LBoardId     board,
        LFileName    fileName
    );
driverdriver controlling the board
boarddriver relative board id
fileNamename of file containing driver module
Description

lgo_DownloadDriverModule() initiates the download of a driver module into an intelligent board.

lgo_DownloadDriverModule() should be called only after lgo_CheckHardwareInitialization() has returned successfully.

LayGO driver module files have a default extension of .drv. If no path to the file is given, lgo_DownloadDriverModule() looks for the file first in the current directory, then in \laygo\bin on the current drive. An alternative default directory can be specified using the environment variable LAYGODRV.

Return Values

If successful, lgo_DownloadDriverModule() returns a non-negative value indicating the minimum number of seconds to wait for a successful initialization. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:

See Also

lgo_CheckDriverModuleInitialization()

Example
LResult    result;

if ((result = lgo_InitializeHardware(0, 0)) < 0)
{
    return (FAILURE);
}
else
{
    Sleep((long) result * 1000);

    if (lgo_CheckHardwareInitialization(0, 0) < 0)
    {
        return (FAILURE);
    }
    else
    {
        if ((result = lgo_DownloadDriverModule(0, 0, file) < 0)
    {
        return (FAILURE);
    }
}