gemhost_java_example

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gemhost_java_example [2020/05/13 18:55]
wikiadmin
gemhost_java_example [2021/04/14 18:09] (current)
wikiadmin
Line 67: Line 67:
       @Override       @Override
       public void connectionStatusChanged(int connectionStatus, String comment) {       public void connectionStatusChanged(int connectionStatus, String comment) {
-         System.out.println ("Current Connection Status " + connectionStatus + " Status String \"" + comment + "\"");        +         System.out.println ("Current Connection Status " + connectionStatus + " Status String \"" + comment + "\"");    
 +         //note: see https://www.ergotech.com/wiki/doku.php?id=host_connection_status for connectionStatus values     
       }       }
     });     });
Line 224: Line 225:
 </code> </code>
  
-The ECIDList is part of the ECIDListReply message and so +The ECIDList is part of the ECIDListReply message. First get the ECIDListReply message and then the ECIDList data source and add the connector. 
 + 
 +<code java> 
 +      ECIDListReply ecidListReply =  (ECIDListReply)host.getMessageBean("ECIDListReply"); 
 +      ecidListReply.getDataSource("ECIDList").addConnector(connector); 
 +</code> 
 + 
 +Here's the full code:
  
 <code java> <code java>
Line 236: Line 244:
 </code> </code>
  
 +Every time the ECIDListReply (S2F30) message is received, the ecidListUpdate method will be called.
 +
 +Normally, the notification would be called only once. However, here, the ECIDList is marked as "Repeat" which means that the ecidListUpdate will be called for each repeat of the list.
 +
 +The ECIDList is the last notification in the "Repeat" parsing, and so when that is received, the ECIDListReply message will have the current values from the list in the ECID, ECIDName, etc. variables.  These can then be retrieved with the "get" methods.  Filling out our notifier a little we may have something like this:
  
 <code java> <code java>
Line 249: Line 262:
 </code> </code>
  
 +Be sure to read the section **Advanced Message Matching** in [[Message Matching]] concerning Repeat and Optional before using this approach, but when required it can be a powerful tool.
 +
 +**Characterization**
 +
 +An alternative to the above approach to listing ECIDs is to use the characterization capabilities of TransSECS.  
 +
 +Characterization provides a list of all CEIDs, Reports (RPTIDs) and VIDs (SVIDs and ECIDs) available on the tool.  Simply call the "characterize" method with the host controller.
 +
 +<code java>
 +Characterize.characterize(host);
 +</code>
 +
 +This will populate the GEM Host Model maintained by the host. This can be retrieved with the call:
 +
 +<code java>
 +host.getGemHostModel();
 +</code>
 +
 +
 +Check the GemHostModel JavaDocs for details of the model.
  
  • gemhost_java_example.1589414101.txt.gz
  • Last modified: 2020/05/13 18:55
  • by wikiadmin