forked from gozfree/gear-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_liblightlib.c
41 lines (38 loc) · 991 Bytes
/
test_liblightlib.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/******************************************************************************
* Copyright (C) 2014-2015
* file: test_liblightlib.c
* author: gozfree <[email protected]>
* created: 2016-07-21 15:12
* updated: 2016-07-21 15:12
******************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include "liblightlib.h"
void test_file_name()
{
int i;
for (i = 0; i < 1; i++) {
loge("debug msg i=%d\n", i);
logw("debug msg i=%d\n", i);
logi("debug msg i=%d\n", i);
logd("debug msg i=%d\n", i);
logv("debug msg i=%d\n", i);
}
log_deinit();
}
void foo()
{
char buf[128] = {0};
struct file *f = file_open("/tmp/lsusb", F_RDONLY);
file_read(f, buf, sizeof(buf));
printf("buf =%s", buf);
printf("len=%zu\n", file_get_size("/tmp/lsusb"));
}
int main(int argc, char **argv)
{
test_file_name();
foo();
return 0;
}