Hi all,

I want to check what is the best way to convert code below to value_string

                                proto_tree_add_text(tree, tvb, offset, 1,
                                                "%s%s%s%s",
                                                (buf & 0x80)? "16kHz " : "",
                                                (buf & 0x40)? "32kHz " : "",
                                                (buf & 0x20)? "44.1kHz " : "",
                                                (buf & 0x10)? "48kHz " : "");
                                proto_tree_add_text(tree, tvb, offset, 1,
                                                "%s%s%s%s",
                                                (buf & 0x08)? "Mono " : "",
                                                (buf & 0x04)? "DualChannel " : 
"",
                                                (buf & 0x02)? "Stereo " : "",
                                                (buf & 0x01)? "JointStereo " : 
"");
                                offset++;

Could you point me to some example?

So far I've seen only lots of boolean values.

Regards,
Andrei
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <[email protected]>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:[email protected]?subject=unsubscribe

Reply via email to