using System;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
namespace PACNET
{
///
public partial class Sys
{
/// Watchdog API
public class WDT
{
/// WDT_HW
public const int PAC_WDT_HW = 0;
/// WDT_OS
public const int PAC_WDT_OS = 1;
//5.1. PAC_API void pac_DisableWatchDog(int wdt)
///
/// This function turns off the watchdog operation.
///
/// [in] Specifies the Watchdog type:
/// 0: pac_WDT_HW, 1: pac_WDT_OS
/// The return value specifies the memory size.
[DllImport("PACSDK.dll", EntryPoint = "pac_DisableWatchDog")]
public static extern void DisableWatchDog(int wdt);
//5.2. PAC_API bool pac_EnableWatchDog(int wdt, DWORD value)
///
/// This function turns on the watchdog operation.
///
/// [in] Specifies the Watchdog type:
/// 0: pac_WDT_HW, 1: pac_WDT_OS
/// [in] Specifies the watchdog time.
/// Return true if success, otherwise false.
[DllImport("PACSDK.dll", EntryPoint = "pac_EnableWatchDog")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool EnableWatchDog(int wdt, uint value);
//5.3. PAC_API bool pac_GetWatchDogState(int wdt)
///
/// This function retrieves the watchdog state.
///
/// [in] Specifies the Watchdog type:
/// 0: pac_WDT_HW, 1: pac_WDT_OS
/// The return value specifies the watchdog state.
/// If turning on, return true, otherwise false.
[DllImport("PACSDK.dll", EntryPoint = "pac_GetWatchDogState")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool GetWatchDogState(int wdt);
//5.4. PAC_API DWORD pac_GetWatchDogTime(int wdt)
///
/// This function retrieves the watchdog time.
///
/// [in] Specifies the Watchdog type:
/// 0: pac_WDT_HW, 1: pac_WDT_OS
/// The return value is the watchdog time which has been assigned by
/// pac_EnableWatchDog or pac_SetWatchDogTime.
[DllImport("PACSDK.dll", EntryPoint = "pac_GetWatchDogTime")]
public static extern uint GetWatchDogTime(int wdt);
//5.5. PAC_API void pac_RefreshWatchDog(int wdt)
///
/// This function refreshes the watchdog.
///
/// [in] Specifies the Watchdog type:
/// 0: pac_WDT_HW, 1: pac_WDT_OS
[DllImport("PACSDK.dll", EntryPoint = "pac_RefreshWatchDog")]
public static extern uint RefreshWatchDog(int wdt);
//5.6. PAC_API bool pac_SetWatchDogTime(int wdt, DWORD value)
///
/// This function retrieves the watchdog time.
///
/// [in] Specifies the Watchdog type:
/// 0: pac_WDT_HW, 1: pac_WDT_OS
/// The return value is the watchdog time which has been assigned by
/// pac_EnableWatchDog or pac_SetWatchDogTime.
/// [in] Specifies the watchdog time.
/// Return true if success, otherwise false.
[DllImport("PACSDK.dll", EntryPoint = "pac_SetWatchDogTime")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool SetWatchDogTime(int wdt, uint value);
}
}
}