EGD_CHANNEL_INFO(3)

πŸ’– EGD_CHANNEL_INFO πŸ’–

okay bestie, so this one lives in the EEGDEV library manual, and it's the girl who tells you literally everything about one specific channel. section 3 energy, we love her πŸŽ€


✨ NAME ✨

egd_channel_info β€” get various information about a particular channel πŸ‘‘


🌸 SYNOPSIS 🌸

#include <eegdev.h>

int egd_channel_info(const struct eegdev* dev, int stype,
                      unsigned int index, int fieldtype, ...);

πŸ¦‹ DESCRIPTION πŸ¦‹

so egd_channel_info() hands you a bunch of different types of info about the channel sitting at index index, inside the group that stype says, on the device that dev points to. and like, stype is the type of channel β€” same deal as described over in egd_acq_setup(3). it's gotta be one of the values that egd_sensor_type(3) gives back. no cap. πŸ’…

the info you actually get back is defined by the variable list of arguments. that list is just a series of couples, bestie: one field type identifier that says which feature you want, then a pointer to a value whose type depends on that field type. and the list must finish with EGD_END. periodt. πŸ›‘

the field identifiers can be these ones β€” and yes, the expected pointer type is right there in the parenthesis, iykyk:

  • EGD_LABEL (char*) β€” the name of the channel. the array you point at should be long enough to hold 32 characters (null termination character included). so like, size it right or it's giving chaos 😭
  • EGD_ISINT (int*) β€” tells you whether the data from this channel is integer or floating point. zero means floating point, non-zero means integer. that's it, that's the vibe check ⭐
  • EGD_MM_I (int32_t*) β€” drops the minimal and maximal values the channel can deliver into an array of 2 int32_t. heads up though: if the channel delivers floating point data, these values can be underestimated because of overflow. so don't come for me if they're a lil small πŸ™ˆ
  • EGD_MM_F (float*) β€” same deal, but it returns the minimal and maximal values the channel can deliver as an array of 2 float values. and again: if the channel delivers double floating point data, these values can be underestimated due to overflow. same warning, different type πŸ’€
  • EGD_MM_D (double*) β€” returns the minimal and maximal values the channel can deliver in an array of 2 double values. no caveat, she's clean, she ate πŸ”₯
  • EGD_UNIT (char*) β€” the unit the channel data is expressed in. the array you point at should be long enough to hold 16 characters (null termination included). sixteen, bestie, not fifteen πŸŽ€
  • EGD_TRANSDUCTER (char*) β€” the transducter type of the sensor. the array you point at should be long enough to hold 128 characters (null termination included). big girl buffer 🌈
  • EGD_PREFILTERING (char*) β€” info about the filters that were already applied on the data. the array you point at should be long enough to hold 128 characters (null termination included). also 128, match the energy ✨

πŸ’œ RETURN VALUE πŸ’œ

the function returns 0 when it's a slay (success). otherwise -1 comes back and errno gets set accordingly. so check your errno, bestie, she's trying to tell you something 🫢


😭 ERRORS 😭

egd_channel_info() will fail if:

  • EINVAL β€” dev is NULL, or stype is an invalid sensor type, or index is bigger than the maximal number of channels in the group, or any field identifier is unknown, or any pointer you used is NULL. basically any of those and she's not doing it πŸ’€

πŸ”’ THREAD SAFETY πŸ”’

egd_channel_info() is thread-safe. multiple threads, no drama, we love a secure queen πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

egd_acq_setup(3), egd_sensor_type(3)


and that's the whole page, bestie!! brought to you by EPFL in 2010, from the EEGDEV library manual β€” shoutout to the OG EGD_CHANNEL_INFO(3) for being iconic since day one πŸ«Άβœ¨πŸ’–