⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sysdep.h

📁 基于h323协议的软phone
💻 H
字号:
/***************************************************************************
*
*  Module:         SysDep.h
*
*  Description:    Phone-On-A-Chip system dependent routines.
*
*  Author:         Doug Oucharek
*
*  Copyright 2000, Trillium Digital Systems, Inc., All rights reserved
*
*
*  Change Log:
*
*  Date        By      Description
*  ========    ===     ====================================================
*  01/31/00    DSO     Created
*  03/09/2000  MWB     Add support for gatekeeper rediscovery
*  03/12/2001  mwb     Add wrapper events for 3rd-party pause
*  07/12/2001  sree    add support for h323- reconfiguration.
*  08/07/2001  sree    Added support for H.245 User input Ind msgs
*
***************************************************************************/

#ifndef __SYSDEP_H__
#define __SYSDEP_H__

#include "event.h"


#ifndef NOWP
#include "rvwpt.h"
#endif


/*
 * VxWorks include files
 */

#include <MsgQLib.h>
#include <TaskLib.h>

/*
 * Defines
 */
#define BEP_WAIT_FOREVER WAIT_FOREVER
#define MAX_NUM_EVENTS 16

#define MAX_BUFFERS MAX_NUM_EVENTS

/******************************************************************************
 *                                                                            *
 * TYPEDEFS
 *                                                                            *
 *****************************************************************************/


 

/*
 * Non-Wrapper Message:
 * This is the format of messages received from the KeyLampTask.  Note: the
 * event entity must be the first entry and must match the size of the event
 * entry in the Wrapper message.
 */
 
typedef struct
{
    int          event;
    char         digit;
} NonWrapperMsg;

#ifdef BOOT_ROM_ONLY
#define MAX_BUF_LEN sizeof(NonWrapperMsg)
typedef struct 
{
    int   InUse;
    char  Buf[MAX_BUF_LEN];
} BufDef;

#endif /* ifdef BOOT_ROM_ONLY */

#if defined(HC) || defined(SO) || defined(MGCP)

#ifndef NOWRAPPER
#define MAX_BUF_LEN sizeof(WrapperMsg)
#else
#define MAX_BUF_LEN sizeof(NonWrapperMsg)
#endif

typedef struct 
{
    int   InUse;
    char  Buf[MAX_BUF_LEN];
} BufDef;
#endif /* defined(HC) || defined(SO) */

/******************************************************************************
 *                                                                            *
 * Message Queue Handling Routines.  These include buffer handling routines.
 *                                                                            *
 *****************************************************************************/

/***************************************************************************
 *
 *  MQInit()
 *
 *  Arguments
 *      Input: None
 *
 *  Returns:   int - return code of queue creation.
 *
 *  Description:
 *  1. Create the message queue.
 *  2. Create a buffer pool for sending and receiving messages.
 *
 **************************************************************************/ 

int MQInit( void );

/***************************************************************************
 *
 *  MQSend()
 *
 *  Arguments
 *      Input: char* - pointer to buffer to send.
 *
 *  Returns:   int - return code of send.
 *
 *  Description:
 *  1. Send the given message to the owner of the message queue.
 *
 **************************************************************************/ 

int MQSend( char *givenMsg, int WaitTime );

/***************************************************************************
 *
 *  MQReceive()
 *
 *  Arguments
 *      Input: int - time to wait for.
 *
 *  Returns:   Pointer to returned buffer after event character (parameters).
 *             Event which was received (pointer parameter)
 *
 *  Description:
 *  1. Get a message off of my message queue.
 *
 **************************************************************************/ 

char *MQReceive( int *theEvent, int WaitTime );

/***************************************************************************
 *
 *  MQBufFree()
 *
 *  Arguments
 *      Input: Pointer to buffer being returned.
 *
 *  Returns:   Nothing
 *
 *  Description:
 *  1. Put the given message buffer back into the buffer pool.
 *
 **************************************************************************/ 

void MQBufFree( char *retBuf );

/***************************************************************************
 *
 *  MQBufGet()
 *
 *  Arguments
 *      Input: None
 *
 *  Returns:   Pointer to buffer (char *) or NULL if no buffers.
 *
 *  Description:
 *  1. Get a message buffer from the buffer pool.
 *
 **************************************************************************/ 

char *MQBufGet( void );


/******************************************************************************
 *                                                                            *
 * Task Spawn Handling Routines.
 *                                                                            *
 *****************************************************************************/
 
/***************************************************************************
 *
 *  SpawnTask()
 *
 *  Arguments
 *      Input: char* - String with name for task.
 *             FUNCPTR - Pointer to function which is main for task.
 *             char - boolean indicating if the taskProc should be passed the
 *                    message queue ID.
 *
 *  Returns:   int - return code for task spawn.
 *
 *  Description:
 *  1. Spawn off a listening task and get it running the indicated routine.
 *
 **************************************************************************/ 

extern int SpawnTask( char *taskId, FUNCPTR taskProc, char giveMsgQueue, 
		int priority, int stackSize );


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -