Skip to content

Instantly share code, notes, and snippets.

View grodansparadis's full-sized avatar
🎈
Developing VSCP

Åke Hedman grodansparadis

🎈
Developing VSCP
View GitHub Profile
@grodansparadis
grodansparadis / gist:eba5385eddb861cbaa90025a5d85faf9
Created October 13, 2021 21:20
Windows: helper lib polling for events
while (true) {
if (VSCP_ERROR_SUCCESS != (rv = vscphlp_isDataAvailable(handle1, &count))) {
printf("Failed to get available data rv = %d\n", rv);
Sleep(5000);
continue;
}
if (count) {
printf("There is %ud events available\n", rv);
@grodansparadis
grodansparadis / gist:246501a8a867f52cf1d9d29aeb336b41
Created October 13, 2021 21:13
Windows: blocking calls in VSCP helper lib to get events
// Enter receive loop
if (VSCP_ERROR_SUCCESS != (rv = vscphlp_enterReceiveLoop(handle1))) {
printf("Failed to enter receive loop rv = %d\n", rv);
}
//
while (true) {
vscpEventEx ex;
if (VSCP_ERROR_SUCCESS == (rv = vscphlp_blockingReceiveEventEx(handle1, &ex, 1000))) {
printf("Event received: Class=%ud Type=%d\n", ex.vscp_class, ex.vscp_type);

Keybase proof

I hereby claim:

  • I am grodansparadis on github.
  • I am grodansparadis (https://keybase.io/grodansparadis) on keybase.
  • I have a public key whose fingerprint is CC68 137E 5F27 3B53 E32F B070 07C7 39B5 ED74 864E

To claim this, I am signing this object: