Fix the termination issue
[framework/connectivity/data-router.git] / include / dr-usb.h
1 /*
2  * Data-Router
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:  Hocheol Seo <hocheol.seo@samsung.com>
7  *               Injun Yang <injun.yang@samsung.com>
8  *
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
12  *
13  *              http://www.apache.org/licenses/LICENSE-2.0
14  *
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.
20  *
21  */
22
23
24
25 #ifndef _DR_USB_H
26 #define  _DR_USB_H
27
28
29 /*
30  * Output control lines.
31  */
32
33 #define ACM_CTRL_DTR            0x01
34 #define ACM_CTRL_RTS            0x02
35
36
37 enum {
38         DTR_OFF,
39         DTR_ON
40 };
41
42
43 #define GS_CDC_NOTIFY_SERIAL_STATE _IOW('S', 1, int)
44
45
46 /** @internal
47   *  This function initialises the USB interface
48   * 
49   *   @return       This function returns 0 if the USB has been initialised successfully or it returns -1 on failure  
50   *
51   */
52 int _init_usb(void);
53
54
55 /** @internal
56   *  This function deinitialises the USB interface
57   */
58 void _deinit_usb(void);
59
60
61 /** @internal
62   *  This function is used to write data to the USB interface
63   * 
64   *   @param       [in]   buf              data to be written to USB 
65   *   @param       [in]   buf_len    no of bytes of data to be written to USB 
66   *   @return       This function returns the no of bytes written to the USB. 
67   */
68 int _write_to_usb(char *buf, int buf_len);
69
70
71
72 /** @internal
73   *  This function is used to send modem line state to Host PC
74   *
75   *  @param       [in] ctrl    status of control lines    
76   *  @return       This function returns zero  if successful else returns -EIO
77   *
78   */
79 int _send_usb_line_state(int ctrl);
80
81
82 #endif                          // _DR_USB_H