public AbstractConnectedDevice(
      final Subscriber subscriber, final Publisher publisher, final EventLoop eventLoop) {
    super(subscriber, publisher, eventLoop);
    DeviceConnectivityTypeSupport.register_type(
        domainParticipant, DeviceConnectivityTypeSupport.get_type_name());
    deviceConnectivityTopic =
        TopicUtil.findOrCreateTopic(
            domainParticipant, DeviceConnectivityTopic.VALUE, DeviceConnectivityTypeSupport.class);
    deviceConnectivityWriter =
        (DeviceConnectivityDataWriter)
            publisher.create_datawriter_with_profile(
                deviceConnectivityTopic,
                QosProfiles.ice_library,
                QosProfiles.state,
                null,
                StatusKind.STATUS_MASK_NONE);

    if (null == deviceConnectivityWriter) {
      throw new RuntimeException("unable to create writer");
    }

    deviceConnectivity = new DeviceConnectivity();
    deviceConnectivity.type = getConnectionType();
    deviceConnectivity.state = getState();
  }
Exemple #2
0
  @Override
  public void start(final Publisher publisher, final EventLoop eventLoop) {
    this.eventLoop = eventLoop;
    VitalModelImpl.this.publisher = publisher;
    DomainParticipant participant = publisher.get_participant();

    ice.GlobalAlarmLimitObjectiveTypeSupport.register_type(
        participant, ice.GlobalAlarmLimitObjectiveTypeSupport.get_type_name());

    globalAlarmLimitTopic =
        TopicUtil.findOrCreateTopic(
            participant,
            ice.GlobalAlarmLimitObjectiveTopic.VALUE,
            ice.GlobalAlarmLimitObjectiveTypeSupport.class);
    writer =
        (ice.GlobalAlarmLimitObjectiveDataWriter)
            publisher.create_datawriter_with_profile(
                globalAlarmLimitTopic,
                QosProfiles.ice_library,
                QosProfiles.state,
                null,
                StatusKind.STATUS_MASK_NONE);
  }