public class HdlcDemo extends java.lang.Object implements ICallbacks
Modifier and Type | Class and Description |
---|---|
class |
HdlcDemo.DemoException |
Constructor and Description |
---|
HdlcDemo() |
Modifier and Type | Method and Description |
---|---|
void |
initializeParameters()
Initialize parameters.
|
static void |
main(java.lang.String[] args)
Launches the demo
|
void |
onReceivedStream(byte[] stream)
onReceivedStream callback method.
|
void |
onSentStream(byte[] stream)
OnSentStream callback method.
|
void |
onStateChange(HDLCProtocolState state)
onStateChange callback method.
|
boolean |
processXmlFile(java.lang.String filePath)
Processes an XML file.
|
public void initializeParameters()
Adapt to your meter parameters.
public boolean processXmlFile(java.lang.String filePath) throws icube.xmlpdu.infra.XmlPduException, EzHdlcException, java.io.IOException
filePath
- the file pathicube.xmlpdu.infra.XmlPduException
EzHdlcException
java.io.IOException
public static void main(java.lang.String[] args)
public void onReceivedStream(byte[] stream)
ICallbacks
Called when a byte stream is received from the meter.
onReceivedStream
in interface ICallbacks
stream
- Byte stream received.public void onSentStream(byte[] stream)
ICallbacks
Called when a byte stream is sent to the meter.
onSentStream
in interface ICallbacks
stream
- Byte stream sent.public void onStateChange(HDLCProtocolState state)
ICallbacks
Called when a Meter's state change occurs.
onStateChange
in interface ICallbacks
state
- The new state.HDLCProtocolState