// MyAduCode.c
// Demonstrates the AduHid DLL controlling an ADU device
//       from Ontrak Control Systems Inc. (www.ontrak.net)
// Copyright 2002 - Ontrak Control Systems Inc.

#include "AduHid.h"
#include "stdio.h"  /* for the printf function */
#include <string.h>

int main(int argc, char* argv[])
{
    void * hDevice;
    char sBuffer[8];

    hDevice = OpenAduDevice(0);
    WriteAduDevice(hDevice, "rpk1", 4, 0, 0);
    memset(sBuffer, 0, sizeof(sBuffer));
    ReadAduDevice(hDevice, sBuffer, 7, 0, 0);
    CloseAduDevice(hDevice);
    printf("Hello world, the relay value is %s\n", sBuffer);

    return 0;
} // end main

