I want to know what all are the available GPIO pins are available to use. I need to send the intermediate response of available GPIO pins for the test and read mode AT commands of AT+KGPIOCFG for WP85 series from my legato application. I tried to read the /sys/class/gpio/export but there is no content inside this file.
FILE *fp = NULL;
fp = fopen("/sys/class/gpio/export", "r");
LE_INFO("Error opening file %s for reading.\n", "/sys/class/gpio/export");
LE_INFO("Opening file %s for reading is successful.\n", "/sys/class/gpio/export");
i = 0;
while (((c = fgetc(fp)) != EOF) && (i < (sizeof(result) - 1)))
result[i] = c;
result[i] = '\0';
LE_INFO("Read result: %s from %s", result, "/sys/class/gpio/export");
Is this correct way of fetching available pins? Any legato GPIO services or method is available to get these values?