MCPcopy Create free account
hub / github.com/Beckhoff/ADS / FindNext

Function FindNext

AdsLib/AdsFile.cpp:39–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37#pragma pack(pop)
38
39static bool FindNext(const AdsDevice &route, TcFileFindData &child,
40 const size_t length = 0, const char *const path = nullptr)
41{
42 const auto error = route.ReadWriteReqEx2(SYSTEMSERVICE_FFILEFIND,
43 child.hFile, sizeof(child),
44 &child, length, path, nullptr);
45 // We reached the last child
46 // If there is no more file in the current path the ADS service will
47 // return ads error code 1804 so we can break and exit as expected.
48 if (error && (error != 1804)) {
49 throw AdsException(error);
50 }
51 // TwinCAT sends data in little endian so we have to convert it here
52 child.letoh();
53 return error == 1804;
54}
55
56static bool FindFirst(const AdsDevice &route, TcFileFindData &item,
57 const std::string &path)

Callers 2

FindFirstFunction · 0.85
FindMethod · 0.85

Calls 3

AdsExceptionClass · 0.85
ReadWriteReqEx2Method · 0.80
letohMethod · 0.80

Tested by

no test coverage detected