////////////////////////////////////////////////////////////////////////////////////////////
/// \file HwCom.h
/// \par Copyright
/// Copyright 2010-2021 STAR COOPERATION GmbH. All rights reserved.
/// \brief
/// This file contains the PC HW communication interface for ethernet communications								
////////////////////////////////////////////////////////////////////////////////////////////

/* Prevent multiple includes */
#ifndef _STAR_PCHWCOM_H_
#define _STAR_PCHWCOM_H_


#ifdef _WIN32
#ifndef STAR_API
	#define STAR_API __stdcall	///< the STAR_API
#endif

#ifndef EBEL_API
	#define EBEL_API STAR_API	///< the deprecated EBEL_API, now STAR_API
#endif


#ifdef EBEL_EXPORTS
	#define HWCOM_EXPORTDLL extern "C"  __declspec(dllexport)	///< the HWCOM_EXPORTDLL	
#else
	#ifdef _HWCOM_STATIC_LIB
		#define HWCOM_EXPORTDLL extern "C"   
	#else
		#define HWCOM_EXPORTDLL extern "C" __declspec(dllimport)	///< the HWCOM_EXPORTDLL
	#endif
#endif
#else
#ifndef STAR_API
	#define STAR_API 	///< the STAR_API
#endif

#ifndef EBEL_API
	#define EBEL_API STAR_API	///< the deprecated EBEL_API, now STAR_API
#endif

#ifdef EBEL_EXPORTS
	#define HWCOM_EXPORTDLL extern "C"  __attribute__ ((visibility ("default")))	///< the HWCOM_EXPORTDLL	
#else
	#ifdef _HWCOM_STATIC_LIB
		#define HWCOM_EXPORTDLL extern "C"   __attribute__ ((visibility ("hidden")))
	#else
		#if defined(__cplusplus)
			#define HWCOM_EXPORTDLL extern "C"
		#else
			#define HWCOM_EXPORTDLL 
		#endif
	#endif
#endif
#endif

/* Includes common interface structures and defines */
#include "HwCom_Defines.h"

#ifdef BLUETOOTH_INTERFACE
    #include "Bluetooth/BluetoothDeviceInquiry.h"
#endif


/******************************************************************************
                O P E N  /   C L O S E	    F U N C T I O N S
******************************************************************************/

/// \brief Generates a new PC HW interface to communicate with a hardware over IP.
/// Some implementations use Ethernet as the lower layer, some use LocalHost (e.g. FL3X Device PCIe).
/// \param handle Pointer to a handle representing the interface instance. Will be filled by this function.
/// \param ipAddress IP Address of the target.
/// \param port Port number used to communicate with the target.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_Failed The function failed to create a new handle.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_TcpOpen(COM_Handle* handle,
                                          const char* ipAddress,
                                          u16 port);
                                            
/// \brief Closes the communication interface by deleting the handle.
/// \param handle Pointer to a handle representing the interface instance.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_Close(COM_Handle handle);

/// \brief Returns the Version of the implemented PC HW Interface on the PC side.
/// \param version The returned version from the interface implemented at the PC.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_NullPointer version is a NULL pointer.
/// \see #COM_GetVersionReq
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetDllVersion(COM_Version* version);

/// \brief Returns the IP addresses of the available hardware devices. Ethernet-based devices
///     and FL3X Device/Interface PXIe/PCIe can be found. For Ethernet-based devices, use
///     the parameter broadCastAddress.
/// \param broadCastAddress Broadcast address used for device discovery in Ethernet-based systems.
///     For FL3X Device/Interface PXIe/PCIe devices, the broadcast address is not evaluated,
///     as a different discovery mechanism is used. In this case, the value can be set arbitrarily.
///     The user allocates the memory.
/// \param numberOfOnlineDevices This is an input/output parameter. The user allocates the memory.
///     Input parameter: The maximum number of devices you want to search for. It
///     is recommended to set it to MAX_NUMBER_OF_ONLINE_DEVICES.
///     Output parameter: The number of the available devices found. The maximum number
///     is MAX_NUMBER_OF_ONLINE_DEVICES.
/// \param onlineDevices The return value with the IP addresses of the available devices found (array of u32 "u32 onlineDevices[]").
///     The user allocates the memory. It's recommended to pass an array with MAX_NUMBER_OF_ONLINE_DEVICES items.
/// \return COM_RETURN_OK Function executed successfully.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetOnlineDevices(char* broadCastAddress, 
                                                   u32* numberOfOnlineDevices, 
                                                   u32* onlineDevices);

/******************************************************************************
            L O W   L E V E L   F U N C T I O N S
******************************************************************************/

/// \brief Gets the serial number.
/// \param handle Pointer to a handle representing the interface instance.
/// \param serial The serial number of the hardware.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetSerialReq(COM_Handle handle,
                                               COM_SerialNumber* serial);


/// \brief Gets the MAC address of the PC ethernet connector.
///     Function is currently not implemented! Do not use!
/// \param handle Pointer to a handle representing the interface instance.
/// \param mac the mac address of the hardware. Represented by an array with length 6.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetMacReq(COM_Handle handle,
                                            COM_MacAddress* mac);


/// \brief Gets the License bits and the serial number encoded in the License. Function is deprecated!
/// \param handle Pointer to a handle representing the interface instance.
/// \param features Feature bits decoded with serial number in an array with length 8.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetLicenseReq(COM_Handle handle,
                                                COM_Features* features);


/// \brief Sets the serial number. This is not supported for normal user applications!
/// \param handle Pointer to a handle representing the interface instance.
/// \param serial The serial number of the hardware.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_SetSerialReq(COM_Handle handle,
                                               COM_SerialNumber serial);


