Dear,
I use an agentX with NetSNMP 5.5. The mib variables set via serial port
and
I use interrupt-based program for this purpose. The rate of date refresh
is
high. and the problem, when I want to read variables via Get command.
sometimes this command return 0 value for that variable, whereas I am sure
it's value is not zero.
I think there were conflict between serial signal SIGIO, and
agent_check_and_process(0) function. Also I have an important 300 ms
timer. Is there there was a conflict between this timer (SIGALRM) and
agent_check_and_process(0) function?
*Please help me!*
A schema of my program was:
int
main (int argc, char **argv)
{
sigemptyset (&block_alarm);
/* Block other terminal-generated signals while handler runs. */
sigaddset (&block_alarm, SIGALRM);
SetTimer(/*100000*/300000,1);
error = OpenComport(portnum, baudrate,databit, stopbit, paritybit);
//sigemptyset(&saio.sa_mask); //saio.sa_mask = 0;
//saio.sa_handler = sig_IO;
saio.sa_sigaction = sig_IO;
//saio.sa_flags = 0;
saio.sa_flags = SA_SIGINFO;
saio.sa_restorer = NULL;
sigaction(SIGIO,&saio,NULL);
while(keep_running)
{
agent_check_and_process(0); /* 0 == don't block */
}
}
void sig_IO (int status, siginfo_t *info, void *data)
{
.....
}
void OnTimer(int theSignal)
{
ninterval.it_value.tv_sec = 0;
ninterval.it_value.tv_usec = 300000; /*100000;*/
.....
}
------------------------------------------------------------------------------
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders