/*! \file
 * \brief Handles requests to the LightingDevice.
 *
 * Handles requests to the LightingDevice.
 * LightingDevice handles lighting such as RGB LEDs, etc.
 *
 * \copyright
 * COPYRIGHT NOTICE: (c) 2017-2022 Neonode Technologies AB. All rights reserved.
 */

#ifndef DEVICE_LIGHTINGDEVICE_LIGHTINGDEVICE_H
#define DEVICE_LIGHTINGDEVICE_LIGHTINGDEVICE_H 1

#ifndef ZFORCECOMMON_H
    #error Please include "zForceCommon.h" before this file.
#endif // ZFORCECOMMON_H

/*!
 * \brief Struct representing a LightingDevice.
 *
 * Struct representing a LightingDevice.
 */
struct LightingDevice
{
    zForce     * zForce;                   //!< Pointer to zForce.
    Connection * Connection;               //!< The Connection this Device is part of.
    DeviceType   DeviceType;               //!< Which type of Device this is.
    uint32_t     DeviceIndex;              //!< Which Device Index this device has.
    Device    ** StorageDevices;           //!< Future: List of Storage Devices. Will change type during implementation.
    uint32_t     NumberOfStorageDevices;   //!< Number of Storage Devices.
    void       * PrivateProtocolData;      //!< Private Protocol Data.
    /*!
     * \brief Destructor.
     *
     * Destructs the Device and all base structs.
     * \n\n
     * Inherited from Device base class.
     *
     * \param self Pointer to the struct itself.
     *
     * \return No return value.
     */
    void         ( * Destructor)(Device * self);
};

#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus

/*!
 * \brief Internal call used to create a LightingDevice.
 *
 * Internal call used to create a LightingDevice.
 * \n\n
 * On failure, errno is set.
 * - ::EINVALIDSIZE - Invalid size.
 *
 * \param connection The Connection the Device is associated with.
 * \param deviceType Which DeviceType to create.
 * \param deviceIndex Which Device Index to set.
 * \param size If this is used as a base class for another class, set size to non-zero.
 *
 * \return A pointer to the new Device.
 */
DLLINTERNAL LightingDevice * LightingDevice_New (Connection * connection, DeviceType deviceType,
                                                 uint32_t deviceIndex, size_t size);

#ifdef __cplusplus
}
#endif // __cplusplus

#endif // DEVICE_LIGHTINGDEVICE_LIGHTINGDEVICE_H
