I need to run this in ctypes however cannot get it to work.
int function_open(const char *port_name, int baud_rate);
I have tried:
from ctypes import *
import ctypes
import time
load=cdll.LoadLibrary(r"[absolute path redacted]")
original_string="/dev/ttyS4"
b = ctypes.c_char_p(str.encode(original_string))
load.function_open(b, ctypes.c_int(9600))
It returns the exception as defined in C but I think the wrong argument types are being passed or the method is incorrect. Please can someone take a look? Thanks in advance. I am loading a .so shared library. I will send 5$ to the a solution that works via paypal / venmo.