Home
[RDK Central Wiki]
CMF
[Code Releases]
...
Code Block |
---|
#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <unistd.h> #include <errno.h> #include <rbus.h> int main(int argc, char *argv[]) { int ret = -1; FILE *pipe = NULL; char buffer[256] = {0}; char cmd[] = "dmcli eRT getv Device.DeviceInfo.SerialNumber"; pipe = popen(cmd, "r"); if(NULL == pipe) { printf("Pipe is NULL. popen() failed. Error: %d\n", errno); return ret; } while (NULL != fgets(buffer, sizeof(buffer), pipe)) { printf("buffer: %s\n", buffer); } pclose(pipe); return ret; } |
Wiki Markup |
Code Block |
---|
#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <unistd.h> #include <rbus.h> rbusHandle_t handle; int main(int argc, char *argv[]) { rbus_open(&handle, "mytest"); while (true) { sleep(100); } } |
...