78 lines
2.4 KiB
C
78 lines
2.4 KiB
C
/****************************************************************************
|
|
|
|
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
|
|
|
|
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
|
|
be copied by any method or incorporated into another program without
|
|
the express written consent of Aerospace C.Power. This Information or any portion
|
|
thereof remains the property of Aerospace C.Power. The Information contained herein
|
|
is believed to be accurate and Aerospace C.Power assumes no responsibility or
|
|
liability for its use in any way and conveys no license or title under
|
|
any patent or copyright and makes no representation or warranty that this
|
|
Information is free from patent or copyright infringement.
|
|
|
|
****************************************************************************/
|
|
#ifndef __CVG_NWM_CTRL_PROTO_H
|
|
#define __CVG_NWM_CTRL_PROTO_H
|
|
|
|
#include "os_types.h"
|
|
#include "plc_fr.h"
|
|
#include "cvg.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* controller protocol connection info */
|
|
typedef struct _cvg_nwm_ctrl_proto_info {
|
|
/* flag to mark if the controller protocol connection exists */
|
|
uint8_t is_ready : 1,
|
|
/* flag to mark if is controller role */
|
|
is_controller : 1,
|
|
/* reserved for further use */
|
|
rsvd : 6;
|
|
/* remote device TEI */
|
|
tei_t tei;
|
|
} cvg_nwm_ctrl_proto_info_t;
|
|
|
|
#if (PLC_SUPPORT_EXT_PROTO)
|
|
|
|
/*
|
|
* @brief cvg_nwm_ctrl_proto_get_info() - get controller protocol connection
|
|
* info.
|
|
* @param: vdev - vdev pointer
|
|
* @param: info - return controller protocol connection info.
|
|
*/
|
|
void cvg_nwm_ctrl_proto_get_info(cvg_vdev_t *vdev,
|
|
cvg_nwm_ctrl_proto_info_t *info);
|
|
|
|
#if PLC_SUPPORT_STA_ROLE
|
|
|
|
/*
|
|
* @brief cvg_nwm_ctrl_proto_cfg_connect() - config controller protocol connect.
|
|
* @param: vdev - vdev pointer
|
|
* @param: addr - target addr to be connected.
|
|
* @retval: ERR_OK - for success case
|
|
* otherwise - for failure case
|
|
*/
|
|
uint32_t cvg_nwm_ctrl_proto_cfg_connect(cvg_vdev_t *vdev, uint8_t *addr);
|
|
|
|
#endif /* PLC_SUPPORT_STA_ROLE */
|
|
|
|
#else /* PLC_SUPPORT_EXT_PROTO */
|
|
|
|
#define cvg_nwm_ctrl_proto_get_info(vdev, info)
|
|
|
|
#if PLC_SUPPORT_STA_ROLE
|
|
|
|
#define cvg_nwm_ctrl_proto_cfg_connect(vdev, addr) (ERR_NOSUPP)
|
|
|
|
#endif /* PLC_SUPPORT_STA_ROLE */
|
|
|
|
#endif /* PLC_SUPPORT_EXT_PROTO */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __CVG_NWM_CTRL_PROTO_H */ |