You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.9 KiB
69 lines
1.9 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright © 2000-2002. All Rights Reserved.
|
|
// Version 1.0 01/01/2000
|
|
// Last modification: 08/10/2003
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: DataStreamsServer.cpp
|
|
// AUTHOR: Sergey Chizhevskiy
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Source file of DataStreamsServer.cpp
|
|
//----------------------------------------------------------------------------
|
|
#include "stdafx.h"
|
|
#include "boardreceiver.h"
|
|
#include "DataStreamsServer.h"
|
|
/*
|
|
#ifdef _DEBUG
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[]=__FILE__;
|
|
#define new DEBUG_NEW
|
|
#endif
|
|
*/
|
|
CDataStreamsServer::CDataStreamsServer()
|
|
{
|
|
|
|
}
|
|
|
|
CDataStreamsServer::~CDataStreamsServer()
|
|
{
|
|
|
|
}
|
|
|
|
BOOL CDataStreamsServer::RegisterChannel( CBoardReceiverDoc *pDoc )
|
|
{
|
|
CLgLocker Lock( &m_ChannelArray );
|
|
return m_ChannelArray.Add( pDoc );
|
|
}
|
|
|
|
BOOL CDataStreamsServer::UnregisterChannel( CBoardReceiverDoc *pDoc )
|
|
{
|
|
CLgLocker Lock( &m_ChannelArray );
|
|
return m_ChannelArray.Remove( m_ChannelArray.Find( pDoc ) );
|
|
}
|
|
|
|
BOOL CDataStreamsServer::DoRemoteBRChannelConnect( INT nChannel )
|
|
{
|
|
return FALSE;
|
|
}
|
|
|
|
BOOL CDataStreamsServer::DoRemoteBRGetChannelProperties()
|
|
{
|
|
CLgLocker Lock( &m_ChannelArray );
|
|
|
|
INT nChannelCount = m_ChannelArray.GetCount();
|
|
LG_TCP_PACKET_BOARD_RECEIVER::PCHANNEL_PROPERTIES pChannelProperties =
|
|
(LG_TCP_PACKET_BOARD_RECEIVER::PCHANNEL_PROPERTIES)malloc( sizeof(LG_TCP_PACKET_BOARD_RECEIVER::CHANNEL_PROPERTIES) * nChannelCount );
|
|
if( !pChannelProperties )
|
|
return FALSE;
|
|
|
|
for( INT i = 0; i < m_ChannelArray.GetCount(); i++ )
|
|
{
|
|
pChannelProperties[i].nChannelID = m_ChannelArray[i]->GetChannelID();
|
|
strcpy( pChannelProperties[i].pCommPort, m_ChannelArray[i]->GetChannelName() );
|
|
}
|
|
|
|
|
|
return OnRemoteBRGetChannelProperties( nChannelCount, pChannelProperties );
|
|
}
|