Files
kunlun/plc/cvg/nwm/inc/cvg_nwm_sta_ctrl_proto.h

79 lines
2.7 KiB
C
Raw Normal View History

2024-09-28 14:24:04 +08:00
/****************************************************************************
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_STA_CTRL_PROTO_H
#define CVG_NWM_STA_CTRL_PROTO_H
#include "plc_fr.h"
#ifdef __cplusplus
extern "C" {
#endif
#if (PLC_SUPPORT_STA_ROLE)
/*
* @brief cvg_nwm_sta_ctrl_proto_search_rx() - controller protocol search
* frames rx handle.
* @param: nwm - nwm vdev pointer.
* @param: buf - buf contains controller proto extended frames, this
* pkt will be consumed.
* @param: addr - target address to be searched.
* @param: src_tei - TEI of master dev(controller).
* @param: band_id - band id.
* @param: phase - logic phase.
* @param: sn - sn.
* @retval: next state of the whole state machine
*/
cvg_nwm_vdev_sta_state_t cvg_nwm_sta_ctrl_proto_search_rx(
cvg_nwm_vdev_t *nwm, iot_pkt_t *buf, uint8_t *addr, tei_t src_tei,
uint8_t band_id, uint8_t phase, uint8_t sn);
/*
* @brief cvg_nwm_sta_ctrl_proto_sync_rx() - controller protocol sync frames rx
* handle.
* @param: nwm - nwm vdev pointer.
* @param: nid - nid.
* @param: tei - source tei of extended controller proto sync frames.
* @param: band_id - band id.
* @param: phase - logic phase.
* @param: sn - sn.
*/
void cvg_nwm_sta_ctrl_proto_sync_rx(cvg_nwm_vdev_t *nwm, uint32_t nid,
tei_t tei, uint8_t band_id, uint8_t phase, uint8_t sn);
/*
* @brief cvg_nwm_sta_ctrl_proto_check() - period check of controller protocol
* for STA role.
* @param: nwm -- nwm vdev pointer
* @retval: ERR_OK - normal connection behavior
* @retval: otherwise - abnormal connection behavior
*/
uint8_t cvg_nwm_sta_ctrl_proto_check(cvg_nwm_vdev_t *nwm);
/*
* @brief cvg_nwm_ctrl_proto_connect() - initiate connection to target device.
* @param: nwm -- nwm vdev pointer
*/
void cvg_nwm_ctrl_proto_connect(cvg_nwm_vdev_t *nwm);
#endif /* PLC_SUPPORT_STA_ROLE */
#ifdef __cplusplus
}
#endif
#endif /* CVG_NWM_STA_CTRL_PROTO_H */