27 #include <sys/types.h>
39 void tryPush(
const std::string& s);
40 bool tryPop(std::string& s);
44 static const unsigned int fifoBufferSize = 5000000;
47 std::queue<std::string> fifoBuffer;
48 pthread_mutex_t mutex;
83 PBAPSource(
const std::string& mac,
const std::string& pb,
84 const std::string& filter,
unsigned int batchDownloadTime);
113 static void* threadFuncFIFOWrapper(
void* ptr);
114 void threadFuncFIFO();
117 bool createSession();
118 bool selectPhonebook();
119 bool getPhonebookSize();
120 bool getSupportedFilters();
121 bool pullPhonebook(
unsigned int offset,
unsigned int count);
122 bool disconnectSession();
125 std::string macAddress;
126 std::string pbLocation;
127 unsigned int batchDownloadDesiredTime;
130 std::vector<std::string> ignoredFields;
131 std::vector<std::string> filters;
132 std::vector<std::string> supportedFilters;
134 std::string tempFIFO;
136 pthread_t threadFIFO;
139 GDBusConnection* connection;
140 GDBusProxy* proxyClient1;
141 GDBusProxy* proxyPhonebookAccess1;
142 GDBusProxy* proxyTransfer1;
146 std::string sessionPath;
147 unsigned int phonebookSize;
PBAPSource(const std::string &mac, const std::string &pb, const std::string &filter, unsigned int batchDownloadTime)
Constructor.
Definition: PBAP.cpp:17
eCancelRet
Definition: Source.hpp:138
eResumeRet
Definition: Source.hpp:123
void close()
Definition: PBAP.cpp:741
enum OpenAB_Source::Source::eResumeRet resume()
Resumes Source, if such operation is supported.
Definition: PBAP.cpp:512
bool tryPop(std::string &s)
Definition: PBAP.cpp:723
void tryPush(const std::string &s)
Definition: PBAP.cpp:706
int getTotalCount() const
Returns total count of items available from Source, if such information is available.
Definition: PBAP.cpp:540
eSuspendRet
Definition: Source.hpp:108
enum OpenAB_Source::Source::eCancelRet cancel()
Cancels Source, if such operation is supported. After canceling Source next call to getVCard() should...
Definition: PBAP.cpp:523
Documentation for Source plugin interface.
Definition: Source.hpp:76
eGetItemRet
Definition: Source.hpp:155
enum OpenAB_Source::Source::eSuspendRet suspend()
Suspends Source, if such operation is supported.
Definition: PBAP.cpp:494
enum OpenAB_Source::Source::eInit init()
Initializes Source.
Definition: PBAP.cpp:98
virtual ~PBAPSource()
Definition: PBAP.cpp:58
FIFOBuffer()
Definition: PBAP.cpp:694
enum OpenAB_Source::Source::eGetItemRet getItem(OpenAB::SmartPtr< OpenAB::PIMItem > &item)
Gets PIM Item from Source. If Source is suspended getItem() should block until Source will be resumed...
Definition: PBAP.cpp:460
eInit
Definition: Source.hpp:94
~FIFOBuffer()
Definition: PBAP.cpp:701