/// \brief Sets the MAC address of the PC ethernet connector.
///     Function is currently not implemented! Do not use!
/// \param handle Pointer to a handle representing the interface instance.
/// \param mac the mac address of the hardware. Represented by an array with length 6.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_SetMacReq(COM_Handle handle,
                                            COM_MacAddress mac);


/// \brief Sets the License bits and the serial number encoded in the License.
/// \param handle Pointer to a handle representing the interface instance.
/// \param lic the license information.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_SetLicenseReq(COM_Handle handle,
                                                COM_License lic);


/// \brief Returns the IPv4 configuration of the NIC in the hardware.
/// \param handle Pointer to a handle representing the interface instance.
/// \param nic Structure including the IPv4 address, the IPv4 subnet mask and the IPv4 standard gateway address.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetNicConfigReq(COM_Handle handle,
                                                  COM_NicConfig* nic);


/// \brief Sets the IPv4 configuration of the NIC in the hardware.
/// \param handle Pointer to a handle representing the interface instance.
/// \param nic Structure including the IPv4 address, the IPv4 subnet mask and the IPv4 standard gateway address.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_SetNicConfigReq(COM_Handle handle,
                                                  COM_NicConfig nic);


/// \brief Gets the device name. This is a name that the user may set for a device and
/// that stays the same after you power-cycle it.
/// \param handle Pointer to a handle representing the interface instance.
/// \param deviceName Char array with the device name. The length of the deviceName is 32 Bytes (31 + '\0').
///     The user has to allocate the memory (32 byte).
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetDeviceNameReq(COM_Handle handle, 
                                                    char* deviceName);


/// \brief Sets the device name. This is a name that the user may set for a device and
/// that stays the same after you power-cycle it.
/// \param handle Pointer to a handle representing the interface instance.
/// \param deviceName Char array with the device name. The length of the deviceName is 32 Bytes (31 + '\0').
///     The user has to allocate the memory (32 byte).
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_SetDeviceNameReq(COM_Handle handle,
                                                   const char* deviceName);


/// \brief Gets the wakeup/sleep configuration.
/// \param handle Pointer to a handle representing the interface instance.
/// \param wakeupSleepConfig structure containing the wakeup/sleep configurations.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetWakeupSleepConfigReq(COM_Handle handle, 
                                                          COM_WakeupSleepConfig* wakeupSleepConfig);


/// \brief Sets the wakeup/sleep configuration.
/// \param handle Pointer to a handle representing the interface instance.
/// \param wakeupSleepConfig structure containing the wakeup/sleep configurations.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_SetWakeupSleepConfigReq(COM_Handle handle,
                                                          COM_WakeupSleepConfig* wakeupSleepConfig);


/// \brief Gets the termination configuration for every channel on a device.
/// \param handle Pointer to a handle representing the interface instance.
/// \param terminationConfig structure containing the termination configurations.
/// The caller provides the memory for this parameter and puts its pointer here.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetTerminationConfigReq(COM_Handle handle, 
                                                          COM_TerminationConfig* terminationConfig);


/// \brief Sets the termination configuration with the struct terminationConfig.
/// In case there is no ChannelId set in the struct, the termination for the ChannelId
/// will not be changed. Example:
/// terminationConfig has InfoCount 1 and sets ChannelId 1 and Termination 1 (activated).
/// In this case, all other channels will keep the previous termination state.
///
/// After calling this function, the parameter terminationConfig contains additional
/// information. In the parameter Termination you see whether setting the termination
/// was successful.
///
/// When you fill multiple channels in the struct terminationConfig and some of
/// the channel terminations could not be set, COM_RETURN will be COM_RETURN_OK. Check
/// the parameter terminationConfig and the parameter Termination for every channel
/// to see whether the termination was set correctly.
///
/// \param handle Pointer to a handle representing the interface instance.
/// \param terminationConfig structure containing the termination configurations.
/// The caller provides the memory for this parameter and puts its pointer here.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_SetTerminationConfigReq(COM_Handle handle, 
                                                          COM_TerminationConfig* terminationConfig);


/// \brief Gets the software sleep configuration.
/// \param handle Pointer to a handle representing the interface instance.
/// \param swSleepConfig structure containing the software sleep configuration.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return COM_RETURN_NullPointer swSleepConfig is a NULL pointer.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetSwSleepConfigReq(COM_Handle handle, 
                                                      COM_SwSleepConfig* swSleepConfig);


/// \brief Sets the software sleep configuration.
/// \param handle Pointer to a handle representing the interface instance.
/// \param enableSwSleep the new software sleep state. 0 = disable, 1 = enable
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_SetSwSleepConfigReq(COM_Handle handle, 
                                                      u08 enableSwSleep);

/// \brief Gets the wifi configuration.
/// \param handle Pointer to a handle representing the interface instance.
/// \param wifiConfig structure containing the wifi configuration.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return COM_RETURN_NullPointer One of the parameters is a NULL pointer.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetWifiConfigReq(COM_Handle handle, 
                                                      COM_WifiConfig* wifiConfig);

/// \brief Sets the wifi configuration.
/// \param handle Pointer to a handle representing the interface instance.
/// \param wifiConfig structure containing the wifi configuration.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return COM_RETURN_NullPointer One of the parameters is a NULL pointer.
/// \return else Error code of the called function in the hardware.
/// \remark Be careful when setting the wifi config. If misconfigured, the wifi device may not be reachable!
/// \remark The user has to take care that the parameters are valid.
/// \remark Changes take effect after the user resets the device.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_SetWifiConfigReq(COM_Handle handle, 
                                                      const COM_WifiConfig* wifiConfig);
/// \brief Gets the wifi device information.
/// \param handle Pointer to a handle representing the interface instance.
/// \param wifiInformation structure containing the wifi information.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return COM_RETURN_NullPointer One of the parameters is a NULL pointer.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetWifiInfoReq(COM_Handle handle, COM_WifiInfo* wifiInfo);


/******************************************************************************
            C O M M U N I C A T I O N   G E N E R A L
******************************************************************************/

/// \brief Returns information about the connected hardware
/// \param handle Pointer to a handle representing the interface instance.
/// \param hwPlattform the type of the hardware
/// \param hwId the unique id of the hardware in the network
/// \param hwVersion the version of the hardware
/// \param isLocked the info if the hardware is locked (0: not locked; != 0: locked)
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_NullPointer version is a NULL pointer.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetConnectedHwReq(COM_Handle handle,
                                                    COM_HW_TYPE* hwPlattform,
                                                    unsigned char* hwId,
                                                    COM_Version* hwVersion,	
                                                    COM_Bool* isLocked);

/// \brief Returns the Version of the implemented PC HW Interface on the hardware side.
/// \param handle Pointer to a handle representing the interface instance.
/// \param version The returned version from the interface implemented at the hardware.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_NullPointer version is a NULL pointer.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
/// \see COM_GetDllVersion
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetVersionReq(COM_Handle handle,
                                                COM_Version* version);


/// \brief Locks the hardware so no other user can control the running application. Info requests will still be available for other users.
/// \param handle Pointer to a handle representing the interface instance.
/// \param hwId ID of the hardware which shall be locked.
/// \param timeout the hardware lock timeout in seconds. Set to 0 if no hardware lock timeout timer should be used.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
/// \remark The 'hwId' is irelevant for ethernet based communications since IP addresses are used. The parameter is ignored.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_LockHwReq(COM_Handle handle, 
                                            u08 hwId,
                                            u08 timeout);

/// \brief Unlocks the hardware so other user can control the application.
/// \param handle Pointer to a handle representing the interface instance.
/// \param hwId ID of the hardware which shall be locked.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
/// \remark The 'hwId' is irelevant for ethernet based communications since IP addresses are used. The paramter is ignored.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_UnlockHwReq(COM_Handle handle, 
                                              u08 hwId);

/******************************************************************************
             H A R D W A R E I N I T I A L I S A T I O N
******************************************************************************/

/// \brief Downloads an application to the Hardware via TFTP.
/// \param handle Pointer to a handle representing the interface instance.
/// \param destination Slot, in which the application shall be downloaded.
/// \param data binary data stream of the application.
/// \param length Length of the application data stream.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Failure The download failed.
/// \remark Multiple application downloads are not supported yet. Therefore the 'destination' parameter is ignored.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_Download(COM_Handle handle, 
                                           u16 destination, 
                                           u08* data, 
                                           u32 length);

/// \brief Downloads an application to the Hardware via TFTP.
/// \param handle Pointer to a handle representing the interface instance.
/// \param destination in which the application shall be downloaded.
/// \param data binary data stream of the application.
/// \param length Length of the application data stream.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Failure The download failed.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_Download_Dest(COM_Handle handle, 
                                                char* destination, 
                                                u08* data, 
                                                u32 length);

/// \brief Downloads a FPGA image (*.rbf) to the Hardware via TFTP.
/// \param handle Pointer to a handle representing the interface instance.
/// \param destination Slot, in which the application shall be downloaded.
/// \param data binary data stream of the application.
/// \param length Length of the application data stream.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Failure The download failed.
/// \remark Multiple application downloads are not supported yet. Therefore the 'destination' parameter is ignored.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_Download_FPGA(COM_Handle handle, 
                                                u16 destination, 
                                                u08* data, 
                                                u32 length);

/// \brief Downloads a FPGA image (*.fpga) to the Hardware via TFTP.
/// \param handle Pointer to a handle representing the interface instance.
/// \param destination in which the application shall be downloaded.
/// \param data binary data stream of the application.
/// \param length Length of the application data stream.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Failure The download failed.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_Download_FPGA_Dest(COM_Handle handle, 
                                                     char* destination, 
                                                     u08* data, 
                                                     u32 length);

/// \brief Gets the detailed error message when download failed.
/// \param handle Pointer to a handle representing the interface instance.
/// \param buf the buffer to write the message in
/// \param buflen Length buffer (max: DOWNLOAD_ERROR_MSG_MAX)
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Failure The download failed.
/// \remark Use the following regex to seperate the message into the parts;
/// \remark type; id; message
/// \remark ^((?\<type\>[\\w ]*):+ )?(#(?\<Nr\>\\d*))?((: )?(?\<Msg\>[\\w ]*)?)$
/// \remark All parts are optional.
/// \remark It is possible that the parts "type" and "msg" are equal.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetDownloadErrorMessage(COM_Handle handle, 
                                                          char* buf,
                                                          u32 buflen);

/******************************************************************************
                        H W	  I N F O R M A T I O N 
******************************************************************************/

/// \brief Returns the configuration of the hardware.
/// \param handle Pointer to a handle representing the interface instance.
/// \param config Pointer to the structure with the hardware config.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
/// \note In config->FPGA, this command only sets the first byte of the enum,
///     because in the packet specification only one byte is defined.
///     E.g.: When the actual type is 0x106A, this command will return 0x6A.
///     Use #COM_GetFPGAImagesReq to get the full fpga type.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetHwConfigReq(COM_Handle handle, 
                                                 COM_HwConfig* config);

/// \brief Returns the license configuration.
/// \param handle Pointer to a handle representing the interface instance.
/// \param config Pointer to the structure where the response shall be stored.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetLicenseConfigReq(COM_Handle handle, 
                                                      COM_LicenseConfig* config);

/// \brief Returns the software configuration.
/// \param handle Pointer to a handle representing the interface instance.
/// \param config Pointer to the structure with the software configuration.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetSwConfigReq(COM_Handle handle, 
                                                 COM_SwConfig* config);
/// \brief Returns the configuration of the FPGAs.
/// \param handle Pointer to a handle representing the interface instance.
/// \param config Pointer to the structure with the configuration of the FPGAs.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetFPGAConfigReq(COM_Handle handle, 
                                                   COM_FPGAConfig* config);

/// \brief Returns the infornation about the FPGA images, which are stored in the hardware.
/// \param handle Pointer to a handle representing the interface instance.
/// \param config structure containing the FPGA Image configurations.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetFPGAImagesReq(COM_Handle handle, 
                                                   COM_FPGAImageConfig* config);

/// \brief Returns a list of available mount points and their infornation about size and used size.
/// \param handle Pointer to a handle representing the interface instance.
/// \param mountPointInfos structure containing the mount point name, identifier, size and used size.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetFileSystemMountStatesReq(COM_Handle handle, 
                                                    COM_MountPointInfos* mountPointInfos);

/// \brief Takes information about transceiver state and returns information from result.
/// \param handle Pointer to a handle representing the interface instance.
/// \param transceiverStateInfo structure containing information about transceiver state.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetSetTransceiverStateReq(COM_Handle handle,
													COM_TransceiverStateInfo* transceiverStateInfo);

/// \brief Sets device application active.
/// \param handle Pointer to a handle representing the interface instance.
/// \param application structure containing information about activated applications.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_SetActiveApplication(COM_Handle handle,
    COM_ActiveApplication application);

/// \brief Gets device application active.
/// \param handle Pointer to a handle representing the interface instance.
/// \param application structure containing information about activated applications.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetActiveApplication(COM_Handle handle,
    COM_ActiveApplication* application);

/// \brief Gets device applications version.
/// \param handle Pointer to a handle representing the interface instance.
/// \param application_version structure containing information about device application version.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetApplicationsVersionReq(COM_Handle handle,
    COM_GetApplicationsVersion* application_version);

/// \brief Gets System available devices as in slots.
/// \param handle Pointer to a handle representing the interface instance.
/// \param slot_infos structure containing information about system slot information.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetSlotInfosReq(COM_Handle handle, COM_SlotInfos* slot_infos);

/// \brief Gets Current selected slot (device).
/// \param handle Pointer to a handle representing the interface instance.
/// \param slot_index Pointer to the device slot index.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetSlotIndexReq(COM_Handle handle, u08* slot_index);

/// \brief Sets Current selected slot (device).
/// \param handle Pointer to a handle representing the interface instance.
/// \param slot_index Selected slot index (device) to be set.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_SetSlotIndexReq(COM_Handle handle, u08 slot_index);
/******************************************************************************
            A P P L I C A T I O N   G E N E R A L
******************************************************************************/

/// \brief Starts the execution of the application.
/// \param handle Pointer to a handle representing the interface instance.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AppStartReq(COM_Handle handle);

/// \brief Stops the execution of the application.
/// \param handle Pointer to a handle representing the interface instance.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AppStopReq(COM_Handle handle);

/// \brief Returns common status information.
/// \param handle Pointer to a handle representing the interface instance.
/// \param status Contains the status informations.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_StatusReq(COM_Handle handle, 
                                            COM_Status* status);

/******************************************************************************
            S T R E A M I N G / L O G G I N G
******************************************************************************/

/// \brief Starts the streaming of the sended and received data of a channel.
/// \param handle Pointer to a handle representing the interface instance.
/// \param busType Type of the bus on which the streaming function shall be enabled.
/// \param channelId Id of the bus of the specified type on which the streaming function shall be enabled.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_StreamStartReq(COM_Handle handle, 
                                                 COM_BUSTYPE busType, 
                                                 u08 channelId);

/// \brief Stops the streaming of the sended and received data of a channel.
/// \param handle Pointer to a handle representing the interface instance.
/// \param busType Type of the bus on which the streaming function shall be disabled.
/// \param channelId Id of the bus of the specified type on which the streaming function shall be disabled.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_StreamStopReq(COM_Handle handle, 
                                                COM_BUSTYPE busType, 
                                                u08 channelId);

/// \brief Returns received streaming packets of a certain channel.
/// \param handle Pointer to a handle representing the interface instance.
/// \param busType Type of the bus on which the streaming messages shall be received.
/// \param channelID Id of the bus of the specified type on which the streaming shall be received.
/// \param packets Array in which the received streaming messages will be returned (max 4096).
/// \param nPackets Maximum number of messages which can be returned (max 4096). Equals the packets array size. After returning this variable contains the number of returned packets.
/// \remark The maximum number of returned packages is 4096. If more packages are received since the lass call, the packages will be lost.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return COM_RETURN_InvalidParameter busType, channelID or nPackets contain an invalid value.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_StreamReceive(COM_Handle handle, 
                                                COM_BUSTYPE busType, 
                                                u08 channelID, 
                                                COM_StreamPacket packets[], 
                                                u32* nPackets);



/******************************************************************************
            B U S   M E S S A G E   T R A N S M I S S I O N
******************************************************************************/

/// \brief Changes the value of a Signal.
/// \param handle Pointer to a handle representing the interface instance.
/// \param SignalId Special value representing the Signal. The values of the signals are autogenerated and are available as defines.
/// \param SignalLengthBits Signal length in Bits. If the signal value is not devideable by 8, the value must be rounded up to the next byte.
/// \param SignalValue Pointer to the new value of the signal.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_ChangeSignalReq(COM_Handle handle,
                                                  u64 SignalId,
                                                  u16 SignalLengthBits,
                                                  u08* SignalValue);


/// \brief Changes the value of a PDU.
/// \param handle Pointer to a handle representing the interface instance.
/// \param PduId Special value representing the PDU. The values of the PDUs are autogenerated and are available as defines.
/// \param PduLengthByte PDU length in Byte. It is recommended to only use native data types as length (1, 2, 4 or 8 bytes).
/// \param PduValue Pointer to the new value of the PDU.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_ChangePDUReq(COM_Handle handle,
                                               u64 PduId,
                                               u16 PduLengthByte,
                                               u08* PduValue);



/// \brief Changes the value of a Control Variable within the RBS application in the hardware.
/// \param handle Pointer to a handle representing the interface instance.
/// \param ControlId Special value representing the Control variable. The values of the control variables are autogenerated and are available as defines.
/// \param ControlLengthByte Control variable length in Byte. It is recommended to only use native data types as length (1, 2, 4 or 8 bytes).
/// \param ControlValue Pointer to the new value of the control variable.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_ChangeControlReq(COM_Handle handle,
                                                   u64 ControlId,
                                                   u16 ControlLengthByte,
                                                   u08* ControlValue);


/// \brief Changes the payload of a message.
/// \param handle Pointer to a handle representing the interface instance.
/// \param busType Type of the bus on which message payload shall be changed.
/// \param channelID Id of the bus of the specified type on which the message shall be changed.
/// \param frameId ID of the message which shall be changed.
/// \param offset Offset of the frame (FlexRay). 0, if it is a CAN bus.
/// \param payloadLength Payload length of the message.
/// \param payload Pointer to the new payload data.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_ChangeMsgReq(COM_Handle handle, 
                                               COM_BUSTYPE busType, 
                                               u08 channelID,
                                               u32 frameId,
                                               u08 offset,
                                               u16 payloadLength,
                                               u08* payload);


/******************************************************************************
            R E M A I N I N G   B U S   S I M U L A T I O N
******************************************************************************/

/// \brief Returns RBS specific status informations.
/// \param handle Pointer to a handle representing the interface instance.
/// \param status Status information.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetRBSStatusReq(COM_Handle handle, 
                                                  COM_RBS_Status* status);

/// \brief Turns a virtual ECU in a RBS on or off.
/// \param handle Pointer to a handle representing the interface instance.
/// \param busType Type of the bus, the virtual ECU is connected with.
/// \param channelID ID of the channel of the bus type, the virtual ECU is connected with.
/// \param EcuNumber Number representing an ECU. This number is autogenerated by the RBS/GW autocoder. It is available as a define.
/// \param EcuOn If '1' the virtual ECU is activated. If '0' the ECU is deactivated.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_RBSEcuControlReq(COM_Handle handle, 
                                                   COM_BUSTYPE busType, 
                                                   u08 channelID, 
                                                   u08 EcuNumber, 
                                                   u08 EcuOn);

/// \brief Turns a virtual ECU in a RBS on or off.
/// \param handle Pointer to a handle representing the interface instance.
/// \param EcuNumber Number representing an ECU. This Number is autogenerated by the RBS/GW autocoder. It is available as a define.
/// \param EcuOn If '1' the virtual Ecu is activated. If '0' the Ecu is deactivated.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_RBSEcuFullControlReq(COM_Handle handle, 
                                                       u08 EcuNumber, 
                                                       u08 EcuOn);

/// \brief Reads the TimeStamp of the application build time.
/// \param handle Pointer to a handle representing the interface instance.
/// \param timestamp The timestamp (date and time) is generated during the building process of the autocoder.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_TimeStampReq(COM_Handle handle,
                                               COM_TimeStamp* timestamp);

/// \brief Returns the version of the FlexConfig RBS used by the project.
/// \param handle Pointer to a handle representing the interface instance.
/// \param version The returned version of FlexConfig RBS used by the project.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetRBSVersionReq(COM_Handle handle,
														COM_ExtendedVersion* version);

/// \brief Returns user VersionString.
/// \param handle Pointer to a handle representing the interface instance.
/// \param versionstring the version as a string value.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_VersionStringReq(COM_Handle handle,
                                                   COM_VersionString* versionstring);

/// \brief Sets a RBS manipulation.
/// \param handle Pointer to a handle representing the interface instance.
/// \param manipulation contains the RBS manipulation settings.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_RbsManipulationReq(COM_Handle handle,
                                                     COM_RbsManipulation manipulation);

/// \brief Gets status of a RBS manipulation (active or not active).
/// \param handle Pointer to a handle representing the interface instance.
/// \param manipulationActive indicates if the manipulation is active (1: active; 0: not active)
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetRbsManipulationActiveReq(COM_Handle handle,
                                                              u08* manipulationActive);

/// \brief Starts the RBS manipulation (sequence) once.
/// \param handle Pointer to a handle representing the interface instance.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_StartRbsManipulationReq(COM_Handle handle);

/// \brief Starts the RBS manipulation (sequence) cyclic.
/// \param handle Pointer to a handle representing the interface instance.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_StartRbsManipulationCyclicReq(COM_Handle handle);

/// \brief Stops all RBS manipulations.
/// \param handle Pointer to a handle representing the interface instance.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_StopRbsManipulationReq(COM_Handle handle);

/// \brief Stores all RBS manipulations to flash
/// \param handle Pointer to a handle representing the interface instance.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_SaveRbsManipulationReq(COM_Handle handle);

/// \brief Deletes the stored RBS manipulations from flash
/// \param handle Pointer to a handle representing the interface instance.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_DeleteRbsManipulationReq(COM_Handle handle);

/// \brief Changes the value of a global variable,signal or a CC (on/off).
/// \param handle Pointer to a handle representing the interface instance.
/// \param Destination Can be an Address od a Id representing the Signal,Global variable or a CC. The values of the signals are autogenerated and are available as defines.
/// \param LengthBytes Length  of the Value to be set.
/// \param Value Pointer to the new value of the message (signal, global variable, CC...).
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_SetValueReq(COM_Handle handle,
                                              u64 Destination,
                                              u16 LengthBytes,
                                              u08* Value);

