| 37 | #pragma pack(pop) |
| 38 | |
| 39 | static 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 | |
| 56 | static bool FindFirst(const AdsDevice &route, TcFileFindData &item, |
| 57 | const std::string &path) |
no test coverage detected