Re: SNMP TRAP stop working if IP address was changed
OK, seems like I solved this. The problem was, TCPIP_STACK_NetDown() set "default net" to zero (tcpipDefIf.defaultNet = 0), and after this TCPIP_SNMP_SendTrapToSelctedInterface() always fails to send TRAP. So, after TCPIP_STACK_NetUp() I have to call TCPIP_STACK_NetDefaultSet() in non-blocking way, since it set default net only if flag Flags.bInterfaceEnabled is true, which is set somewhere in MAC driver. Now my code looks like this:
//I'm using protothreads here for non-blocking check
PT_WAIT_WHILE(pt, TCPIP_STACK_NetDefaultSet(httpNetData.currNet) != true);
It's kinda sad what TCPIP_STACK_NetDefaultSet() is never used in any TCP examples provided with Harmony 2_06...
Let's telegram! t.me/microchip_forum