Hullo everyone, i have been trying to work around this error for a while but i just can not get it fixed. thought i would ask for some help on this forum. I have a struct called alt_dev_s with one of the elements as int(*open) (alt_fd* fd. const char* name, int flags, int mode) to open the file descriptor
when i try to access the element in my main function i get the above error. Here is my code sample. Thanks in advance!!
Code:#define ERGO_CMD_GET_ADDRESS 0x11 #define ERGO_CMD_RUN_DATA 0x40 #define ERGO_CMD_SET_WATT 0x51 #define UART_MAX_DATA 20 /*Global Variables*/ ergo_run_data_t ergo_run_data; u_int8_t ergo_adr_int; /* External Functions that are called in the main function*/ int altera_16550_uart_read_fd(alt_fd* fd, char* ptr, int len); int altera_16550_uart_write_fd(alt_fd* fd, const char* buffer, int space); int altera_16550_uart_ioctl_fd(alt_fd* fd, int req, void* arg); int altera_16550_uart_close_fd(alt_fd* fd); //int (*open) (alt_fd* fd, const char* name, int flags, int mode); void ergo_get_address(); void ergo_get_run_data(void); void ergo_set_watt(u_int8_t ergo_adr_int, u_int8_t watt); void ergo_reset(u_int8_t ergo_adr_int); void ergo_break(void); int main() { alt_fd* fd; struct alt_dev_s alt_dev; /*Open File Descriptor*/ // I am getting the error on this line alt_dev -> &(open) (&(alt_fd) {"/dev/ttyUSB0"}, &(const char) {ttyUSB0},0,O_RDWR|O_NOCTTY|O_NONBLOCK); //Error Handling if ( fd < 0 ) { printf("Error beim oeffnen"); } return 0; }




Reply With Quote
