<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en"> 
    <title>Open Source Bluetooth PAN's Forum Nokia Blog - Symbian, Descriptors and Unicode</title>  
                    <updated>2009-01-21T13:14:56Z</updated>
    <id>http://blogs.forum.nokia.com,8.9/</id>
    <link rel="alternate" type="text/html" hreflang="en" href="http://blogs.forum.nokia.com/blog/open-source-bluetooth-pans-forum-nokia-blog/2009/01/20/symbian-descriptors-and-unicode" />
    <rights>Copyright (c) 2008 Nokia</rights> 
    <generator uri="http://www.lifetype.net/" version="1.2">LifeType</generator> 

                                    <entry>
            <title>Response</title>
            <link rel="alternate" type="text/html" href="http://blogs.forum.nokia.com/blog/open-source-bluetooth-pans-forum-nokia-blog/2009/01/20/symbian-descriptors-and-unicode#comment24697" />
            <id>tag:blogs.forum.nokia.com,2009-01-21:24697</id>
                        <updated>2009-01-21T13:14:56Z</updated>
            <published>2009-01-21T13:14:56Z</published>
            <summary type="html"> Thanks for discussion guys! 
With last suggestion I could repeat the trick in this manner: 
 const TUint8* tempBuf_1 = &amp;amp;buf8[0]; 
TUint8*       tempBuf_2 = const_cast(tempBuf_1  ); 
TUint16* ...</summary>
            <author>
                <name>Carbider</name>
                <uri>http://blogs.forum.nokia.com/blog/open-source-bluetooth-pans-forum-nokia-blog</uri>
            </author>
            <content type="text/html" xml:lang="en" xml:base="http://blogs.forum.nokia.com/blog/open-source-bluetooth-pans-forum-nokia-blog">
                &lt;p&gt;Thanks for discussion guys!&lt;br /&gt;
With last suggestion I could repeat the trick in this manner:&lt;/p&gt;
&lt;p&gt;const TUint8* tempBuf_1 = &amp;amp;buf8[0];&lt;br /&gt;
TUint8*       tempBuf_2 = const_cast(tempBuf_1  );&lt;br /&gt;
TUint16*      tempBuf_3 = (TUint16*)(tempBuf_2);&lt;br /&gt;
TPtrC ptr16(tempBuf_3, destLength);&lt;br /&gt;
buf16.Copy(ptr16);&lt;/p&gt;

            </content>
        </entry>
                                    <entry>
            <title>TPtr/C16</title>
            <link rel="alternate" type="text/html" href="http://blogs.forum.nokia.com/blog/open-source-bluetooth-pans-forum-nokia-blog/2009/01/20/symbian-descriptors-and-unicode#comment24694" />
            <id>tag:blogs.forum.nokia.com,2009-01-20:24694</id>
                        <updated>2009-01-20T21:05:19Z</updated>
            <published>2009-01-20T21:05:19Z</published>
            <summary type="html"> Based on how 8-bit descriptors look like in the memory I would trust that [0] is word-aligned and try 
TPtrC ptr16(static_cast(&amp;amp;buf8[0]),buf8.Size()/2); 
</summary>
            <author>
                <name>wizard_hu_</name>
                <uri>http://blogs.forum.nokia.com/blog/open-source-bluetooth-pans-forum-nokia-blog</uri>
            </author>
            <content type="text/html" xml:lang="en" xml:base="http://blogs.forum.nokia.com/blog/open-source-bluetooth-pans-forum-nokia-blog">
                &lt;p&gt;Based on how 8-bit descriptors look like in the memory I would trust that [0] is word-aligned and try&lt;br /&gt;
TPtrC ptr16(static_cast(&amp;amp;buf8[0]),buf8.Size()/2);&lt;/p&gt;

            </content>
        </entry>
                                    <entry>
            <title>TPckg* classes</title>
            <link rel="alternate" type="text/html" href="http://blogs.forum.nokia.com/blog/open-source-bluetooth-pans-forum-nokia-blog/2009/01/20/symbian-descriptors-and-unicode#comment24692" />
            <id>tag:blogs.forum.nokia.com,2009-01-20:24692</id>
                        <updated>2009-01-20T12:49:40Z</updated>
            <published>2009-01-20T12:49:40Z</published>
            <summary type="html"> Note that there are the TPckg family of templated wrapper classes (TPckg, TPckgC, TPckgBuf) for packaging any fixed-size data (e.g. T class instances) in a 8-bit descriptor and extracting such ...</summary>
            <author>
                <name>laa-laa</name>
                <uri>http://blogs.forum.nokia.com/blog/open-source-bluetooth-pans-forum-nokia-blog</uri>
            </author>
            <content type="text/html" xml:lang="en" xml:base="http://blogs.forum.nokia.com/blog/open-source-bluetooth-pans-forum-nokia-blog">
                &lt;p&gt;Note that there are the TPckg family of templated wrapper classes (TPckg, TPckgC, TPckgBuf) for packaging any fixed-size data (e.g. T class instances) in a 8-bit descriptor and extracting such packages.&lt;/p&gt;
&lt;p&gt;Lauri&lt;/p&gt;

            </content>
        </entry>
    </feed>