Hi
I'm trying to send some data from my PC to WRBSBC8548 board through
RS232.In order to receive data in SBC , I set up a timer
STATUS start_tmr_receive(int nsec, int interval_nsec)
{
timer_t tmrid;
struct itimerspec value;
value.it_value.tv_sec = nsec;
value.it_value.tv_nsec = interval_nsec;
value.it_interval.tv_sec = 0;
value.it_interval.tv_nsec = 0;
if ((timer_create (CLOCK_REALTIME, NULL, &tmrid)) == ERROR) {
debug_error_msg("ERROR!receive_timer_create");
return ERROR;
}
timer_connect (tmrid, read_usart_rx_buffer, 0);
timer_settime (tmrid, 0, &value, NULL);
debug_log_msg("\ntimerReceive is started\n");
return OK;
}
And in order to receive data , I coded this function

void read_usart_rx_buffer()
{
int stat, fd, i;
PKT *pkt;
pkt = (PKT *)calloc(1, sizeof(PKT));
pkt->pData = calloc(ETHERNET_MTU+6, sizeof(char));

if(comFd < 0)
printf("error");
printf("tmr tick");

stat = read(fd, pkt->pData, 8);
i=0;
while(i < stat)
{printf("%x-", pkt->pData[i]&0xFF);
i++;
}
}

I also have this function
STATUS open_comport(char *consoleName, int baud)
{

int temp, stat;
char debugStr[] = "ayac comport deneme";
comFd = open((const char *)consoleName, O_RDWR, 0);
if (comFd < 0)
{
printf("open_comport failed!");
return ERROR;
}
stat = ioctl(comFd, FIOBAUDRATE, baud);
if (stat < 0)
{
printf("setting baudrate failed!");
return ERROR;
}
stat = ioctl(comFd, FIOSETOPTIONS, OPT_RAW);
if (stat < 0)
{
printf("setting FIOSETOPTIONS failed!");
return ERROR;
}

return OK;
}


Here it goes like this

First I call
open_comport("/tyCo/0", 9600); //this opens the port and sets comFd

value=0;
start_tmr_receive(3,3) // then I start timer
value=0;

But nothing happens then?I expect to see printf("tmr tick"); every 2
secs but didn't work.
What is could be wrong?
Thanks