@@ -66,6 +66,15 @@ public int getId() {
66
66
public String getName () {
67
67
return name ;
68
68
}
69
+
70
+ /**
71
+ * Return the Type of Variable that implements this class
72
+ *
73
+ * @return the Type of variable that implements this class
74
+ */
75
+ public String getType (){
76
+ return this .getClass ().getSimpleName ();
77
+ }
69
78
70
79
/**
71
80
* The time it took to read/write this variable
@@ -118,7 +127,7 @@ public Byte[] getReadCommand() {
118
127
List <Byte > header = new ArrayList <>();
119
128
List <Byte > block = new ArrayList <>();
120
129
121
- byte hbyte = (byte ) ((cmd .length >> 8 ) & 0xff00 );
130
+ byte hbyte = (byte ) ((cmd .length & 0xff00 )>> 8 );
122
131
byte lbyte = (byte ) (cmd .length & 0x00ff );
123
132
124
133
int index = 0 ;
@@ -128,10 +137,10 @@ public Byte[] getReadCommand() {
128
137
for (int i = 0 ; i < cmd .length ; i ++) {
129
138
block .add (index ++, cmd [i ]);
130
139
}
131
- hbyte = (byte ) ((block .size () >> 8 ) & 0xff00 );
140
+ hbyte = (byte ) ((block .size () & 0xff00 )>> 8 );
132
141
lbyte = (byte ) (block .size () & 0x00ff );
133
142
134
- byte hbytemsg = (byte ) ((id >> 8 ) & 0xff00 );
143
+ byte hbytemsg = (byte ) ((id & 0xff00 )>> 8 );
135
144
byte lbytemsg = (byte ) (id & 0x00ff );
136
145
137
146
index = 0 ;
@@ -156,7 +165,7 @@ public Byte[] getWriteCommand() {
156
165
List <Byte > header = new ArrayList <>();
157
166
List <Byte > block = new ArrayList <>();
158
167
159
- byte hbyte = (byte ) ((cmd .length >> 8 ) & 0xff00 );
168
+ byte hbyte = (byte ) ((cmd .length & 0xff00 )>> 8 );
160
169
byte lbyte = (byte ) (cmd .length & 0x00ff );
161
170
162
171
int index = 0 ;
@@ -167,7 +176,7 @@ public Byte[] getWriteCommand() {
167
176
block .add (index ++, cmd [i ]);
168
177
}
169
178
170
- hbyte = (byte ) ((value .length >> 8 ) & 0xff00 );
179
+ hbyte = (byte ) ((value .length & 0xff00 )>> 8 );
171
180
lbyte = (byte ) (value .length & 0x00ff );
172
181
173
182
block .add (index ++, hbyte );
@@ -176,10 +185,10 @@ public Byte[] getWriteCommand() {
176
185
block .add (index ++, value [i ]);
177
186
}
178
187
179
- hbyte = (byte ) ((block .size () >> 8 ) & 0xff00 );
188
+ hbyte = (byte ) ((block .size () & 0xff00 )>> 8 );
180
189
lbyte = (byte ) (block .size () & 0x00ff );
181
190
182
- byte hbytemsg = (byte ) ((id >> 8 ) & 0xff00 );
191
+ byte hbytemsg = (byte ) ((id & 0xff00 )>> 8 );
183
192
byte lbytemsg = (byte ) (id & 0x00ff );
184
193
185
194
index = 0 ;
0 commit comments