comparison g23m/condat/ms/src/aci/dcm_handle_message.c @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-F&D (8411)
4 | Modul : ACI
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Description : DCM handle_msg function, which is called when DCM
18 | receives a new message by application or rAT_function.
19 +-----------------------------------------------------------------------------
20 */
21
22
23 /*********************************** INCLUDES ********************************************/
24 #include "aci_all.h"
25 #include "dcm.h"
26 #include "dcm_utils.h"
27 #include "dcm_state.h"
28 #include "dcm_env.h"
29
30 /**************************** LOCAL VARIABLE DEFINITION ***********************************/
31 /**************************** EXTERN VARIABLE DEFINITION **********************************/
32 extern T_DCM_ENV_CTRL_BLK *dcm_env_ctrl_blk_p;
33
34 /**************************** LOCAL FUCNTION DEFINITION ***********************************/
35 /************************** EXTERN FUCNTION DEFINITION ************************************/
36
37
38 /******************************************************************************************
39 * Function : dcm_handle_message
40 * Description : Called every time DCM is in WAITING state or
41 * When receiving message from Application or rAT_function
42 * Parameter : T_DCM_HDR
43 * -Pointer on the header of the message.
44 * Return : T_DCM_RET DCM
45 * -DCM Result : DCM_OK, DCM_NOT_READY.
46 * History : 0001 03/09/17 CJH Created
47 ********************************************************************************************/
48 T_DCM_RET dcm_handle_message(T_DCM_HDR *msg_p)
49 {
50 T_DCM_GET_CURRENT_CONN_REQ_MSG *current_conn_info;
51
52 TRACE_FUNCTION("DCM: dcm_handle_message()");
53 dcm_display_message(msg_p->msg_id);
54 dcm_dispay_state((U8)dcm_env_ctrl_blk_p->state[0],
55 (U8)dcm_env_ctrl_blk_p->substate[0]);
56
57 if (msg_p != NULL)
58 {
59 /* get current conn req is always received regardless of current state..*/
60 if(msg_p->msg_id == DCM_GET_CURRENT_CONN_REQ_MSG)
61 {
62 TRACE_EVENT("DCM: DCM_GET_CURRENT_CONN_REQ_MSG");
63 current_conn_info = (T_DCM_GET_CURRENT_CONN_REQ_MSG*)msg_p;
64 dcm_process_get_current_conn_event(current_conn_info);
65 return DCM_OK;
66 }
67 switch (dcm_env_ctrl_blk_p->state[0])
68 {
69 case DCM_IDLE:
70 TRACE_EVENT("DCM: DCM_IDLE") ;
71 /* there is no current action */
72 return dcm_idle(msg_p);
73
74 case DCM_ACTIVATING_CONN:
75 TRACE_EVENT("DCM: DCM_ACTIVATING_CONN") ;
76 /* An IP User have asked the opening of a connection */
77 return dcm_activating_conn(msg_p);
78
79 case DCM_CONN_ACTIVATED:
80 TRACE_EVENT("DCM: DCM_CONN_ACTIVATED") ;
81 /* At leat, on connection is active */
82 return dcm_conn_activated(msg_p);
83
84 case DCM_CLOSING_CONN:
85 TRACE_EVENT("DCM: DCM_CLOSING_CONN") ;
86 /* An IP User have asked the closing of a connection */
87 return dcm_closing_conn(msg_p);
88
89 default:
90 TRACE_EVENT("DCM: unknown state") ;
91 return DCM_NOT_READY;
92 }
93 }
94 else
95 {
96 TRACE_ERROR("DCM: NULL message") ;
97 return DCM_INVALID_PARAMETER;
98 }
99 }