mirror of
https://github.com/ioacademy-jikim/android_framwork.git
synced 2026-08-11 08:22:53 +00:00
12
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
#include <stdio.h>
|
||||
|
||||
typedef struct module
|
||||
{
|
||||
void (*on)();
|
||||
void (*off)();
|
||||
} module_t;
|
||||
|
||||
void ledOn()
|
||||
{
|
||||
printf("ledOn()\n");
|
||||
}
|
||||
|
||||
void ledOff()
|
||||
{
|
||||
printf("ledOff()\n");
|
||||
}
|
||||
|
||||
module_t HMI = { ledOn, ledOff };
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
#include <dlfcn.h>
|
||||
|
||||
typedef struct module
|
||||
{
|
||||
void (*on)();
|
||||
void (*off)();
|
||||
} module_t;
|
||||
|
||||
int main()
|
||||
{
|
||||
void *handle;
|
||||
module_t *module;
|
||||
handle = dlopen("libled.so", RTLD_NOW);
|
||||
module = dlsym( handle, "HMI" );
|
||||
module->on();
|
||||
module->off();
|
||||
dlclose(handle);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user