EtherNet/IP™ Adapter3.09.00
 
Loading...
Searching...
No Matches

◆ DIO_DEVICE_CFG_isValid()

bool DIO_DEVICE_CFG_isValid ( void  )

Checks header of non volatile runtime structure against discrete IO device profile header.

Called by DEVICE_PROFILE_INTF_cfgIsValid function of device profile interface. Function needs to be registered by DEVICE_PROFILE_register call.

Remarks
Function is called directly after non volatile memory read to check data consistency.
Returns
value as bool.
Return values
trueHeader is corresponding to header of discrete IO device profile and non volatile data are valid.
falseHeader is not corresponding to header of discrete IO device profile or non volatile data are corrupted.
Example
#include "device_profiles/discrete_io_device/discrete_io_device_cfg.h"
{
uint32_t error = DEVICE_PROFILE_INTF_ERR_General;
if (NULL == pIntf)
{
error = DEVICE_PROFILE_INTF_ERR_PtrInvalid;
goto laError;
}
...
...
error = DEVICE_PROFILE_INTF_ERR_OK;
laError:
return error;
}
bool DIO_DEVICE_CFG_isValid(void)
Checks header of non volatile runtime structure against discrete IO device profile header.
Definition discrete_io_device_cfg.c:442
uint32_t DEVICE_PROFILE_register(DEVICE_PROFILE_INTF_Interface_t *pIntf)
Registers discrete IO device profile interface functions.
Definition discrete_io_device.c:251
struct DEVICE_PROFILE_INTF_Interface::@7 cfg
bool(* isValid)(void)
Definition device_profile_intf_intern.h:58
Definition device_profile_intf_intern.h:46
See also
DEVICE_PROFILE_register DEVICE_PROFILE_INTF_cfgIsValid