4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hocheol Seo <hocheol.seo@samsung.com>
7 * Injun Yang <injun.yang@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
25 #ifndef _DATA_ROUTER_H_
26 #define _DATA_ROUTER_H_
28 #include <sys/types.h>
33 #include <sys/socket.h>
40 #include <vconf-keys.h>
46 * @def USB_BUFFER_SIZE
47 * Defines the maximum buffer size for the USB
49 #define USB_BUFFER_SIZE 1500
50 #define ERRMSG_SIZE 100
54 * This structure has information about the Modem
59 volatile unsigned int dtr:1;
60 volatile unsigned int rts:1;
61 volatile unsigned int reserved:6;
63 volatile unsigned char state;
64 } dr_modem_input_lines;
68 volatile unsigned int dcd:1;
69 volatile unsigned int dsr:1;
70 volatile unsigned int brk:1;
71 volatile unsigned int ri:1;
72 volatile unsigned int reserved:4;
74 volatile unsigned char state;
75 } dr_modem_output_lines;
79 * This structure has information about modem connection lines
82 dr_modem_output_lines output_line_state;
83 dr_modem_input_lines input_line_state;
88 * This structure has information about the USB connection
91 gboolean connected; /**< To check whether USB is connected or not */
92 pthread_t thread_id; /**< USB thread id */
93 int usb_fd; /**< USB file descriptor */
95 int data_path; /**< Data path */
96 char data_buffer[USB_BUFFER_SIZE+1]; /**< Data buffer */
101 * This structure has information about the DR
104 dr_usb_info_t usb; /**< Information about USB */
105 dr_line_info_t line; /**< Information about modem status lines */
110 gboolean _deinit_dr(void);
113 #endif //_DATA_ROUTER_H_