h324LineErrorReporting

Turns on error reporting statistics in the H.223 demultiplexer. Use the statistics to determine the quality of the inbound radio link from the H.324 terminal to the demultiplexer.

Prototype

DWORD h324LineErrorReporting ( MSPHD msphd, DWORD command, WORD param1, WORD param2)

Argument

Description

msphd

MSPP handle associated with the MUX.

command

Valid values are:

H324_LINE_STAT_CMD_ERROR_EVENT - Sends an error event when the specified error is detected.

H324_LINE_STAT_CMD_PERIODIC - Periodically reports line error counts.

H324_LINE_STAT_CMD_RESET_STAT - Resets all line error counts to zero.

param1

param1 value depends upon the value selected for command:

If command is...

The param1 value...

H324_LINE_STAT_CMD_ERROR_EVENT

Enables or disables specific error reporting. Valid values are:

0 - Disable

1 - Enable

H324_LINE_STAT_CMD_PERIODIC

Enables or disables periodic error reporting. Valid values are:

0 - Disable

1 - Enable

H324_LINE_STAT_CMD_RESET_STAT

Is not used.

param2

param2 value depends upon the value selected for command:

If command is...

The param2 value...

H324_LINE_STAT_CMD_ERROR_EVENT

Is a bit mask that selects which error triggers an error report event. Bit mask values are:

1 - Video CRC error

2 - Audio CRC error

4 - Golay coding error in PDU header

H324_LINE_STAT_CMD_PERIODIC

Defines the time in seconds between periodic reports.

H324_LINE_STAT_CMD_RESET_STAT

Not used.

Return values

Return value

Description

SUCCESS

 

CTAERR_NOT_FOUND

msphd was not found. Either h324Start was not called or h324Delete was called.

H324ERR_INTERNAL_ERROR

Internal error in the 3G-324M Middleware.

H324ERR_MUTEX_LOCK_FAILED

Internal error trying to lock mutex.

H324ERR_NOT_INITIALIZED

h324Initialize was not called first.

Events

Event

Description

MSPEVN_DEMUX_CRC_ERR_REPORTS

Demux detected a line error, and is sending event data in a structure of type MSP_ENDPOINT_DEMUX_CRC_ERROR_REPORTS:

typedef struct tag_msp_ENDPOINT_DEMUX_CRC_ERROR_REPORTS
{
    DWORD FilterId;
    WORD  EvnBase;
    WORD  EvnId;
    DWORD error_check_type; 
              // 1 = video CRC check
              // 2 = audio CRC check
              // 4 = header Golay coding check
    DWORD total_num_errors;
} msp_ENDPOINT_DEMUX_CRC_ERROR_REPORTS;

MSPEVN_DEMUX_GET_PERIODIC_STATS

Demux sent its periodic error statistics. The buffer contains a structure of type MSP_ENDPOINT_DEMUX_PERIODIC_STATS:

typedef struct tag_msp_ENDPOINT_DEMUX_PERIODIC_STATS
{
    DWORD   FilterId;
    WORD    EvnBase;
    WORD    EvnId;
    DWORD   num_videoCRCerrors;
    DWORD   num_videoCRCsuccesses;
    DWORD   num_audioCRCerrors;
    DWORD   num_audioCRCsuccesses;
    DWORD   num_headerGolayerrors;
    DWORD   num_headerGolaysuccesses;
    DWORD   reserved1;
    DWORD   reserved2;
} msp_ENDPOINT_DEMUX_PERIODIC_STATS;

Example

printf("\n\tEnable/Disable Periodic Statistics (0=Disable, 1=Enable) > ");
fflush(stdin);
scanf("%hd", &value1);
printf("\n\tSet Periodic Statistics Interval (1-10 seconds X 10) > ");
fflush(stdin);
scanf("%hd", &value2);
h324LineErrorReporting
( GwConfig[0].MuxEp.hd,
                        H324_LINE_STAT_CMD_PERIODIC,
                        value1,
                        value2);


...


// received an asynchronous event: CTA_EVENT *pevent
switch (pevent->value)
{
  case (MSPEVN_DEMUX_PERIODIC_STATS):
     if((GwConfig[nGw].MuxEp.hd == pevent->objHd) && (pevent->buffer != NULL)
       && (pevent->size > 0))
       ShowDemuxPeriodicStats(nGw, (msp_ENDPOINT_DEMUX_PERIODIC_STATS *)pevent->buffer);
       break;

  case (MSPEVN_DEMUX_CRC_ERR_REPORT):
     if(GwConfig[nGw].MuxEp.hd == pevent->objHd)
     {
      msp_ENDPOINT_DEMUX_CRC_ERROR_REPORTS *err = (msp_ENDPOINT_DEMUX_CRC_ERROR_REPORTS*)pevent->buffer;
       switch( NMS2H_DWORD(err->error_check_type
        {
          case 1:  // Video CRC Error
            printf("VIDEO CRC ERROR Received at Demux,
                   Error Count = %d\n",
                   NMS2H_DWORD(err->total_num_errors)  );
            break;
          case 2:  // Audio CRC Error
            printf("AUDIO CRC ERROR Received at Demux, Error Count = %d\n",
                   NMS2H_DWORD(err->total_num_errors) );
            break;
          case 4:  // Golay
            printf("HEADER GOLAY CODING ERROR Received at Demux,
                   Error Count = %d\n",
                   NMS2H_DWORD(err->total_num_errors) );
                   break;
        }
     }
break;