What is a good way to show a floating point number via SNMP?

后端 未结 3 1038
栀梦
栀梦 2021-01-05 05:26

I am coding an SNMP Agent. I need to send values that have a decimal point to an SNMP Manager.

I have a couple options:

  1. Truncate the number.
3条回答
  •  礼貌的吻别
    2021-01-05 06:05

    I rather send that data via OCTET STRING/DisplayString. Numbers such as "1.5" can be sent easily.

    However, if the data need to be accurate, you may use Kyle's suggestion by sending bytes (octets). Noticeably that is also sent via OCTET STRING as it is a perfect byte container.

提交回复
热议问题