[cleanup]revise file location and name
[platform/core/connectivity/mtp-responder.git] / include / mtp_transport.h
1 /*
2  * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef _MTP_TRANSPORT_H_
18 #define _MTP_TRANSPORT_H_
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 #include "mtp_datatype.h"
25 #include "mtp_util.h"
26
27 /*
28  * This structure specifies the status information of Mtp.
29  */
30 typedef struct {
31         mtp_int32 ctrl_event_code;
32         mtp_state_t mtp_op_state;
33         mtp_bool cancel_intialization;
34         mtp_bool is_usb_discon;
35 } status_info_t;
36
37 typedef void (*_cmd_handler_cb)(mtp_char *buf, mtp_int32 pkt_len);
38
39 void _transport_save_cmd_buffer(mtp_char *buffer, mtp_uint32 size);
40 mtp_err_t _transport_rcv_temp_file_data(mtp_byte *buffer, mtp_uint32 size,
41                 mtp_uint32 *count);
42 mtp_err_t _transport_rcv_temp_file_info(mtp_byte *buf, char *filepath,
43                 mtp_uint64 *t_size, mtp_uint32 filepath_len);
44 mtp_err_t _transport_send_event(mtp_byte *buf, mtp_uint32 size, mtp_uint32 *count);
45 mtp_uint32 _transport_send_pkt_to_tx_mq(const mtp_byte *buf, mtp_uint32 pkt_len);
46 mtp_uint32 _transport_send_bulk_pkt_to_tx_mq(const mtp_byte *buf,
47                 mtp_uint32 pkt_len);
48 void _transport_send_zlp(void);
49 mtp_bool _transport_init_interfaces(_cmd_handler_cb func);
50 void _transport_usb_finalize(void);
51 void _transport_init_status_info(void);
52 mtp_int32 _transport_get_control_event(void);
53 void _transport_set_control_event(mtp_int32 event_code);
54 mtp_state_t _transport_get_mtp_operation_state(void);
55 void _transport_set_mtp_operation_state(mtp_state_t state);
56 void _transport_set_usb_discon_state(mtp_bool is_usb_discon);
57 mtp_bool _transport_get_usb_discon_state(void);
58 void _transport_set_cancel_initialization(mtp_bool value);
59 mtp_bool _transport_get_cancel_initialization(void);
60
61 #ifdef __cplusplus
62 }
63 #endif
64
65 #endif /* _MTP_TRANSPORT_H_ */