0

I am trying to create an application witch will announce the signal through all the bus. The idea that you do not need to connect to particular object in the bus. I saw that interfaces could be Introspectable, but as I found this interfaces automatically added to bus object when it is registering on bus. So the question is how to make signal visible in the bus.

Interface:

@BusInterface(name = Door.DOOR_INTF_NAME, announced = "true")
public interface Door {

    String DOOR_INTF_NAME = "com.example.Door";
    String PERSON_PASSED_THROUGH = "PersonPassedThrough";

    @BusSignal(name = PERSON_PASSED_THROUGH, sessionless = true)
    void personPassedThrough(String person) throws BusException;
}

publushing:

private void doRegisterBusObject(Object obj) {
    LocatableBusObject object = (LocatableBusObject) obj;
    String location = object.getBusObjectLocation();
    if (!location.startsWith("/")) {
        location = "/" + location;
    }
    // Register the object on the local bus
    Status status = bus.registerBusObject(object, location);
    if (Status.OK != status) {
        return;
    }
    // Have About send a signal a new door is available.
    aboutObj.announce(CONTACT_PORT, aboutData);
}

The object is visible, but signal is not.

Lebedevsd
  • 950
  • 5
  • 12
  • maybe adding `status = bus.addMatch("sessionless='t'");` – Lino Mar 30 '16 at 11:54
  • @Lino, hi where can I find some information about rules for BusAttachment? All I see is just to add the rule, but what is it doing and some examples? – Lebedevsd Mar 30 '16 at 12:25
  • Since the `addMatch` adds a DBUS matching rule, I think you can take a look here: https://dbus.freedesktop.org/doc/dbus-specification.html#bus-messages-add-match – Lino Mar 31 '16 at 06:53
  • @Lino, as i undestand this rules are added only for client application, but not for the provider. Regarding this article https://allseenalliance.org/framework/documentation/learn/core/system-description/sessionless-signal provider should only register bus object with sessionless signal, and thats it. But this approach dont work in my application. I could not detect this signal with EventsActionBrowser application from examples. – Lebedevsd Mar 31 '16 at 07:24

1 Answers1

0

Basically, the interface org.allseen.Introspectable is added by the router, only in case when we announce description for the @BusInterface.

Until then, we will not have this interface.

Lebedevsd
  • 950
  • 5
  • 12