Example Interface Set#
Note
An Interface Set is just a collection of Interface s. These may not be from the same developer or company as long as each interface name is unique within the set. Also data structures may be described in an Interface Set. An Interface Set can be composed of multiple header files. For components to be developed for a system the Interface Set of the system has to be known.
#include <interfaces/core.h>
#include <support/signal_support.h>
namespace vss
{
namespace Device
{
/**
* @brief IReceptionSignalSpeed abstract device interface, example of receiving a value
*/
interface IReceptionSignalSpeed_Event
{
/** Interface ID. */
static constexpr ::sdv::interface_id _id = 0xA012345678900400;
/**
* @brief Set Speed value (for example of type int32_t)
* @param[in] value of current speed
*/
virtual void SetSpeedValue(/*in*/ int32_t value) = 0;
};
/**
* @brief IReceptionSignalSpeed abstract device interface, example of receiving a value
*/
interface IReceptionSignalSpeed
{
/** Interface ID. */
static constexpr ::sdv::interface_id _id = 0xA012345678900500;
/**
* @brief Register IReceptionSignalSpeed_Event on signal change
* Register all events and call them on signal change
* @param[in] event function
*/
virtual void RegisterSpeedEvent(/*in*/ IReceptionSignalSpeed_Event* event) = 0;
/**
* @brief UnRegister IReceptionSignalSpeed_Event on signal change
* Register all events and call them on signal change
* @param[in] event function
*/
virtual void UnRegisterSpeedEvent(/*in*/ IReceptionSignalSpeed_Event* event) = 0;
};
}
}
namespace vss
{
namespace Service
{
/**
* @brief Vehicle speed service
*/
interface IReceptionSignalSpeed
{
/** Interface ID. */
static constexpr ::sdv::interface_id _id = 0xA012345678900600;
/**
* @brief Get Speed value (for example of type int32_t)
* @return Returns current speed
*/
virtual int32_t GetSpeedValue() = 0;
/**
* @brief Register Callback on signal change
* @param[in] callback function
*/
virtual void RegisterCallBack(/*in*/ vss::Device::IReceptionSignalSpeed_Event* callback) = 0;
/**
* @brief Unregister Callback
* @param[in] callback function
*/
virtual void UnregisterCallBack(/*in*/ vss::Device::IReceptionSignalSpeed_Event* callback) = 0;
};
}
}
Used by the example vehicle device and basic service.
#include <interfaces/core.h>
#include <support/signal_support.h>
namespace vss
{
namespace Device
{
/**
* @brief ITransferSignalBrakeForce interface, example of transferring a value
*/
interface ITransferSignalBrakeForce
{
/** Interface ID. */
static constexpr ::sdv::interface_id _id = 0xA012345678900800;
/**
* @brief Set brake force value
* @param[in] value brake force
* @return true on success otherwise false
*/
virtual bool SetBrakeForce(/*in*/ uint32_t value) = 0;
};
}
}
namespace vss
{
namespace Service
{
/**
* @brief ITransferSignalBrakeForce interface, example oftransferringg a value
*/
interface ITransferSignalBrakeForce
{
/** Interface ID. */
static constexpr ::sdv::interface_id _id = 0xA012345678900900;
/**
* @brief Set brake force value
* @param[in] value brake force
* @return true on success otherwise false
*/
virtual bool SetBrakeForce(/*in*/ uint32_t value) = 0;
};
}
}
Used by the example vehicle device and basic service.