blob: bed81c0e9819a63690365c100877fb3170584ab5 [file] [log] [blame]
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -04001/*
2 * Copyright (C) 2014 TeamWin - bigbiff and Dees_Troy mtp database conversion to C++
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 TWRPMTP_HPP
18#define TWRPMTP_HPP
19
20#include <fcntl.h>
21#include <utils/Errors.h>
22#include <utils/threads.h>
23#include <string>
24#include <vector>
25#include <pthread.h>
26#include "MtpTypes.h"
27#include "MtpPacket.h"
28#include "MtpDataPacket.h"
29#include "MtpDatabase.h"
30#include "MtpRequestPacket.h"
31#include "MtpResponsePacket.h"
32#include "mtp_MtpDatabase.hpp"
33
34class twrpMtp {
35 public:
Ethan Yonker6d154c42014-09-03 14:19:43 -050036 twrpMtp(int debug_enabled /* = 0 */);
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -040037 pthread_t runserver(void);
38 void addStorage(std::string display, std::string path, int mtpid);
39 private:
40 int start(void);
41 typedef int (twrpMtp::*ThreadPtr)(void);
42 typedef void* (*PThreadPtr)(void *);
43 storages *mtpstorages;
44 storage *s;
45};
46#endif