Thanks Dave.

It is working now. 

Regards,
Farid


________________________________
 From: Dave Shield <d.t.shi...@liverpool.ac.uk>
To: Farid Farid <farid21...@yahoo.com> 
Cc: "Net-snmp-users@lists.sourceforge.net" 
<Net-snmp-users@lists.sourceforge.net> 
Sent: Friday, January 18, 2013 2:33 PM
Subject: Re: Question regarding ASN_OCTET_STR Type
 
On 18 January 2013 19:57, Farid Farid <farid21...@yahoo.com> 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
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to