Re: Using the net-snmp library to set/get custom MIB value on printer

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
2009/1/28 Nick Bartolotti <[email protected]>:
> char x = '4';
> char i = 'i';
> int r = snmp_add_var(pdu, anOID, anOID_len, i, &x);

The final parameter (the actual value) is a string, not a single character.

Try
    char *value = "4";
    char  vtype  = 'i';
    int r  = snmp_add_var(pdu, anOID, anOID_len, vtype, value);


> Is -56 (SNMPERR_BAD_NAME) an error returned from the printer
> or an error from the library?

It's from the library - and is a misleading error.
It's actually complaining about the value, not the name.

I'll fix that.

Dave

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.