| 870 | |
| 871 | private: |
| 872 | void Notifications(size_t numNotifications) |
| 873 | { |
| 874 | const long port = AdsPortOpenEx(); |
| 875 | fructose_assert(0 != port); |
| 876 | |
| 877 | const auto notification = std::unique_ptr<unsigned long[]>( |
| 878 | new unsigned long[numNotifications]); |
| 879 | AdsNotificationAttrib attrib = { |
| 880 | 1, ADSTRANS_SERVERCYCLE, 0, { 1000000 } |
| 881 | }; |
| 882 | unsigned long hUser = 0xDEADBEEF; |
| 883 | |
| 884 | for (hUser = 0; hUser < numNotifications; ++hUser) { |
| 885 | fructose_assert_eq(0, AdsSyncAddDeviceNotificationReqEx( |
| 886 | port, &server, 0x4020, 4, |
| 887 | &attrib, &NotifyCallback, |
| 888 | hUser, |
| 889 | ¬ification[hUser])); |
| 890 | } |
| 891 | std::this_thread::sleep_for(std::chrono::seconds(5)); |
| 892 | for (hUser = 0; hUser < numNotifications; ++hUser) { |
| 893 | fructose_assert_eq(0, AdsSyncDelDeviceNotificationReqEx( |
| 894 | port, &server, |
| 895 | notification[hUser])); |
| 896 | } |
| 897 | fructose_assert(0 == AdsPortCloseEx(port)); |
| 898 | } |
| 899 | |
| 900 | void Read(const size_t numLoops) |
| 901 | { |
nothing calls this directly
no test coverage detected