// PageQoS.cpp : implementation file // #include "stdafx.h" #include "mgrnve.h" #include "ConnectionManager.h" #include "PageQoS.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CPageQoS dialog CPageQoS::CPageQoS(CWnd* pParent, CMgrNVE* pMgrCM, CConnectionManager *pConnMgr) : CParamDlg(CPageQoS::IDD, pParent, pMgrCM, pConnMgr) { //{{AFX_DATA_INIT(CPageQoS) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT m_pNet5Api = NULL; } void CPageQoS::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CPageQoS) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CPageQoS, CDialog) //{{AFX_MSG_MAP(CPageQoS) ON_BN_CLICKED(IDC_BTN_QOS_APPLY, OnBtnQosApply) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CPageQoS message handlers void CPageQoS::OnBtnQosApply() { // TODO: Add your control notification handler code here char szCmd[NVE_SHORT_EXT_CMD_LENGTH]; ULONG uVideoDSCP, uAudioDSCP, uEventDSCP; uVideoDSCP = GetDlgItemInt(IDC_EDIT_VIDEO_DSCP); uAudioDSCP = GetDlgItemInt(IDC_EDIT_AUDIO_DSCP); uEventDSCP = GetDlgItemInt(IDC_EDIT_EVENT_DSCP); _snprintf(szCmd, sizeof(szCmd), "EXT_CMD / RTSP/1.0\r\n" "CSeq: 1\r\n" "CmdCount: 1\r\n" "SET QOS video_dscp=%d, audio_dscp=%d, event_dscp=%d\r\n\r\n", uVideoDSCP, uAudioDSCP, uEventDSCP); CHECK_AND_RETURN(m_pNet5Api->Net5Command(NET5_NC_SEND_RTSP_REQUEST, (ULONG*)szCmd, NULL, NULL, NULL), "Cannot set QoS information (cannot send request)"); CHECK_AND_RETURN(m_pNet5Api->Net5Command(NET5_NC_RECV_RTSP_RESPONSE, (ULONG*)szCmd, NULL, NULL, NULL), "Cannot set QoS information (cannot receive response)"); } BOOL CPageQoS::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here NVE_RTSP_VALUE RtspValue[NVE_MAX_RTSP_VALUE]; ULONG uVideoDSCP, uAudioDSCP, uEventDSCP; m_pNet5Api = m_pConnection->GetNet5Api(); m_pMsgMgr = m_pMgrNVE->GetMsgManager(); char szCmd[NVE_SHORT_EXT_CMD_LENGTH] = "EXT_CMD / RTSP/1.0\r\n" "CSeq: 1\r\n" "CmdCount: 1\r\n" "GET QOS\r\n\r\n"; CHECK_AND_RETURN_FALSE(m_pNet5Api->Net5Command(NET5_NC_SEND_RTSP_REQUEST, (ULONG*)szCmd, NULL, NULL, NULL), "Cannot get QoS information (cannot send request)"); CHECK_AND_RETURN_FALSE(m_pNet5Api->Net5Command(NET5_NC_RECV_RTSP_RESPONSE, (ULONG*)szCmd, NULL, NULL, NULL), "Cannot get QoS information (cannot receive response)"); ParseRTSPResponse(szCmd, RtspValue, NVE_MAX_RTSP_VALUE); FindRTSPValue(RtspValue, "video_dscp", &uVideoDSCP, NVE_RTSP_VALUE_INT); FindRTSPValue(RtspValue, "audio_dscp", &uAudioDSCP, NVE_RTSP_VALUE_INT); FindRTSPValue(RtspValue, "event_dscp", &uEventDSCP, NVE_RTSP_VALUE_INT); SetDlgItemInt(IDC_EDIT_VIDEO_DSCP, uVideoDSCP); SetDlgItemInt(IDC_EDIT_AUDIO_DSCP, uAudioDSCP); SetDlgItemInt(IDC_EDIT_EVENT_DSCP, uEventDSCP); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }