FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/L1/cfile/tch_feature.c @ 1005:908566db1538
gsm-fw feature tch-reroute: init and config fleshed out
author | Mychaela Falconia <falcon@ivan.Harhan.ORG> |
---|---|
date | Sun, 20 Mar 2016 18:50:54 +0000 |
parents | 9b147d0b2cab |
children | 3bfeee466b0a |
comparison
equal
deleted
inserted
replaced
1004:c83d3346d4b9 | 1005:908566db1538 |
---|---|
11 #include "tch_feature.h" | 11 #include "tch_feature.h" |
12 | 12 |
13 T_RVT_USER_ID tch_reroute_rvt_id; | 13 T_RVT_USER_ID tch_reroute_rvt_id; |
14 BOOL tch_reroute_downlink; | 14 BOOL tch_reroute_downlink; |
15 | 15 |
16 static void handle_tch_config_reg(T_RVT_BUFFER pkt) | |
17 { | |
18 UWORD8 config; | |
19 T_RVT_BUFFER buf; | |
20 T_RVT_RET rc; | |
21 | |
22 config = pkt[1] & 0x01; | |
23 tch_reroute_downlink = config; | |
24 | |
25 /* send TCH_CONFIG_CONF response */ | |
26 rc = rvt_mem_alloc(tch_reroute_rvt_id, 2, &buf); | |
27 if (rc == RVT_OK) { | |
28 buf[0] = TCH_CONFIG_CONF; | |
29 buf[1] = config; | |
30 rvt_send_trace_no_cpy(buf, tch_reroute_rvt_id, 2, | |
31 RVT_BINARY_FORMAT); | |
32 } | |
33 } | |
34 | |
16 /* | 35 /* |
17 * The following function is the callback registered with RVT; it gets | 36 * The following function is the callback registered with RVT; it gets |
18 * called in RVT HISR context. | 37 * called in RVT HISR context. |
19 */ | 38 */ |
20 static void tch_rvt_input_callback(T_RVT_BUFFER pkt, UINT16 pktlen) | 39 static void tch_rvt_input_callback(T_RVT_BUFFER pkt, UINT16 pktlen) |
21 { | 40 { |
22 /* guts to be filled */ | 41 if (pktlen < 1) |
42 return; | |
43 switch (pkt[0]) { | |
44 case TCH_CONFIG_REQ: | |
45 if (pktlen != 2) | |
46 return; | |
47 handle_tch_config_reg(pkt); | |
48 break; | |
49 case TCH_ULBITS_REQ: | |
50 /* to be filled */ | |
51 break; | |
52 } | |
23 } | 53 } |
24 | 54 |
25 void feature_tch_reroute_init() | 55 void feature_tch_reroute_init() |
26 { | 56 { |
27 rvt_register_id("TCH", &tch_reroute_rvt_id, tch_rvt_input_callback); | 57 rvt_register_id("TCH", &tch_reroute_rvt_id, tch_rvt_input_callback); |