#include #include #include #include #include #include #include "../include/chardev.h" // basic read int main(int argc, char **argv) { int fd; char *data_1 = (char *)calloc(4096, sizeof(char)); if (argc != 2) { printf("usage: prog device-file-path\n"); return EXIT_FAILURE; } fd = open(argv[1], O_RDWR); if (fd < 0) { printf("[ERROR]: Could not open device!\n"); } read(fd, data_1, 4096); printf("%s\n", data_1); if (close(fd) < 0) { printf("[ERROR]: Could not close!\n"); } return 0; }