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

Function NotifyCallback

AdsLibTestRef/main.cpp:54–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53static size_t g_NumNotifications = 0;
54static void __stdcall NotifyCallback(AmsAddr *pAddr,
55 AdsNotificationHeader *pNotification,
56 unsigned long hUser)
57{
58#if 0
59 static std::ostream& notificationOutput = std::cout;
60#else
61 static std::ostream notificationOutput(0);
62#endif
63 ++g_NumNotifications;
64 notificationOutput
65 << std::setfill('0') << "NetId 0x" << pAddr->netId << "hUser 0x"
66 << std::hex << std::setw(4) << hUser
67 << " sample time: " << std::dec << pNotification->nTimeStamp
68 << " sample size: " << std::dec << pNotification->cbSampleSize
69 << " value: 0x" << std::hex << (int)pNotification->data[0]
70 << '\n';
71}
72
73void print(const AmsAddr &addr, std::ostream &out)
74{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected