EGD_CLOSE(3)

πŸ’– EGD_CLOSE(3) β€” EEGDEV library manual πŸ’–

okay bestie, welcome to the EEGDEV library manual, page EGD_CLOSE(3) ✨ this one's short and sweet and it's literally about saying bye to a device. no cap.


✨ NAME ✨

egd_close β€” close a device 🫢


🌸 SYNOPSIS 🌸

#include <eegdev.h>

int egd_close(struct eegdev* dev);

πŸŽ€ DESCRIPTION πŸŽ€

so, egd_close() does the full send-off, bestie. it frees all the resources associated to the device referenced by dev and closes it. like, everything. gone. clean.

and the way that it also implicitly stops any running acquisition? iconic. you don't even have to ask, it just does it. πŸ’…

🚨 okay this part matters, fr fr: after a successful call to egd_close(), the reference dev cannot be used any longer. it's done. it's over. don't touch it. don't call anything on it. it's giving "ghosted" and you need to respect that. πŸ’€

πŸ‘‘ RETURN VALUE πŸ‘‘

  • returns 0 in case of success πŸŽ‰
  • otherwise, -1 is returned and errno is set accordingly 😭

🌈 ERRORS 🌈

egd_close() will fail if:

  • EINVAL β€” dev is NULL. yeah. you passed nothing. there's no device to close, bestie πŸ™ˆ

mood: closing a device is self-care. free the resources, stop the acquisition, log off, hydrate. πŸ¦‹

this page came to you courtesy of EPFL, dated 2010 β€” and yes, we're still in the EGD_CLOSE(3) era of the EEGDEV library manual. periodt. πŸ’–βœ¨