/*
 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
 *
 * This software is dual-licensed to you under the MIT License (MIT) and
 * the Universal Permissive License (UPL). See the LICENSE file in the root
 * directory for license terms. You may choose either license, or both.
 */

#ifndef DEVICE_MODEL_PRIVATE_EXT_H
#define DEVICE_MODEL_PRIVATE_EXT_H

#ifdef __cplusplus
extern "C" {
#endif
#include "iotcs_virtual_device.h"
    /**
     * Callback invoked in case of action request for C++
     * @param virtual_device_handle The device for which this action has been invoked
     * @param name name of action
     * @param argument argument value together with its type
     */
    typedef void (*iotcs_action_callback_cpp)(iotcs_virtual_device_handle virtual_device_handle,
            char* name, iotcs_typed_value argument);

    /**
     * @brief Set callback for given action
     * @param virtual_device_handle Device Handle
     * @param action_name Name of the action
     * @param callback callback to call
     * @retval IOTCS_RESULT_INVALID_ARGUMENT if virtual_device_handle or action_name are NULL.
     * @retval IOTCS_RESULT_INVALID_ARGUMENT given action_name wasn't found.
     * @retval IOTCS_RESULT_OK if succeeds.
     */
    iotcs_result iotcs_virtual_device_set_callback_cpp(iotcs_virtual_device_handle virtual_device_handle, const char *action_name, iotcs_action_callback_cpp callback);

#ifdef __cplusplus
}
#endif

#endif
