EGD_GET_NUMCH(3)

✨ EGD_GET_NUMCH ✨

okay bestie, so this is a page from the EEGDEV library manual (manual section 3, the library-call girlies πŸ’…) and it's literally all about counting channels. like, how many channels of a given sensor type is your device actually sampling? that's the whole vibe. let's get into it πŸŽ€


🌸 NAME 🌸

egd_get_numch β€” get the number of channels sampled by type πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <eegdev.h>

int egd_get_numch(const struct eegdev* dev, int stype);

✨ DESCRIPTION ✨

so egd_get_numch() hands you back the number of channels of type stype that are being sampled by the recording device that dev points at. no cap, that's it, that's the function 🫢

and like, important detail: stype has to be one of the values that egd_sensor_type(3) gives you. don't just freestyle a random int in there, okay? πŸ‘‘


πŸ’– RETURN VALUE πŸ’–

on a successful slay, the function returns a non-negative value β€” that's your number of channels of type stype. and yes, it can legitimately be 0, because sometimes a device just doesn't sample that type of data at all and that's valid of it πŸ™ˆ

but if things go wrong? it returns -1 and sets errno accordingly. classic. πŸ’€


😭 ERRORS 😭

egd_get_numch() will fail if:

  • EINVAL β€” dev is NULL, or stype is not a valid value. literally the two ways to break it, bestie.

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, no notes πŸ’œ this icon was brought to you by EPFL, dated 2011, and it lives in the EEGDEV library manual β€” go count some channels, you've got this πŸŒˆβ­πŸŽ€