lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] snmp_send_trap_specific notification code example


From: Ricardo Takaki
Subject: Re: [lwip-users] snmp_send_trap_specific notification code example
Date: Mon, 22 Nov 2021 15:36:19 -0300

Hi Harrold,

I have tried your example without success, I am having trouble when configuring the varbinds before sending the trap. Below is part of my code.
I actually need to send the batteryActualCapacity parameter as a varbind parameter but I am not sure how to include it into the trap message.
Can you please help me with that?

Thanks and best regards
Ricardo

/**
 * \brief get battery actual capacity
 * @return
 */
u32_t getBatteryActualCapacity(struct snmp_tree_node node){

u32_t batteryActualCapacity = 4;

struct snmp_varbind *varbinds = NULL;
err_t err;

u32_t varbinds_value = 0;

if(batteryActualCapacity > getBatteryAlarmLowCapacity())
{
varbinds_value = 4;
}
else{
varbinds_value = 0;
}

err = snmp_send_trap_specific(node.node.oid, varbinds);

TPRINTF("snmp_send_trap_specific() err: %d\r\n", err);

return batteryActualCapacity;
}


Em sex., 19 de nov. de 2021 às 11:25, Ricardo Takaki <rtakaki@cpqd.com.br> escreveu:
Hi Harrold, thanks for the help.
best regards

Em sex., 19 de nov. de 2021 às 11:05, Harrold Spier <harrold.spier@gmail.com> escreveu:
Hi  Rtakaki,

Maybe the attache code snippets can help you a little bit. It calls snmp_send_trap() at the end, but that function has much in common with snmp_send_trap_specific().

The code is extracted from a large application, so it probably need some adjustment. Let me know if something is still missing

Best regards,
Harrold


On Fri, 19 Nov 2021 at 13:44, Ricardo Takaki <rtakaki@cpqd.com.br> wrote:
Hello all,

I am trying to write a code using the snmp_send_trap_specific() lwip function to send a trap notification but I am having trouble filling the function's parameters.
I could not see any example in the lwip source code that could help me to use this function.
Could you please show me how to use this function? 
A simple example,  if possible, which uses the specific_trap ad varbind structure would be a great help.

Thanks in advance and best regards,

rtakaki



"Esta mensagem pode conter informações confidenciais ou privilegiadas. Caso não seja o destinatário desta mensagem ou caso ela lhe tenha sido enviada por engano, pedimos a gentileza de eliminar esta mensagem e todos os seus anexos imediatamente. Utilizar, divulgar a quaisquer terceiros ou copiar esta mensagem para qualquer fim é expressamente proibido e punido por lei."

"This message may contain privileged or confidential information. If you are not the intended recipient of this message or if you have received it in error, please kindly delete this message and all its attachments immediately. Unauthorized use, disclosure to any third parties or copying of this message is expressly prohibited and may be subject to the penalties of law."

_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users







"Esta mensagem pode conter informações confidenciais ou privilegiadas. Caso não seja o destinatário desta mensagem ou caso ela lhe tenha sido enviada por engano, pedimos a gentileza de eliminar esta mensagem e todos os seus anexos imediatamente. Utilizar, divulgar a quaisquer terceiros ou copiar esta mensagem para qualquer fim é expressamente proibido e punido por lei."

"This message may contain privileged or confidential information. If you are not the intended recipient of this message or if you have received it in error, please kindly delete this message and all its attachments immediately. Unauthorized use, disclosure to any third parties or copying of this message is expressly prohibited and may be subject to the penalties of law."


reply via email to

[Prev in Thread] Current Thread [Next in Thread]