74 lines
2.0 KiB
C
74 lines
2.0 KiB
C
/*
|
|
* co_srd.h - contains defines for srd services
|
|
*
|
|
* Copyright (c) 2014-2023 emotas embedded communication GmbH
|
|
*
|
|
*-------------------------------------------------------------------
|
|
* $Id: co_srd.h 49615 2023-09-26 14:21:27Z boe $
|
|
*-------------------------------------------------------------------
|
|
*
|
|
*
|
|
*/
|
|
|
|
/**
|
|
* \brief defines for srd services
|
|
*
|
|
* \file co_srd.h - contains defines for srd services
|
|
*
|
|
*/
|
|
|
|
#ifndef CO_SRD_H
|
|
#define CO_SRD_H 1
|
|
|
|
#include <co_datatype.h>
|
|
|
|
|
|
/* datatypes */
|
|
|
|
/**
|
|
* request type for SDO register
|
|
*/
|
|
typedef enum {
|
|
CO_SRD_REQ_TYPE_ALL_SDOS = 3, /**< request all default Server SDOs */
|
|
CO_SRD_REQ_TYPE_NORMAL = 1 /**< request one SDO connection */
|
|
} CO_SRD_REQ_TYPE_T;
|
|
|
|
|
|
/**
|
|
* result values for indication function
|
|
*/
|
|
typedef enum {
|
|
CO_SRD_RESULT_SUCCESS, /**< requested service ok */
|
|
CO_SRD_RESULT_TIMEOUT, /**< time out occured, fct aborted */
|
|
CO_SRD_RESULT_ERROR, /**< error */
|
|
CO_SRD_RESULT_ALL_REQUEST_SUCCESS, /**< request all sdos ok */
|
|
CO_SRD_RESULT_NODE_REQUEST_SUCCESS /**< request connection ok */
|
|
} CO_SRD_RESULT_T;
|
|
|
|
|
|
/** \brief function pointer to srd result function
|
|
* \param result - result status of action
|
|
* \param errorcode - errorcode if
|
|
*
|
|
* \return void
|
|
*/
|
|
typedef void (* CO_EVENT_SRD_T)(CO_LINE_DECL, CO_SRD_RESULT_T result, UNSIGNED8 errorCode); /*lint !e960 customer specific parameter names */
|
|
|
|
|
|
/* function prototypes */
|
|
|
|
EXTERN_DECL RET_T coSrdRequestRegister(CO_LINE_DECL, CO_SRD_REQ_TYPE_T reqType,
|
|
UNSIGNED8 sdoClientChannel, UNSIGNED32 timeOut);
|
|
EXTERN_DECL RET_T coSrdReleaseRegister(CO_LINE_DECL, UNSIGNED32 timeOut);
|
|
EXTERN_DECL RET_T coSrdRequestConnection(CO_LINE_DECL,
|
|
UNSIGNED8 sdoClientChannel, UNSIGNED8 remoteNodeId,
|
|
UNSIGNED32 timeOut);
|
|
EXTERN_DECL RET_T coSrdReleaseConnection(CO_LINE_DECL,
|
|
UNSIGNED8 sdoClientChannel, UNSIGNED8 remoteNodeId,
|
|
UNSIGNED32 timeOut);
|
|
EXTERN_DECL RET_T coEventRegister_SRD(CO_EVENT_SRD_T pFunction);
|
|
EXTERN_DECL RET_T coSrdInit(CO_LINE_DECL);
|
|
|
|
#endif /* CO_SRD_H */
|
|
|