Re: Question regarding ASN_OCTET_STR Type
Farid Farid <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Thanks Dave. It is working now. Regards, Farid ________________________________ From: Dave Shield <[email protected]> To: Farid Farid <[email protected]> Cc: "[email protected]" <[email protected]> Sent: Friday, January 18, 2013 2:33 PM Subject: Re: Question regarding ASN_OCTET_STR Type On 18 January 2013 19:57, Farid Farid <[email protected]> wrote: > When I run snmpget to read my_mib I get the Hex and not ASCII for "Hello > World". > > So I get 48 65 6c 6c 6f 20 57 6f 72 6c 64 1f. instead of "Hello World" > > How can I send the data to see the string in ASCII format Looking at those hex values, I suspect the problem is the last one ('1f') - that's probably being regarded as "non-printable", so the whole string is represented in hex, rather than ascii. Try setting the value using snmp_set_var_typed_value( request->requestvb , ASN_OCTECT_CTR, (u_char *) &my_data , strlen(my_data)); (instead of 'sizeof'), and see if that helps. Dave ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122412 _______________________________________________ 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