/// \brief Reads the value of a global variable, signal or a CC (on/off).
/// \param handle Pointer to a handle representing the interface instance.
/// \param Destination Can be an address of an Id representing the signal, global variable or a CC.
/// \param LengthBytes Length of the Value to be read.
/// \param Value the value of the global variable, signal or CC.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetValueReq(COM_Handle handle,
                                              u64 Destination,
                                              u16 LengthBytes,
                                              u08* Value);

/// \brief Gets the RBS channel configuration.
/// \param handle Pointer to a handle representing the interface instance.
/// \param channelConfig structure containing the RBS channel configurations.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetRBSChannelsInfoReq(COM_Handle handle, 
                                                          COM_ChannelConfig* channelConfig);

/// \brief Gets the FlexRay offset control states.
/// \param handle Pointer to a handle representing the interface instance.
/// \param offsetControlStates structure containing the offset control states of all configured FlexRay busses.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetRBSFROffsetControlStatesReq(COM_Handle handle,
                                                                 COM_OffsetControlStates* offsetControlStates);

/// \brief Change Channel Application Type.
/// \param handle Pointer to a handle representing the interface instance.
///	\param changeRequest structure containing the application change reuestes of specific channels.
/// \param changeResponse structure containing the application type of reuqested channels.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_ChangeRBSApplicationTypeReq(COM_Handle handle,
															COM_ChannelAppTypes* changeRequest,
															COM_ChannelAppTypes* changeResponse);

/// \brief Shuts down a virtual ECU in a RBS on or off.
/// \param handle Pointer to a handle representing the interface instance.
/// \param EcuNumber Number representing an ECU. This number is autogenerated by the RBS/GW autocoder. It is available as a define.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_RBSEcuShutdownReq(COM_Handle handle,
														u08 EcuNumber);

/// \brief Turns a service in a RBS on or off.
/// \param handle Pointer to a handle representing the interface instance.
/// \param serviceControl structure containing all needed parameter for a service on/off.
/// \param ServiceOn If '1' the service is on. If '0' the service is off.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_RBSServiceControlReq(COM_Handle handle, 
														COM_RbsServiceControl serviceControl,
														u08 serviceOn);

/// \brief COM_RBSServiceStateReq
/// \param handle Pointer to a handle representing the interface instance.
/// \param serviceStateReq
/// \param serviceStateRes
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_RBSServiceStateReq(COM_Handle handle,
														COM_RbsServiceStateReq* serviceStateReq,
														COM_RbsServiceStateRes* serviceStateRes);

/// \brief COM_GetRBSActiveManipulationsReq
/// \param handle Pointer to a handle representing the interface instance.
/// \param activeManipulationRes
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetRBSActiveManipulationsReq(COM_Handle handle,
                                                                   COM_GetRbsActiveManipulations* activeManipulationRes);

/// \brief COM_GetRBSManipulationStatusReq
/// \param handle Pointer to a handle representing the interface instance.
/// \param manipulationStatusReq
/// \param manipulationStatusRes
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetRBSManipulationStatusReq(COM_Handle handle,
                                                                  COM_GetRbsManipulationStatusReq* manipulationStatusReq,
                                                                  COM_GetRbsManipulationStatusRes* manipulationStatusRes);
/******************************************************************************
                         L O G G E R  ( L O G G I N G )
******************************************************************************/

/// \brief Starts the logging.
/// \param handle Pointer to a handle representing the interface instance.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_LoggingStartAllReq(COM_Handle handle);

/// \brief Stops the logging.
/// \param handle Pointer to a handle representing the interface instance.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_LoggingStopAllReq(COM_Handle handle);

/// \brief Gets info whether the logging is active or not.
/// \param handle Pointer to a handle representing the interface instance.
/// \param loggingActive Pointer to a struct containing info whether the logging is active or not.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetLoggingActiveReq(COM_Handle handle,
                                                      COM_LoggingActive* loggingActive);

/// \brief Returns the version of the logging module used by the device.
/// \param handle Pointer to a handle representing the interface instance.
/// \param version The returned version from the logger mudule implemented at the hardware.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetLoggingVersionReq(COM_Handle handle, 
                                                       COM_Version* version);

/******************************************************************************
                         C P U  -  C O N T R O L 
******************************************************************************/

/// \brief Starts or continues the application.
/// \param handle Pointer to a handle representing the interface instance.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_CpuRunReq(COM_Handle handle);

/// \brief Stops the execution of the application.
/// \param handle Pointer to a handle representing the interface instance.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_CpuStopReq(COM_Handle handle);

/// \brief Performs a reset of the CPU. 
/// \remark External components not depended on the software reset of the CPU are not affected.
/// \remark Volatile settings, such as a hardware lock will be lost.
/// \param handle Pointer to a handle representing the interface instance.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_CpuResetReq(COM_Handle handle);

#ifdef BLUETOOTH_INTERFACE
/******************************************************************************
                B L U E T O O T H  O P E N  F U N C T I O N 
******************************************************************************/

/// \brief Generates a new PC HW interface. To communicate with a hardware over Bluetooth.
/// \param handle Pointer to a handle representing the interface instance. Will be filled by this function.
/// \param port Bluetooth HW address used to communicate with the target.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_Failed The function failed to create a new handle.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_BTHOpen(COM_Handle* handle, 
		                                  u64 port);
    
/// \brief Checks a bluetooth tftp progress status.
/// \returns the current packet number.
HWCOM_EXPORTDLL u32 STAR_API COM_BTHDownloadProgress(void);
    
/// \brief Looks for paired bluetooth devices.
/// \returns the list of paired bluetooth devices.
HWCOM_EXPORTDLL struct PairedDevicesList* STAR_API COM_BTH_FindDevices(void);
#endif

/******************************************************************************
                A N A L Y S E R  F U N C T I O N S
******************************************************************************/


