|
|||||||||||
Technical Support On-Line Manuals RL-ARM User's Guide (MDK v4) ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
MIB TableThe snmp_mib table is defined as an array. The components of this array are of type MIB_ENTRY. const MIB_ENTRY snmp_mib[] = { /* ---------- System MIB ----------- */ /* SysDescr Entry */ { MIB_OCTET_STR | MIB_ATR_RO, 8, {OID0(1,3), 6, 1, 2, 1, 1, 1, 0}, MIB_STR("Embedded System SNMP V1.0"), NULL }, /* SysObjectID Entry */ { MIB_OBJECT_ID | MIB_ATR_RO, 8, {OID0(1,3), 6, 1, 2, 1, 1, 2, 0}, MIB_STR("\x2b\x06\x01\x02\x01\x01\x02\x00"), NULL }, /* SysUpTime Entry */ { MIB_TIME_TICKS | MIB_ATR_RO, 8, {OID0(1,3), 6, 1, 2, 1, 1, 3, 0}, 4, &snmp_SysUpTime, NULL }, .. } In the following example, we will construct a MIB variable entry LedOut. It will allow SNMP Manager to control LED diodes on an evaluation board.
For the LedOut control we actually need the following parts of code to be defined in SNMP_MIB.c module: static U8 LedOut; static void write_leds (int mode); const MIB_ENTRY snmp_mib[] = { .. /* LedOut Entry */ { MIB_INTEGER, 6, {OID0(1,3), 6, 1, 3, 1, 0}, MIB_INT(LedOut), write_leds }, .. } static void write_leds (int mode) { /* No action on read access. */ if (mode == MIB_WRITE) { LED_out (LedOut); } } Extended OID encodingThe value of OID address byte must be less than 128. If it is not, an OID address must be encoded in extended format. This is because the high bit of an address byte is an address extension bit. For example, the OID address 1.3.6.1.4.1.311.0 is encoded as: 8, {OID0(1,3), 6, 1, 4, 1, 130, 55, 0}, The address value for the highlighted numbers is calculated as: (130-128) * 128 + 55 = 311 The OID address 1.3.6.1.4.1.31036.50.1.1.0 is encoded as: 12, {OID0(1,3), 6, 1, 4, 1, 129, 242, 60, 50, 1, 1, 0}, where the value 31036 is calculated as: (129-128) * 128 * 128 + (242-128) * 128 + 60 = 31036 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.