source: svn/newcon3bcm2_21bu/dst/dmw/src/System/DMW_MsgQue.h @ 22

Last change on this file since 22 was 22, checked in by phkim, 11 years ago
  1. phkim
  2. newcon3sk 를 kctv 로 브랜치 함
  • Property svn:executable set to *
File size: 2.2 KB
Line 
1/*
2        DMW_MsgQue.h
3       
4       
5*/
6
7
8#ifndef __DMW_MSGQUE_H__
9#define __DMW_MSGQUE_H__
10
11
12
13typedef struct
14{
15        UINT8 *MsgBuf;
16       
17        int nMsgSize;    // Msg ÇѰ³ÀÇ Å©±â. »ç¿ëÀÚ Á¤ÀÇ typeÀÇ sizeof() Å©±â¶ó°í º¸¸é µÈ´Ù.
18        int nMaxQueSize;
19        int nNumberMsg;
20       
21        DHL_OS_SEMA_ID Mutex;
22        DHL_OS_SEMA_ID Sema4; // counting sema4
23       
24        char *(*pfnMsgName)(void *pMsg);
25       
26} DMW_MSGQUE;
27
28
29typedef char *(*DMW_FN_MSG_NAME)(void *msg);
30typedef BOOL  (*DMW_FN_MSG_CHECK)(void *msg, UINT32 param);
31typedef void  (*DMW_FN_MSG_DELETE)(void *msg);
32
33STATUS DMW_SYS_InitMsgQue(DMW_MSGQUE *hMsgQue, int nMsgSize, int nInitialQueSize,
34                                                        DMW_FN_MSG_NAME pfnName);
35        // MsgQue¸¦ ÃʱâÈ­ ÇÑ´Ù.
36        // nMsgSize´Â »ç¿ëÀÚ ¸Þ½ÃÁö ÇϳªÀÇ byte Å©±âÀÌ´Ù.
37        // pfnNameÀº µð¹ö±ë ¿ëµµ·Î »ç¿ëµÇ¸ç, °¢ ¸Þ½ÃÁö¿¡ À̸§À» ºÎ¿©ÇÏ¿© consol¿¡ Ãâ·ÁÇÒ ¶§ »ç¿ë.
38        // »ç¿ëÇÏÁö ¾ÊÀ¸·Á¸é NULLÀ» ÁöÁ¤ÇÑ´Ù.
39       
40
41STATUS DMW_SYS_AddUserMsg(DMW_MSGQUE *hMsgQue, void *pMsg);
42STATUS DMW_SYS_GetUserMsg(DMW_MSGQUE *hMsgQue, void *pMsg, UINT32 uTimeoutTicks);
43        // timeout Àº MsgQue¿¡ ¸Þ½ÃÁö°¡ ¾ø´Â °æ¿ì ±â´Ù¸®°Ô µÉ ½Ã°£ÀÌ´Ù.
44        // 0 ÀÌ¸é ±â´Ù¸®Áö ¾ÊÀ½. ¸Þ½ÃÁö°¡ ¾øÀ¸¸é ¹Ù·Î ¿¡·¯¸¦ ¸®ÅÏÇÑ´Ù.
45        // (UINT32)-1 À̸é timeout ¾øÀÌ ¹«ÇÑÁ¤ ±â´Ù¸°´Ù.
46        // timeout °ªÀº OS tick ´ÜÀ§ÀÓ.
47
48BOOL   DMW_SYS_UserMsgExist(DMW_MSGQUE *hMsgQue);
49        // ¸Þ½ÃÁö°¡ Çϳª¶óµµ Á¸ÀçÇϸé true¸¦ ¸®ÅÏ.
50
51BOOL   DMW_SYS_CheckSpecificMsgExist(DMW_MSGQUE *hMsgQue, 
52                                                                DMW_FN_MSG_CHECK pfnCheck, UINT32 param);
53        // ƯÁ¤ ¸Þ½ÃÁö°¡ Á¸ÀçÇÏ´ÂÁö üũÇÒ ¶§ »ç¿ë.
54        // ¸Þ½ÃÁö ºñ±³ (comparion check) ÇÔ¼ö Æ÷ÀÎÅ͸¦ ÀÎÀÚ·Î Á¦°øÇØ¾ß ÇÑ´Ù.
55       
56       
57STATUS DMW_SYS_DeleteMsgConditionally(DMW_MSGQUE *hMsgQue, 
58                                                                DMW_FN_MSG_CHECK fnCondition, UINT32 param,
59                                                                DMW_FN_MSG_DELETE fnDelete);
60        // ƯÁ¤ Á¶°Ç¿¡ ¸Â´Â ¸Þ½ÃÁö¸¦ Queue¿¡¼­ »èÁ¦.
61        //
62       
63void   DMW_SYS_PrintUserMsgs(DMW_MSGQUE *hMsgQue, DMW_FN_MSG_NAME fnName2);
64        // ¸Þ½ÃÁö Å¥ÀÇ ³»¿ëÀ» consol¿¡ Ç¥½Ã.
65        // ¸Þ½ÃÁö´Â ±×³É void * ·Î °£ÁֵǾî ÀúÀåµÇ¾ú±â ¶§¹®¿¡
66        // ¾î¶² ¸Þ½ÃÁöÀÎÁö¸¦ ¾Ë·ÁÁÖ´Â naming functionÀ» Á¦°øÇØ¾ß °¢ ¸Þ½ÃÁö¸¦ ±¸º°ÇØ º¼¼ö ÀÖ´Ù.
67       
68        // ¿©±â¼­ ÀÎÀÚ·Î ÁöÁ¤ÇÑ naming functionÀÌ MsgQue¸¦ óÀ½ »ý¼ºÇÒ ¶§
69        // ÁöÁ¤Çß´ø naming function º¸´Ù ¿ì¼±ÇÑ´Ù.
70        // Áï fnName2°¡ NULLÀ̸é pfnNameÀ» »ç¿ëÇÔ.
71
72
73#endif // __DMW_MSGQUE_H__
74
Note: See TracBrowser for help on using the repository browser.