Intelligent Card Support

Check Driver Module Initialization

lgo_CheckDriverModuleInitialization()

Check the success of driver module initialization after downloading to an intelligent board.

Syntax
#include "laygo.h"

LResult lgo_CheckDriverModuleInitialization
    (
        LDriverId    driver,
        LBoardId     board
    );
driverdriver controlling the board
boarddriver relative board id
Description

lgo_CheckDriverModuleInitialization() checks the success of a driver module's initialization after it has been downloaded into an intelligent board. If the driver module initialization was successful, the intelligent board is ready to process commands from the host, and the LayGO stack can be initialized. lgo_CheckDriverModuleInitialization() should be called only after a successful call to lgo_DownloadDriverModule() and the number of seconds indicated by the return value of that call has elapsed.

Return Values

If successful, lgo_CheckDriverModuleInitialization() returns a non-negative value. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:

See Also

lgo_DownloadDriverModule()

Example
LResult    result;

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

    if (lgo_CheckHardwareInitialization(0) < 0)
    {
        return (FAILURE);
    }
    else
    {
        if ((result = lgo_DownloadDriverModule(0, file) < 0)
        {
            return (FAILURE);
        }
        else
        {
            Sleep((long) result * 1000);
            if (lgo_CheckDriverModuleInitialization(0) < 0)
            {
                return (FAILURE);
            }
        }
    }
}

return (SUCCESS);