Android with Unity3D

Hi guys~
i want to using GPIO, UART of yy3568 with Unity3D.

Here is part of my Source
[DllImport(“libYY3568GPIO”)] private static extern int gpio_direction(int gpio, int dir);
[DllImport(“libYY3568GPIO”)] private static extern int gpio_set_edge(int gpio, int rising, int falling);
[DllImport(“libYY3568GPIO”)] private static extern int gpio_export(int gpio);
[DllImport(“libYY3568GPIO”)] private static extern void gpio_unexport(int gpio);
[DllImport(“libYY3568GPIO”)] private static extern int gpio_getfd(int gpio);
[DllImport(“libYY3568GPIO”)] private static extern int gpio_read(int gpio);
[DllImport(“libYY3568GPIO”)] private static extern int gpio_write(int gpio, int val);
[DllImport(“libYY3568GPIO”)] private static extern int gpio_select(int gpio);

int gpio_pin = 28;
// Start is called before the first frame update
void Start()
{
int res = gpio_export(gpio_pin); // I got Error at here, the return value is -1
Debug.Log(“gpio_export res = " + res);
gpio_direction(gpio_pin, 1); //and also i gor error " perror(“Couldn’t open IRQ file”);”
}

plz help me what i have to do, it is my first time to develop for embedded sys.

  1. Check if the open path is correct
  2. Check if the permissions are sufficient.
1 Like
  1. Check if the open path is correct
    <=== i think this path is must be correct becaz the android 11 OS has installed by your company

  2. Check if the permissions are sufficient.
    <=== how can i get THE permission ?
    and i wonder if i have 100 of yy3568, i have to get all of those board permission by manually?

yes,Set seandroid permissions

1 Like

Thank you :slight_smile: i solved my prpblem~