SENA HD1200 User Manual

Page 50

Advertising
background image

Starter Kit and User Manual for the HelloDevice 1200

47

for (int i=0; i<256; i++)

retData[i]

=

rxData[i+4]

;


return

retData;

}

} catch (Exception e) {

System.out.println("Err : " + e);

}
return

data;

}
public synchronized void writeValue(int addr, int length, byte[] buffer) {

byte[] txData = new byte[ length + 6 ];

txData[0] = COMMAND_SET;

txData[1] = (byte) ((addr >> 8) & 0x000000ff);

txData[2] = (byte) (addr & 0x000000ff);

txData[3] = (byte) ((length >> 8) & 0x000000ff);

txData[4] = (byte) (length & 0x000000ff);

txData[5] = 0 ; // Set interrupt flags as 0


System.arraycopy(buffer, addr, txData, 6, length);


//

Initialize

socket

try

{

socketTCP.getOutputStream().write(txData,

0,

txData.length);

} catch (Exception e) {

System.out.println("Err: " + e);

}
}
}

Advertising