/// \brief Configures a channel.
/// \param handle Pointer to a handle representing the interface instance.
/// \param channelConfiguration the channel configuration.
/// \param timestampType the timestamp type.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AnalyzerConfigureChannelReq(COM_Handle handle, 
															  COM_ConfigureChannel channelConfiguration,
                                                              COM_TIMESTAMP_TYPE* timestampType);

/// \brief Configures (adds or removes) a message filter.
/// \param handle Pointer to a handle representing the interface instance.
/// \param filterConfiguration the filter configuration.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AnalyzerConfigureFilterReq(COM_Handle handle,
															 COM_ConfigureFilter filterConfiguration);

/// \brief Resets all message filters for the given bus type and channel id.
/// \param handle Pointer to a handle representing the interface instance.
/// \param busType the bus type.
/// \param channelId the channel id.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AnalyzerResetAllFiltersReq(COM_Handle handle, 
														     COM_BUSTYPE busType, 
                                                             u08 channelId);

/// \brief Starts the analyzer functionality.
/// \param handle Pointer to a handle representing the interface instance.
/// \param port the TCP port which should be used. If set to 0 the default port (15300) will be used.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AnalyzerStartReq(COM_Handle handle,
												   u16 port);

/// \brief Stops the analyzer functionality.
/// \param handle Pointer to a handle representing the interface instance.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AnalyzerStopReq(COM_Handle handle);

/// \brief Sends a sporadic (non cyclic) message.
/// \param handle Pointer to a handle representing the interface instance.
/// \param message the sporadic send message.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AnalyzerSendMessageReq(COM_Handle handle, 
														 COM_SendMessageSporadic message);

/// \brief Receives the analyzer messages.
/// \param handle Pointer to a handle representing the interface instance.
/// \param messages pointer to the messages structure.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AnalyzerReceiveMessages(COM_Handle handle, 
														  COM_ReceiveMessagesLegacy* messages);

/// \brief Gets the analyzer version.
/// \param handle Pointer to a handle representing the interface instance.
/// \param version pointer to the version structure.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AnalyzerVersionReq(COM_Handle handle, 
                                                 COM_Version* version);

/// \brief Configures the analyzer.
/// \param handle pointer to a handle representing the interface instance.
/// \param configAnalyzer pointer to the analyzer configuration structure.
/// \return COM_RETURN_NotSupported command not supported.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AnalyzerConfigureReq(COM_Handle handle, 
												COM_AnalyzerConfig* configAnalyzer);

/// \brief Starts analyzing for a specific channel.
/// \param handle Pointer to a handle representing the interface instance.
/// \param channelID ID of the channel to start.
/// \return COM_RETURN_NotSupported command not supported.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AnalyzerStartChannelReq(COM_Handle handle,
												u08 channelID,
												COM_TimeStamp* timestamp);

/// \brief Stops analyzing for a specific channel.
/// \param handle Pointer to a handle representing the interface instance.
/// \param channelID ID of the channel to stop.
/// \return COM_RETURN_NotSupported command not supported.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AnalyzerStopChannelReq(COM_Handle handle,
												u08 channelID);

/// \brief Sends a Message Container with Contained Messages to Device that will be sent on the bus.
/// \param handle Pointer to a handle representing the interface instance.
/// \param msg_container container with Contained Messages that will be sent by the device.
/// \return COM_RETURN_NotSupported command not supported.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidParameter COM_ANALYZER_ENTRY_TYPE_SPECIAL is one of the contained messages.
/// \return COM_RETURN_NotSupported EntryType is not supported.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Failed Send stream failed.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AnalyzerMessageContainerToDevice(COM_Handle handle,
												COM_MessageContainerSDK* msg_container);

/// \brief Sends Controls to the Device, which handle actions like saving and
/// deleting of the Configuration in persistent memory.
/// \param handle Pointer to a handle representing the interface instance.
/// \param persistence_command command that is executed on the Device.
/// \return COM_RETURN_NotSupported command not supported.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AnalyzerPersistenceControlReq(COM_Handle handle,
												COM_PERSISTENCE_COMMAND persistence_command);


/// \brief Get local IP of connected TCP socket. Only for TCP Streams!
/// \param handle Pointer to a handle representing the interface instance.
/// \param local_ip Returns the local IP.
/// \return COM_RETURN_NotSupported command not supported.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Failed function execution failed
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetLocalIP(COM_Handle handle,
												u32* local_ip);

/// \brief Configure PTP TimeSync for specific channel.
/// \param handle Pointer to a handle representing the interface instance.
/// \param ptp_config Configuration for PTP instance
/// \return COM_RETURN_NotSupported command not supported.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Failed function execution failed
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_ConfigurePtpTimeSync(COM_Handle handle,
												COM_PtpTimeSyncConfig ptp_config);

/// \brief Set new date and time for RTC.
/// \param handle Pointer to a handle representing the interface instance.
/// \param date_time New date and time information
/// \return COM_RETURN_NotSupported command not supported.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Failed function execution failed
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_SetRtcDateTimeReq(COM_Handle handle, 
												COM_RtcDateTime date_time);

/// \brief Get date and time from RTC.
/// \param handle Pointer to a handle representing the interface instance.
/// \param date_time Returned date and time information from RTC
/// \return COM_RETURN_NotSupported command not supported.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Failed function execution failed
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetRtcDateTimeReq(COM_Handle handle,
												COM_RtcDateTime* date_time);

/// \brief Control send UDS cyclic message.
/// \param handle Pointer to a handle representing the interface instance.
/// \param diag_config Configuration/Control parameter for sneding cyclic disgnostic request message 
/// \return COM_RETURN_NotSupported command not supported.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Failed function execution failed
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_ConfigureDiagnosticReq(COM_Handle handle,
	COM_DiagnosticConfig diag_config);


/// \brief Configures Analyzer logging.
/// \param handle Pointer to a handle representing the interface instance.
/// \param logging_config the logging configuration.
/// \param prefix the logging file prefix
/// \param subfolder the logging file subfolder name
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AnalyzerConfigureLoggingReq(COM_Handle handle,
    COM_AnalyzerConfigureLogging logging_config, const char* prefix, const char* subfolder);

/******************************************************************************
                                RBS REPLAY  
******************************************************************************/

/// \brief Configures the RBS Replay module.
/// \param handle Pointer to a handle representing the interface instance.
/// \param replay_config Replay Module configuration.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_ReplayConfigureReq(COM_Handle handle, COM_ReplayConfigure replay_config);

/// \brief Controls the RBS Replay Module.
/// \param handle Pointer to a handle representing the interface instance.
/// \param replay_control Replay Module control parameters.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_ReplayControlReq(COM_Handle handle, COM_ReplayControl replay_control);

/// \brief Stream Measurement trace to device replay module. 
/// \param handle Pointer to a handle representing the interface instance.
/// \param replay_stream Replay Module stream entry.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_ReplayStreamReq(COM_Handle handle, COM_ReplayStream replay_stream);

/// \brief Adds Stream Measurement trace to Replay container. 
/// \param handle Pointer to a handle representing the interface instance.
/// \param replay_stream Replay Module stream entry.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_ReplayStreamContainerAddReq(COM_Handle handle, COM_ReplayStream replay_stream);

/// \brief Stream Multiple Contained Measurement trace to device replay module. 
/// \param handle Pointer to a handle representing the interface instance.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_ReplayStreamContainerSendReq(COM_Handle handle);

/// \brief Returns the replay module statistics used by the device.
/// \param handle Pointer to a handle representing the interface instance.
/// \param replay_statistics The returned statistics from the replay mudule at the hardware.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_ReplayStatisticsReq(COM_Handle handle,
    COM_ReplayStatistics* replay_statistics);

/// \brief Adds a 64 bit Manipulation with UID to the list of Manipulations
/// \param handle Pointer to a handle representing the interface instance.
/// \param addRbsManipulation64Req The request of the message that is sent
/// \param addRbsManipulation64Res The returned response of the message
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_AddRbsManipulation64Req(COM_Handle handle,
    const COM_AddRbsManipulation64* addRbsManipulation64Req,
    COM_AddRbsManipulation64Res* addRbsManipulation64Res);

/// \brief Starts 64 bit Manipulations from a list of UIDs. Manipulations need to be added or loaded beforehand.
/// \param handle Pointer to a handle representing the interface instance.
/// \param startRbsManipulation64Req List of manipulations that should be started.
/// \param startRbsManipulation64Res The returned list of manipulations that got started.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_StartRbsManipulation64Req(COM_Handle handle,
    const COM_StartRbsManipulation64* startRbsManipulation64Req,
    COM_StartRbsManipulation64Res* startRbsManipulation64Res);

/// \brief Starts 64 bit Manipulations from a list of UIDs cyclically. Manipulations need to be added or loaded beforehand.
/// \param handle Pointer to a handle representing the interface instance.
/// \param startRbsManipulationCyclic64Req List of manipulations that should be started cyclically.
/// \param startRbsManipulationCyclic64Res The returned list of manipulations that got started cyclically.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_StartRbsManipulationCyclic64Req(COM_Handle handle,
    const COM_StartRbsManipulationCyclic64* startRbsManipulationCyclic64Req,
    COM_StartRbsManipulationCyclic64Res* startRbsManipulationCyclic64Res);

/// \brief Stops 64 bit Manipulations from a list of UIDs. Manipulations need to be added or loaded beforehand.
/// \param handle Pointer to a handle representing the interface instance.
/// \param stopRbsManipulation64 List of manipulations that should be stopped.
/// \param stopRbsManipulation64Res The returned list of manipulations that got stopped.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_StopRbsManipulation64Req(COM_Handle handle,
    const COM_StopRbsManipulation64* stopRbsManipulation64,
    COM_StopRbsManipulation64Res* stopRbsManipulation64Res);

/// \brief Remove 64 bit Manipulations from a list of UIDs. Manipulations need to be added or loaded beforehand.
/// \param handle Pointer to a handle representing the interface instance.
/// \param removeRbsManipulation64 List of manipulations that should be removed.
/// \param removeRbsManipulation64Res The returned list of manipulations that got removed.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_RemoveRbsManipulation64Req(COM_Handle handle,
    const COM_RemoveRbsManipulation64* removeRbsManipulation64,
    COM_RemoveRbsManipulation64Res* removeRbsManipulation64Res);

/// \brief Return list of all active manipulations.
/// \param handle Pointer to a handle representing the interface instance.
/// \param getRbsActiveManipulations64Res The returned list of active manipulations.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetRbsActiveManipulations64Req(COM_Handle handle,
    COM_GetRbsActiveManipulations64Res* getRbsActiveManipulations64Res);

/// \brief Get list of manipulations with their status.
/// \param handle Pointer to a handle representing the interface instance.
/// \param getRbsManipulationStatus64 List to get manipulation status for.
/// \param getRbsManipulationStatus64Res The returned list with manipulation UID and status.
/// \return COM_RETURN_OK Function executed successfully.
/// \return COM_RETURN_InvalidHandle The handle is not a valid PC HW interface handle.
/// \return COM_RETURN_Timeout The hardware is not responding.
/// \return else Error code of the called function in the hardware.
HWCOM_EXPORTDLL COM_RETURN STAR_API COM_GetRbsManipulationStatus64Req(COM_Handle handle,
    const COM_GetRbsManipulationStatus64* getRbsManipulationStatus64,
    COM_GetRbsManipulationStatus64Res* getRbsManipulationStatus64Res);

#endif  /* #define _STAR_PCHWCOM_H_ */
