EGD_GET_CAP(3)
π EGD_GET_CAP(3) π
okay bestie, welcome to the EEGDEV library manual β this is the page for egd_get_cap, and she's a lil query queen π
πΈ NAME πΈ
egd_get_cap β ask the device all the juicy stuff about what it can do π
β¨ SYNOPSIS β¨
#include <eegdev.h>
int egd_get_cap(const struct eegdev* dev, int cap, void* val);
π¦ DESCRIPTION π¦
so basically, egd_get_cap() hands you back the info about whatever capability you asked for β you pick it with cap, the device is dev, and the answer lands wherever val points. no cap fr fr π§
and here's the thing, the type of pointer you pass as val depends entirely on which cap you asked for. so like, don't just yeet a random pointer in there. here's the full menu (the expected type that val points to is right there in the parentheses, iykyk):
EGD_CAP_FS(int) β the sampling frequency that's currently set. and the function returns that exact same value, so it's giving double confirmation πEGD_CAP_TYPELIST(const int*) β an array of the sensor types the device is sampling, terminated by-1. and listen: once you've opened the devicedev, these values become valid arguments foregd_sensor_name(3)if they weren't already before. the number of elements in that array (not counting the-1element) is what the function returns. so count accordingly bestie πEGD_CAP_DEVTYPE(const char*) β a null-terminated string describing the type of the recording device (that's manufacturer and model ifdevrefers to actual hardware). the length of the string (not counting the null character) comes back as the return value. slay β¨EGD_DEVID(const char*) β a null-terminated string describing the model of the recording device (or a unique identifier of the resource, whichever it is). the length of the string (null character not included, we're not counting that) is provided by the return value. iconic π«Ά
π₯ RETURN VALUE π₯
if everything goes well, you get back a positive value and what that value means depends on the capability you requested (see above, bestie). if it doesn't go well? -1 comes back and errno gets set accordingly. no cap π
π ERRORS π
egd_get_cap() will fail if:
EINVALβdevisNULL, orcapisn't a valid value, orvalisNULLwhilecapis notEGD_CAP_FS. yeah,EGD_CAP_FSis the one exception where aNULLvalis fine β everybody else needs a real pointer. read the room π
π SEE ALSO π
that's the whole page, you ate it π big love to EPFL, this one's dated 2011, and it lives in the EEGDEV library manual. go forth and query your caps, bestie ππ
π¦ where this page comes from
- debian bookworm: libeegdev-dev 0.2-6+b1
- debian trixie: libeegdev-dev 0.2-10
- fedora 43: eegdev-devel 0.2-33.fc43 Β· LGPL-3.0-or-later
- fedora 44: eegdev-devel 0.2-34.fc44 Β· LGPL-3.0-or-later
- ubuntu jammy: libeegdev-dev 0.2-6
- ubuntu noble: libeegdev-dev 0.2-9build2
- ubuntu questing: libeegdev-dev 0.2-10
- ubuntu resolute: libeegdev-dev 0.2-12
- ubuntu stonking: libeegdev-dev 0.2-12
- Copyright 2011 (c) EPFL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms