summaryrefslogtreecommitdiffabout
path: root/src/eyefiworker.h
blob: 61d92d2f17aa2283e5fe021150ffb3c550cb6d66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef __EYEFIWORKER_H
#define __EYEFIWORKER_H

#include <tr1/memory>
using std::tr1::shared_ptr;

#include "soapeyefiService.h"

#include "eyekinfig.h"
#include "eyetil.h"

struct eyefi_session;

class eyefiworker : public eyefiService {
    public:
	shared_ptr<eyekinfig_t> kinfig;
	shared_ptr<tmpdir_t> indir;
	shared_ptr<mimewrite_tarfile> mime_tarfile;
	shared_ptr<mimewrite_string> mime_idigest;

	eyefiworker();
	~eyefiworker() { }

	int run(int port) __attribute__ ((noreturn));

	int StartSession(std::string macaddress, std::string cnonce,
		int transfermode, long transfermodetimestamp,
		struct rns__StartSessionResponse &r);
	int GetPhotoStatus(std::string credential, std::string macaddress,
		std::string filename, long filesize, std::string filesignature, int flags,
		struct rns__GetPhotoStatusResponse &r);
	int MarkLastPhotoInRoll(std::string macaddress, int mergedelta,
		struct rns__MarkLastPhotoInRollResponse &r);
	int UploadPhoto(int fileid, std::string macaddress,
		std::string filename, long filesize, std::string filesignature,
		std::string encryption, int flags,
		struct rns__UploadPhotoResponse &r);

	void *mime_writeopen(void *handle,const char *id,const char *type,const char *description,
		enum soap_mime_encoding encoding);
	int mime_write(void *handle,const char *buf,size_t len);
	void mime_writeclose(void *handle);

	eyefiService *copy() { throw std::logic_error("Not meant to be called"); }
};

#endif /* __EYEFIWORKER_H */