/* DLL wrapper for C027N/water-meter message handling functions
 * for MWC demo 2015
 * 
 * Copyright (C) u-blox Melbourn Ltd
 * u-blox Melbourn Ltd, Melbourn, UK
 * 
 * All rights reserved.
 *
 * This source file is the sole property of u-blox Melbourn Ltd.
 * Reproduction or utilization of this source in whole or part is
 * forbidden without the written consent of u-blox Melbourn Ltd.
 */

#ifndef IOT_METER_DLL_WRAPPER_HPP
#define IOT_METER_DLL_WRAPPER_HPP

/**
 * @file iot_meter_dll_wrapper.h
 * This file defines the encapsulation necessary to
 * call the CPP Message Handling functions from C#.
 */
 
#ifdef __cplusplus
extern "C" {
#endif

    #define DLL __declspec(dllexport)

    DLL uint32_t __cdecl maxDatagramSizeRaw (void);
    DLL uint32_t __cdecl gpioWaterPump (void);

    DLL uint32_t __cdecl encodeRebootReqDlMsg (char * pBuffer,
                                               bool devModeOnNotOff);
    DLL uint32_t __cdecl encodeSerialNumberGetReqDlMsg (char * pBuffer);
    DLL uint32_t __cdecl encodeReadingIntervalSetReqDlMsg (char * pBuffer,
                                                            uint32_t readingIntervalSeconds);
    DLL uint32_t __cdecl encodeReadingIntervalGetReqDlMsg (char * pBuffer);
    DLL uint32_t __cdecl encodeGpioSetReqDlMsg (char * pBuffer,
                                                uint8_t gpio,
                                                bool inputNotOutput,
                                                bool onNotOff);
    DLL uint32_t __cdecl encodeGpioGetReqDlMsg (char * pBuffer,
                                                 uint32_t gpio);
    DLL uint32_t __cdecl encodeLedSetReqDlMsg (char * pBuffer,
                                                bool onNotOff);
    DLL uint32_t __cdecl encodeLedGetReqDlMsg (char * pBuffer);
    DLL uint32_t __cdecl encodeFlashSetReqDlMsg (char * pBuffer,
                                                  bool onNotOff);
    DLL uint32_t __cdecl encodeFlashGetReqDlMsg (char * pBuffer);
    DLL void __cdecl unpackGpioState (uint32_t value,
                                      uint32_t *pGpio,
                                      bool * pInputNotOutput,
                                      bool * pOnNotOff);
    DLL uint32_t __cdecl decodeUlMsg (const char ** ppInBuffer,
                                      uint32_t sizeInBuffer,
                                      uint32_t * pContents);

    DLL void  initDll (void (*guiPrintToConsole) (const char *)); 

#ifdef __cplusplus
}
#endif

#endif

// End Of File
