Esempio n. 1
0
 private ApduType generateMeasureApdu() {
   Agent a = (Agent) state_handler.getMDS().getDevice();
   Specialization spec = a.getSpecialization();
   Collection<Map<HANDLE, Object>> measures = spec.getMeasures();
   ScanReportInfoMPFixed info = generateScanReportInfo(measures);
   HANDLE handle = new HANDLE();
   handle.setValue(new INT_U16(0));
   OID_Type eventtype = new OID_Type();
   eventtype.setValue(new INT_U16(Nomenclature.MDC_NOTI_SCAN_REPORT_MP_FIXED));
   DataApdu data =
       MessageFactory.PrstRoivCmpConfirmedEventReport(
           state_handler.getMDS(), info, handle, eventtype);
   return MessageFactory.composeApdu(data, state_handler.getMDS().getDeviceConf());
 }
Esempio n. 2
0
  private <T> ScanReportInfoMPFixed generateScanReportInfo(
      Collection<Map<HANDLE, Object>> measures) {
    ScanReportInfoMPFixed info = new ScanReportInfoMPFixed();
    List<ScanReportPerFixed> srpflist = new ArrayList<ScanReportPerFixed>();

    Iterator<Map<HANDLE, Object>> it = measures.iterator();
    while (it.hasNext()) {
      Map<HANDLE, Object> measure = it.next();
      HANDLE handle = new HANDLE();
      handle.setValue(new INT_U16(1));
      ScanReportPerFixed srpf = generateScanReportPerFixed(measure);
      srpflist.add(srpf);
    }
    info.setScan_per_fixed(srpflist);
    info.setScan_report_no(0);
    info.setData_req_id(new DataReqId(0));
    return info;
  }