SNMPNotify Function

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
SNMPNotify Function
C
BOOL SNMPNotify(
    SNMP_ID var, 
    SNMP_VAL val, 
    SNMP_INDEX index
);
Description

This function creates SNMP trap PDU and sends it to previously specified remoteHost. snmpv1 trap pdu: | PDU-type | enterprise | agent-addr | generic-trap | specific-trap | | time-stamp | varbind-list | 

The v1 enterprise is mapped directly to SNMPv2TrapOID.0 

For ASCII STR trap VAL(argument) contains the pointer address of the string variable.

Preconditions

SNMPIsNotifyReady() is already called and returned TRUE.

Parameters
Parameters 
Description 
var 
SNMP var ID that is to be used in notification 
val 
Value of var. Only value of BYTE, WORD or DWORD can be sent. 
index 
Index of var. If this var is a single,index would be 0, or else if this var Is a sequence, index could be any value from 0 to 127 
Return Values
Return Values 
Description 
TRUE 
if SNMP notification was successful sent. This does not guarantee that remoteHost recieved it. 
FALSE 
Notification sent failed. 
This would fail under following contions 
1) Given SNMP_BIB_FILE does not exist in MPFS 2) Given var does not exist. 3) Previously given agentID does not exist 
4) Data type of given var is unknown 
only possible if MPFS itself was corrupted. 
Remarks

This would fail if there were not UDP socket to open.

Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.