public final class InspcDataExchangeAccess
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
InspcDataExchangeAccess.InspcAnswerValueByHandle
An item to set values with an index.
|
static class |
InspcDataExchangeAccess.InspcDatagram
Preparing the header of a datagram.
|
static class |
InspcDataExchangeAccess.Inspcitem
This is the header of an information entry.
|
static class |
InspcDataExchangeAccess.InspcSetValue
ReflItem which contains a value.
|
static class |
InspcDataExchangeAccess.InspcSetValueData
An item to set values with an index.
|
Modifier and Type | Field and Description |
---|---|
static short |
kInvalidHandle
This type identification designates that the index to access by index is invalid.
|
static short |
kLengthAndString
The value is a string uptp 200 character which's length is stored in the first byte.
|
static short |
kReferenceAddr
A reference is the memory-address of an element in C-language
or a significant numeric Identifier of an object (instance) in Java.
|
static short |
kReferenceAddr64
A memory-address of an element in C-language
or a significant numeric Identifier of an object (instance) in Java.
|
static short |
kScalarTypes
Scalar types started with 0xe0,
see
ClassJc.REFLECTION_int32 etc. |
static short |
kTypeNoValue
This type identification designates that the value is not available.
|
static short |
maxNrOfChars
Values between 0..199 determines the length of string.
|
private static int[] |
nrofBytesSpecialTypes |
static java.lang.String |
version
Version, history and license.
|
Constructor and Description |
---|
InspcDataExchangeAccess() |
Modifier and Type | Method and Description |
---|---|
static float |
getFloatChild(short type,
ByteDataAccessBase access)
Returns the byte given value with the designated type as float value with conversion.
|
static int |
getIntChild(short type,
ByteDataAccessBase access)
Returns the byte given value with the designated type as int32 value with conversion.
|
static int |
nrofBytesForType(short type)
Returns the number of bytes for any value which is designated
with 0..
|
public static final java.lang.String version
InspcDataExchangeAccess.Inspcitem.kAccessCheck
InspcDataExchangeAccess.InspcSetValue.getType()
should return short, not byte, to detect the values of the type.
InspcDataExchangeAccess.InspcSetValue.getInt()
etc. now tests the given type and converts it. Till now the transmitter
has known the value type and send it proper. But that is not a common approach.
nrofBytesForType(short)
, InspcDataExchangeAccess.InspcAnswerValueByHandle
.
The getValueByHandle is improved and tested. It is changed in communication yet.
getFloatChild(short, ByteDataAccessBase)
InspcDataExchangeAccess.InspcDatagram.setHeadAnswer(int, int, int)
: Because the nAnswerNr for the first
answer datagram will be incremented, the head need 0 as start value.
InspcDataExchangeAccess.InspcDatagram
and Info to InspcDataExchangeAccess.Inspcitem
, better to associate.
InspcDataExchangeAccess.InspcSetValueData
InspcDataExchangeAccess.InspcDatagram.setHeadRequest(int, int, int)
with answerNr = 0 and InspcDataExchangeAccess.InspcDatagram.setHeadAnswer(int, int, int)
with previous behavior, answerNr = 1 initial. A request telegram sends the answerNr = 0 up to now.
InspcDataExchangeAccess.InspcDatagram.knrofBytes
etc. now private. Any application uses the access methods.
InspcDataExchangeAccess.InspcDatagram.getAnswerNr()
and InspcDataExchangeAccess.InspcDatagram.lastAnswer()
InspcDataExchangeAccess.Inspcitem.kSetvaluedata
, InspcDataExchangeAccess.Inspcitem.kAnswervaluedata
as a new kind of request.
kInvalidHandle
to distinguish an index error from a value error.
InspcDataExchangeAccess.Inspcitem.kGetValueByHandle
The InspcDataExchangeAccess.Inspcitem.setInfoHead(int, int, int)
and InspcDataExchangeAccess.Inspcitem.setLength(int)
now adjusts the
length of the element and parent in the ByteDataAccessBase
data with the same.
Set this information at end of filling variable data in an Info item, then all is correct.
InspcDataExchangeAccess.InspcSetValue
completed with set-methods.
Note: Because this class is used in Java2C for C-Programming, the short methods should be designated
to use macros while translation Java2C.
public static final short maxNrOfChars
public static final short kLengthAndString
public static final short kReferenceAddr64
public static final short kInvalidHandle
public static final short kTypeNoValue
public static final short kReferenceAddr
public static final short kScalarTypes
ClassJc.REFLECTION_int32
etc.private static final int[] nrofBytesSpecialTypes
public static int nrofBytesForType(short type)
maxNrOfChars
.. kScalarTypes
+ ClassJc.REFLECTION_int
etc.type
- public static float getFloatChild(short type, ByteDataAccessBase access)
type
- The type returned by Inspector Communication kScalarTypes
+ ClassJc.REFLECTION_int32
etc.
A string is not converted yet. (Necessary? then TODO).access
- Any data access, the value with the given type will be gotten as next child.public static int getIntChild(short type, ByteDataAccessBase access)
type
- The type returned by Inspector Communication kScalarTypes
+ ClassJc.REFLECTION_int32
etc.
A string is not converted yet. (Necessary? then TODO).access
- Any data access, the value with the given type will be gotten as next child.