Exemplo n.º 1
0
  private void processSegmentDataEvent(InvokeIDType id, EventReportArgumentSimple event) {
    PM_Store pmstore = this.state_handler.getMDS().getPM_Store(event.getObj_handle());
    if (pmstore == null) return;

    RelativeTime rt = event.getEvent_time();
    Logging.debug("Relative Time: " + rt.getValue().getValue().intValue());

    try {
      SegmentDataEvent sde =
          ASN1_Tools.decodeData(
              event.getEvent_info(),
              SegmentDataEvent.class,
              this.state_handler.getMDS().getDeviceConf().getEncondigRules());
      SegmentDataResult sdr = pmstore.Segment_Data_Event(sde);

      EventReportResultSimple errs =
          MessageFactory.genEventReportResultSimple(
              event, sdr, state_handler.getMDS().getDeviceConf().getEncondigRules());
      DataApdu data = new DataApdu();
      MessageChoiceType mct = new MessageChoiceType();
      mct.selectRors_cmip_confirmed_event_report(errs);
      data.setInvoke_id(id);
      data.setMessage(mct);

      state_handler.send(MessageFactory.composeApdu(data, state_handler.getMDS().getDeviceConf()));
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Exemplo n.º 2
0
  private void processDataApdu(DataApdu data) {
    MessageChoiceType msg = data.getMessage();
    // Process the message received
    if (msg.isRoiv_cmip_event_reportSelected()) {
      Logging.debug(">> Roiv_cmip_event_report");
      roiv_cmip_event_report(data);
    } else if (msg.isRoiv_cmip_confirmed_event_reportSelected()) {
      Logging.debug(">> Roiv_cmip_confirmed_event_report");
      roiv_cmip_confirmed_event_report(data);
    } else if (msg.isRoiv_cmip_getSelected()) {
      // TODO:
      Logging.debug(">> Roiv_cmip_get");
      roiv_cmip_get(data);
    } else if (msg.isRoiv_cmip_setSelected()) {
      // TODO:
      Logging.debug(">> Roiv_cmip_set");
    } else if (msg.isRoiv_cmip_confirmed_setSelected()) {
      // TODO:
      Logging.debug(">> Roiv_cmip_confirmed_set");
    } else if (msg.isRoiv_cmip_actionSelected()) {
      // TODO:
      Logging.debug(">> Roiv_cmip_action");
    } else if (msg.isRoiv_cmip_confirmed_actionSelected()) {
      // TODO:
      Logging.debug(">> Roiv_cmip_confirmed_action");
    } else if (msg.isRors_cmip_confirmed_event_reportSelected()) {
      // TODO:
      Logging.debug(">> Rors_cmip_confirmed_event_report");
    } else if (msg.isRors_cmip_getSelected()) {
      // TODO:
      Logging.debug(">> Rors_cmip_get");
    } else if (msg.isRors_cmip_confirmed_setSelected()) {
      // TODO:
      Logging.debug(">> Rors_cmip_confirmed_set");
    } else if (msg.isRors_cmip_confirmed_actionSelected()) {
      // TODO:
      Logging.debug(">> Rors_cmip_confirmed_action");
    } else if (msg.isRoerSelected()) {
      // TODO:
      Logging.debug(">> Roer");
    } else if (msg.isRorjSelected()) {
      // TODO:
      Logging.debug(">> Rorj");
    }

    DimTimeOut to = state_handler.retireTimeout(data.getInvoke_id().getValue());
    if (to != null) to.procResponse(data);
  }