AllJoynUnity.AllJoyn.BusAttachment.GetPeerGuid C# (CSharp) Method

GetPeerGuid() public method

public GetPeerGuid ( string name, string &guid ) : QStatus
name string
guid string
return QStatus
            public QStatus GetPeerGuid(string name, out string guid)
            {
                UIntPtr guidSz = UIntPtr.Zero;
                QStatus ret = alljoyn_busattachment_getpeerguid(_busAttachment, name,
                    IntPtr.Zero, ref guidSz);
                if(!ret)
                {
                    guid = "";
                }
                else
                {
                    byte[] guidBuffer = new byte[(int)guidSz];
                    GCHandle gch = GCHandle.Alloc(guidBuffer, GCHandleType.Pinned);
                    ret = alljoyn_busattachment_getpeerguid(_busAttachment, name,
                        gch.AddrOfPinnedObject(), ref guidSz);
                    gch.Free();
                    if(!ret)
                    {
                        guid = "";
                    }
                    else
                    {
                        guid = System.Text.ASCIIEncoding.ASCII.GetString(guidBuffer);
                    }
                }
                return ret;
            }
AllJoyn.BusAttachment