Ok I think I messed up the function call in that, so I messed around and have tried it this way, also with no luck. It outputs "35", which I guess means it opened the port ok and sent 5 characters to the port?
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <asm/io.h>
#include <moxadevice.h>
#include <termios.h>
#include <fcntl.h>
#include <errno.h>
int n, fd;
char jazz[5];
int main()
{
fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY);
printf("%d", fd);
if (fd < 0)
{
perror("open_port: /dev/ttyS0 - ");
}
else
{
fcntl(fd, F_SETFL, 0);
}
strcpy(jazz, "test");
n = write(fd, &jazz, sizeof(jazz));
printf("%d", n);
if (n < 0)
{
printf("Write failed!");
}
return(0);
}
Thanks