blob: 3aaa96414b5095e2e6eaf0461a0a3fc73791866f [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 */);
Ethan Yonker8dfa7772014-09-04 21:48:41 -050037 pthread_t threadserver(void);
38 pid_t forkserver(void);
bigbiff7cb4c332014-11-26 20:36:07 -050039 void addStorage(std::string display, std::string path, int mtpid, uint64_t maxFileSize);
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -040040 private:
41 int start(void);
42 typedef int (twrpMtp::*ThreadPtr)(void);
43 typedef void* (*PThreadPtr)(void *);
44 storages *mtpstorages;
45 storage *s;
46};
47#endif