EGD_OPEN(3)

πŸ’– EGD_OPEN(3) πŸ’–

okay bestie, this one's from the EEGDEV library manual, section 3, and it's literally the glow-up moment where you open an EEG device. come on, let's go 🧚✨


✨ NAME ✨

egd_open β€” open an EEG device. that's it. that's the whole job. she's simple, she's iconic, she opens devices. πŸ’…


🌸 SYNOPSIS 🌸

#include <eegdev.h>

struct eegdev* egd_open(const char* devstring);

πŸ¦‹ DESCRIPTION πŸ¦‹

so egd_open() opens an EEG device based on whatever the devstring description says. and if devstring is NULL? no worries, she'll just open the first device supported by the library. main character energy, honestly. πŸ‘‘

the devstring argument is what tells her which type of EEG device you want opened, plus the parameters the system should be configured with (and yes, those override the default settings). the syntax of that string lives over in eegdev-open-options(5) β€” go read her, iykyk.

⚠️ okay so real talk: the syntax may change in future releases, so programs should not rely on it to configure the device. it's provided only to the users of the programs, so they can select the EEG acquisition device and configure it. programs using the eegdev library should pass the string provided by the users untouched. no editing, no remixing. periodt. πŸ™ˆ

and devstring is not the only way to feed configuration info about the device you're opening. the configuration is also read from the configuration files. the final values of the settings handed to the opening function are defined (and overridden) in this exact order:

  1. default values
  2. shared configuration file
  3. device specific configuration file
  4. devstring

the way this order works means a setting value specified in devstring will always override any setting value defined by other means. she's at the top of the chain, no cap. πŸ‘‘


πŸ’œ RETURN VALUE πŸ’œ

on success, the function returns a pointer to the opened EEG device. otherwise NULL is returned and errno is set accordingly. sad girl hours, but informative ones. 😭


🌈 ERRORS 🌈

egd_open() will fail if:

  • ENOSYS β€” the device part of devstring does not refer to a device supported by any of the installed eegdev plugin modules. πŸ’€
  • EINVAL β€” one of the options specified in devstring is unknown. bestie, that's not a real option.
  • ENODEV β€” the specified device is not connected. where is she. 🫢
  • EBUSY β€” the specified device is already in use. she's taken, respectfully.
  • ECHILD β€” the specified device needs an auxiliary child process whose executable file cannot be found. the child is missing, literally. 🧚

πŸŽ€ ENVIRONMENT πŸŽ€

  • EEGDEV_PLUGINS_DIR β€” this variable controls which folder should be searched to find plugin modules. if unset, they'll be searched in the subfolder eegdev of the installation folder of the libraries.
  • EEGDEV_CONF_DIR β€” this variable controls which folder should be searched to find the configuration files. if unset, they'll be searched in /etc/eegdev.

⭐ SEE ALSO ⭐

egd_close(3), eegdev-open-options(5)


and that's the whole page, babe πŸ’– this one's brought to you by EPFL, dated 2010 β€” so she's vintage, but she still ate. bye bestie, go open some devices πŸ¦‹βœ¨