removed unneccessary protocol message

This commit is contained in:
Volker Fischer 2009-09-04 08:03:48 +00:00
parent e664b5769c
commit 5bc9a2ea0c
4 changed files with 10 additions and 66 deletions

View file

@ -115,14 +115,6 @@ public:
void CreateChatTextMes ( const QString& strChatText ) { Protocol.CreateChatTextMes ( strChatText ); } void CreateChatTextMes ( const QString& strChatText ) { Protocol.CreateChatTextMes ( strChatText ); }
void CreatePingMes ( const int iMs ) { Protocol.CreatePingMes ( iMs ); } void CreatePingMes ( const int iMs ) { Protocol.CreatePingMes ( iMs ); }
void CreateNetwBlSiFactMes ( const int iNetwBlSiFact )
{
if ( ProtocolIsEnabled() )
{
Protocol.CreateNetwBlSiFactMes ( iNetwBlSiFact );
}
}
void CreateConClientListMes ( const CVector<CChannelShortInfo>& vecChanInfo ) void CreateConClientListMes ( const CVector<CChannelShortInfo>& vecChanInfo )
{ {
Protocol.CreateConClientListMes ( vecChanInfo ); Protocol.CreateConClientListMes ( vecChanInfo );

View file

@ -60,15 +60,6 @@ MESSAGES
note: does not have any data -> n = 0 note: does not have any data -> n = 0
- Network buffer block size factor: PROTMESSID_NET_BLSI_FACTOR
note: size, relative to minimum block size
+----------------+
| 2 bytes factor |
+----------------+
- Gain of channel: PROTMESSID_CHANNEL_GAIN - Gain of channel: PROTMESSID_CHANNEL_GAIN
+-------------------+--------------+ +-------------------+--------------+
@ -378,10 +369,6 @@ if ( rand() < ( RAND_MAX / 2 ) ) return false;
bRet = EvaluateServerFullMes ( vecData ); bRet = EvaluateServerFullMes ( vecData );
break; break;
case PROTMESSID_NET_BLSI_FACTOR:
bRet = EvaluateNetwBlSiFactMes ( vecData );
break;
case PROTMESSID_CHANNEL_GAIN: case PROTMESSID_CHANNEL_GAIN:
bRet = EvaluateChanGainMes ( vecData ); bRet = EvaluateChanGainMes ( vecData );
break; break;
@ -496,36 +483,6 @@ bool CProtocol::EvaluateServerFullMes ( const CVector<uint8_t>& vecData )
return false; // no error return false; // no error
} }
void CProtocol::CreateNetwBlSiFactMes ( const int iNetwBlSiFact )
{
CVector<uint8_t> vecData ( 2 ); // 2 bytes of data
unsigned int iPos = 0; // init position pointer
// build data vector
PutValOnStream ( vecData, iPos, static_cast<uint32_t> ( iNetwBlSiFact ), 2 );
CreateAndSendMessage ( PROTMESSID_NET_BLSI_FACTOR, vecData );
}
bool CProtocol::EvaluateNetwBlSiFactMes ( const CVector<uint8_t>& vecData )
{
unsigned int iPos = 0; // init position pointer
// check size
if ( vecData.Size() != 2 )
{
return true;
}
const int iData =
static_cast<int> ( GetValFromStream ( vecData, iPos, 2 ) );
// invoke message action
emit ChangeNetwBlSiFact ( iData );
return false; // no error
}
void CProtocol::CreateChanGainMes ( const int iChanID, const double dGain ) void CProtocol::CreateChanGainMes ( const int iChanID, const double dGain )
{ {
CVector<uint8_t> vecData ( 3 ); // 3 bytes of data CVector<uint8_t> vecData ( 3 ); // 3 bytes of data

View file

@ -40,7 +40,7 @@
#define PROTMESSID_ACKN 1 // acknowledge #define PROTMESSID_ACKN 1 // acknowledge
#define PROTMESSID_JITT_BUF_SIZE 10 // jitter buffer size #define PROTMESSID_JITT_BUF_SIZE 10 // jitter buffer size
#define PROTMESSID_REQ_JITT_BUF_SIZE 11 // request jitter buffer size #define PROTMESSID_REQ_JITT_BUF_SIZE 11 // request jitter buffer size
#define PROTMESSID_NET_BLSI_FACTOR 12 // network buffer size factor #define PROTMESSID_NET_BLSI_FACTOR 12 // OLD (not used anymore)
#define PROTMESSID_CHANNEL_GAIN 13 // set channel gain for mix #define PROTMESSID_CHANNEL_GAIN 13 // set channel gain for mix
#define PROTMESSID_CONN_CLIENTS_LIST 14 // connected client list #define PROTMESSID_CONN_CLIENTS_LIST 14 // connected client list
#define PROTMESSID_SERVER_FULL 15 // server full message #define PROTMESSID_SERVER_FULL 15 // server full message
@ -143,7 +143,6 @@ protected:
bool EvaluateJitBufMes ( const CVector<uint8_t>& vecData ); bool EvaluateJitBufMes ( const CVector<uint8_t>& vecData );
bool EvaluateReqJitBufMes ( const CVector<uint8_t>& vecData ); bool EvaluateReqJitBufMes ( const CVector<uint8_t>& vecData );
bool EvaluateNetwBlSiFactMes ( const CVector<uint8_t>& vecData );
bool EvaluateChanGainMes ( const CVector<uint8_t>& vecData ); bool EvaluateChanGainMes ( const CVector<uint8_t>& vecData );
bool EvaluateConClientListMes ( const CVector<uint8_t>& vecData ); bool EvaluateConClientListMes ( const CVector<uint8_t>& vecData );
bool EvaluateServerFullMes ( const CVector<uint8_t>& vecData ); bool EvaluateServerFullMes ( const CVector<uint8_t>& vecData );

View file

@ -74,7 +74,7 @@ public slots:
void OnTimer() void OnTimer()
{ {
// generate random protocol message // generate random protocol message
switch ( GenRandomIntInRange ( 0, 11 ) ) switch ( GenRandomIntInRange ( 0, 10 ) )
{ {
case 0: case 0:
Protocol.CreateJitBufMes ( GenRandomIntInRange ( 0, 10 ) ); Protocol.CreateJitBufMes ( GenRandomIntInRange ( 0, 10 ) );
@ -85,46 +85,42 @@ public slots:
break; break;
case 2: case 2:
Protocol.CreateNetwBlSiFactMes ( GenRandomIntInRange ( 0, 10 ) );
break;
case 3:
Protocol.CreateChanGainMes ( GenRandomIntInRange ( 0, 20 ), Protocol.CreateChanGainMes ( GenRandomIntInRange ( 0, 20 ),
GenRandomIntInRange ( -100, 100 ) ); GenRandomIntInRange ( -100, 100 ) );
break; break;
case 4: case 3:
Protocol.CreateServerFullMes(); Protocol.CreateServerFullMes();
break; break;
case 5: case 4:
Protocol.CreateReqConnClientsList(); Protocol.CreateReqConnClientsList();
break; break;
case 6: case 5:
Protocol.CreateChanNameMes ( QString ( "test%1" ).arg ( Protocol.CreateChanNameMes ( QString ( "test%1" ).arg (
GenRandomIntInRange ( 0, 1000 ) ) ); GenRandomIntInRange ( 0, 1000 ) ) );
break; break;
case 7: case 6:
Protocol.CreateChatTextMes ( QString ( "test%1" ).arg ( Protocol.CreateChatTextMes ( QString ( "test%1" ).arg (
GenRandomIntInRange ( 0, 1000 ) ) ); GenRandomIntInRange ( 0, 1000 ) ) );
break; break;
case 8: case 7:
Protocol.CreatePingMes ( GenRandomIntInRange ( 0, 100000 ) ); Protocol.CreatePingMes ( GenRandomIntInRange ( 0, 100000 ) );
break; break;
case 9: case 8:
Protocol.CreateReqNetwTranspPropsMes(); Protocol.CreateReqNetwTranspPropsMes();
break; break;
case 10: case 9:
Protocol.CreateAndImmSendAcknMess ( GenRandomIntInRange ( -10, 100 ), Protocol.CreateAndImmSendAcknMess ( GenRandomIntInRange ( -10, 100 ),
GenRandomIntInRange ( -100, 100 ) ); GenRandomIntInRange ( -100, 100 ) );
break; break;
case 11: case 10:
// arbitrary "audio" packet (with random sizes) // arbitrary "audio" packet (with random sizes)
CVector<uint8_t> vecMessage ( GenRandomIntInRange ( 1, 1000 ) ); CVector<uint8_t> vecMessage ( GenRandomIntInRange ( 1, 1000 ) );
OnSendProtMessage ( vecMessage ); OnSendProtMessage ( vecMessage );