wathdog

来源:互联网 发布:java 发送短信到手机 编辑:程序博客网 时间:2024/06/17 23:03

#ifndef WATCHDOG_MODULE_2011_03_12_H
#define WATCHDOG_MODULE_2011_03_12_H



#ifdef __cplusplus
extern "C" {
#endif



// the operation command which will use
#define        FEED_DOG            0x01
#define        RESET_DOG            0x02
#define        FEED_INTERVAL        0x03


//




#ifdef __cplusplus
}
#endif

#endif





#define "MySQLConnection.h"




// static name which the watchdog will use
#define        WATCHDOG        "Watchdog"
#define        INVALID_CMD        -1



//
//  static function declaration
//

static int WatchDog_Open(char* szName);

static int WatchDog_IoCtrl(device_t device, INT32 nCmomand, arg_t args);

static int WatchDog_Close(device_t device);



//
// watchdog driver operations definition
//

static t_driver_operatons fileOperations =
{
    WatchDog_Open,
    NULL,
    NULL,
    WatchDog_IoCtrl,
    WatchDog_Close
}




// Open the the watchdog device

int WatchDog_Open(char* szName)
{
    //
    INT8 i = 0;



    // judge the name string pointer is valid
    if (szName == NULL)
    {
        printf("The watchdog driver name pointer is NULL!/n");

        return -1;
    }


    // find a new timer and register the callback function



    return 0;
}



// control the the watchdog device

int WatchDog_IoCtrl(device_t device, INT32 nCmomand, arg_t args)
{
    //
    INT8 nCommand = 0;


    //
    if (nCmomand == FEED_DOG)
    {

    }

    //
    else if (nCmomand == RESET_DOG)
    {

    }

    //
    else if (nCmomand == FEED_INTERVAL)
    {

    }

    //
    else
    {
        return INVALID_CMD;
    }


    return 0;
}



// close the the watchdog device

int WatchDog_Close(device_t device)
{
    //
    INT8 i = 0;



    //


    return 0;
}

原创粉丝点击