#ifndef _MGC_CHNL_INFO_H
#define _MGC_CHNL_INFO_H

#include "mgc_struct.h"

void mgc_chnl_info_setup(void);
void mgc_chnl_info_init(CHNL_INFO *pChnlInfo , int id);
void mgc_chnl_info_clear(CHNL_INFO *pChnlInfo);
void mgc_chnl_info_status_set(CHNL_INFO *pChnlInfo , MGC_CHNL_INFO_STATUS status);
CHNL_INFO *mgc_chnl_info_get_unused_chnl(void);
CHNL_INFO *mgc_chnl_info_get_chnl(CHNL chnl);


BOOL mgc_chnl_info_attach_to_phy_port(CHNL_INFO *pChnlInfo , PHY_PORT_INFO *pPhyPort);
CHNL_INFO *mgc_chnl_info_find_chnl_of_phy(PHY_PORT_INFO *pPhyPort , int chnlNo);
int mgc_chnl_info_get_chnl_no_of_phy(CHNL_INFO *pChnlInfo , PHY_PORT_INFO *pPhyPort);


BOOL mgc_chnl_info_attach_connect(CHNL_INFO *pChnlInfo , CONNECT_INFO *pConnect , int connNo);
BOOL mgc_chnl_info_detach_connect(CHNL_INFO *pChnlInfo , CONNECT_INFO *pConnect);

CONNECT_INFO *mgc_chnl_info_assign_connect(CHNL_INFO *pChnlInfo , int connNo);
CONNECT_INFO *mgc_chnl_info_assign_idle_connect(CHNL_INFO *pChnlInfo);

void mgc_chnl_info_set_mon(int id, BOOL enable);
BYTE *mgc_chnl_info_get_res_addr(void);
char *mgc_chnl_info_print_status(CHNL_INFO *pChnlInfo);
char *mgc_chnl_info_print_remote(CHNL_INFO *pChnlInfo);
char *mgc_chnl_info_print_mode(CHNL_INFO *pChnlInfo);
char *mgc_chnl_info_print_codec(CHNL_INFO *pChnlInfo);

#endif
