User manual

DELIB API Referenz |
Seite 29
4.4. Programmier-Beispiel
// ****************************************************************************
// ****************************************************************************
// ****************************************************************************
// ****************************************************************************
// ****************************************************************************
//
// (c) DEDITEC GmbH, 2011
//
// Samples for USB-WATCHDOG
//
// vc-usb-watchdog-sample.cpp
//
//
// ****************************************************************************
// ****************************************************************************
// ****************************************************************************
// ****************************************************************************
// ****************************************************************************
//
//
// Folgende Bibliotheken beim Linken mit einbinden: delib.lib
// Dies bitte in den Projekteinstellungen (Projekt/Einstellungen/Linker(Objekt-
Bibliothek-Module) .. letzter Eintrag konfigurieren
#include <windows.h>
#include <stdio.h>
#include "conio.h"
#include "delib.h"
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
void main(void)
{
unsigned long handle;
unsigned long wd_status, wd_timeout, wd_counter;
// ----------------------------------------------------
// USB-Modul öffnen
handle = DapiOpenModule(USB_WATCHDOG,0);
printf("handle = %x\n", handle);
if (handle==0)
{
// USB Modul wurde nicht gefunden
printf("Modul konnte nicht gffnet werden\n");
printf("TASTE für weiter\n");
getch();
return;