SNMPv2 traps sent with naSnmpSendTrap

I want to use the naSnmpSendTrap function to send a SNMPv2 trap. It works but I have a problem.
The trap OID is the same as the OID of the first variable. In the MIB table I have to add an object with the type NOTIFICATION-TYPE that is used for traps in SNMPv2. This object also have an OID different from the OID of the first variable, because it is not allowed to have two objects with the same OID in the table. How can I tell the naSnmpSendTrap to send the trap to the correct OID and how must the OID object for the trap look in the MIB table?

It sounds like you might be mixing the SNMPv3 API with the SNMPv1/SNMPv2c specific API functions. These are two different interfaces. If you’re trying to use naSnmpSendTrap, you need to call naSnmpAddTrap first to setup the traps, and then make your call to naSnmpSendTrap to send out your traps filled with the correct OID information.

Assuming you’re using the correct functions, do you have a code snippet of what you’re talking about?

Its more easy to you, build a mib file and then use the mibcompiler. The software generate all that you need to be happy. Look on the examples of Digi suplied with your development kit.