Hi John
You will find the file snmp.c in the stack directory.
You can add #define USE_SNMP in the UDP section of config.h
Then search application.c for USE_SNMP and you will find some settings:
static const unsigned char ucIP_SNMP_manager[IPV4_LENGTH] = {192, 168, 0, 1}; // SNMP manager address
static const CHAR cSNMP_community[] = "public";
static const CHAR cSNMP_enterprise[] = {0x2b, 6, 1,4,1,4,1,2,15};
On power up a COLD START trap will be sent to the snmp manager:
fnStartSNMP(fnSNMP_callback, (unsigned char *)ucIP_SNMP_manager);
fnSendSNMPTrap(SNMP_COLDSTART, 0); // send cold start trap to SNMP manager
Any queries from the SNMP manager will be handled by the SNMP listener. See the call back function:
static int fnSNMP_callback(unsigned char ucEvent, unsigned char *data, unsigned short usLength)
in application.c where some user data is added to responses.
This is however test code. It does work correctly (the framework is basically complete and good but tables need to be added) but only supports a couple of test queries and traps.
To complete SNMPV1 the individual cases have to be added (quite a lot of stuff if it needs to be complete). Enterprise things are more application specific special responses which will probably be handled in the listener call back.
The reason that this was added is so that anyone with interest can take a look at it and even add a couple of things if only quick and limited support is needed. If you have need for a few queries it should be quite easy to get these integrated so that it can already be used. Traps should already be possible with the function
extern void fnSendSNMPTrap(unsigned char ucTrap, unsigned char ucSpecificCode);
I do know of someone who has used the uTasker and integrated SNMPV1 and SNMPV2 (I don't know to what extent) for his project. If you have an urgent requirement I could put you in touch.
Regards
Mark