Пример #1
0
        public void CreateInterfaceSecure(string name, InterfaceDescription iface, SecurityPolicy policy)
        {
            var status = alljoyn_busattachment_createinterface_secure(Handle, name, iface.Handle, (alljoyn_interfacedescription_securitypolicy)policy);

            if (status != 0)
            {
                throw new AllJoynException(status, "Failed to create interface");
            }
        }
Пример #2
0
        public void CreateInterface(string name, InterfaceDescription iface)
        {
            var status = alljoyn_busattachment_createinterface(Handle, name, iface.Handle);

            if (status != 0)
            {
                throw new AllJoynException(status, "Failed to create interface");
            }
        }
Пример #3
0
        public void AddInterfaceAnnounced(InterfaceDescription iface)
        {
            var result = alljoyn_busobject_addinterface_announced(Handle, iface.Handle);

            if (result != 0)
            {
                throw new AllJoynException(result);
            }
        }
Пример #4
0
        public InterfaceDescription[] GetInterfaces()
        {
            ulong numIfaces = (ulong)alljoyn_busattachment_getinterfaces(Handle, IntPtr.Zero, UIntPtr.Zero);

            IntPtr[] ifaces          = new IntPtr[(int)numIfaces];
            GCHandle gch             = GCHandle.Alloc(ifaces, GCHandleType.Pinned);
            ulong    numIfacesFilled = (ulong)alljoyn_busattachment_getinterfaces(Handle,
                                                                                  gch.AddrOfPinnedObject(), (UIntPtr)numIfaces);

            gch.Free();
            if (numIfaces != numIfacesFilled)
            {
                // Warn?
            }
            InterfaceDescription[] ret = new InterfaceDescription[(int)numIfacesFilled];
            for (int i = 0; i < ret.Length; i++)
            {
                ret[i] = new InterfaceDescription(ifaces[i]);
            }
            return(ret);
        }
Пример #5
0
        public InterfaceDescription GetInterface(string name)
        {
            var handle = alljoyn_busattachment_getinterface(Handle, name);

            return(InterfaceDescription.Create(handle));
        }
Пример #6
0
 public void SetAnnounceFlag(InterfaceDescription iface, bool announced)
 {
     alljoyn_busobject_setannounceflag(Handle, iface.Handle, announced ? alljoyn_about_announceflag.ANNOUNCED : alljoyn_about_announceflag.UNANNOUNCED);
 }