Skip to content

Commit 9f642c1

Browse files
authored
Fixed Hbytes
1 parent eb54d5f commit 9f642c1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

JOpenShowVar-core/src/no/hials/crosscom/CrossComClient.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public String simpleRead(String name) throws IOException {
6464
List<Byte> header = new ArrayList<>();
6565
List<Byte> block = new ArrayList<>();
6666

67-
byte hbyte = (byte) ((cmd.length >> 8) & 0xff00);
67+
byte hbyte = (byte) ((cmd.length & 0xff00)>>8);
6868
byte lbyte = (byte) (cmd.length & 0x00ff);
6969

7070
int index = 0;
@@ -74,10 +74,10 @@ public String simpleRead(String name) throws IOException {
7474
for (int i = 0; i < cmd.length; i++) {
7575
block.add(index++, cmd[i]);
7676
}
77-
hbyte = (byte) ((block.size() >> 8) & 0xff00);
77+
hbyte = (byte) ((block.size() & 0xff00)>>8);
7878
lbyte = (byte) (block.size() & 0x00ff);
7979

80-
byte hbytemsg = (byte) ((id >> 8) & 0xff00);
80+
byte hbytemsg = (byte) ((id & 0xff00)>>8);
8181
byte lbytemsg = (byte) (id & 0x00ff);
8282

8383
index = 0;
@@ -123,7 +123,7 @@ public String simpleWrite(String name, String val) throws IOException {
123123
List<Byte> header = new ArrayList<>();
124124
List<Byte> block = new ArrayList<>();
125125

126-
byte hbyte = (byte) ((cmd.length >> 8) & 0xff00);
126+
byte hbyte = (byte) ((cmd.length & 0xff00)>>8);
127127
byte lbyte = (byte) (cmd.length & 0x00ff);
128128

129129
int index = 0;
@@ -134,7 +134,7 @@ public String simpleWrite(String name, String val) throws IOException {
134134
block.add(index++, cmd[i]);
135135
}
136136

137-
hbyte = (byte) ((value.length >> 8) & 0xff00);
137+
hbyte = (byte) ((value.length & 0xff00)>>8);
138138
lbyte = (byte) (value.length & 0x00ff);
139139

140140
block.add(index++, hbyte);
@@ -143,10 +143,10 @@ public String simpleWrite(String name, String val) throws IOException {
143143
block.add(index++, value[i]);
144144
}
145145

146-
hbyte = (byte) ((block.size() >> 8) & 0xff00);
146+
hbyte = (byte) ((block.size() & 0xff00)>>8);
147147
lbyte = (byte) (block.size() & 0x00ff);
148148

149-
byte hbytemsg = (byte) ((id >> 8) & 0xff00);
149+
byte hbytemsg = (byte) ((id & 0xff00)>>8);
150150
byte lbytemsg = (byte) (id & 0x00ff);
151151

152152
index = 0;

0 commit comments

Comments
 (0)