Skip to content

How to reuse trap and update setTrapOID() for each send #48

Description

@dmarc1234

Hi,

I am using your great library to send temperature SET traps to my PC every minute when over a particular threshold and its working well.

The problem I have is that when the temperature drops below a threshold I want to send a CLEAR trap to inform my software that the threshold is no long breached. This means I need to change the originally configured:

snmp_trap->setTrapOID(new OIDType(".1.3.6.1.4.1.311.2.6.1.1"));

to

snmp_trap->setTrapOID(new OIDType(".1.3.6.1.4.1.311.2.6.2.1"));

However, if I do this using 'new' the heap reduces on each trap and eventually reaches a point where the ESP32 reboots due to an exception error.

How can I redfine the setTrapOID() without using 'new' ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions