/// <summary> /// Packetize data into packets, each packets ends with the byte <c>byt</c>. /// </summary> /// <description>Should be called before reading started, otherwize it might make no effect, so it's safer to call it before calling connect().<br> /// The method will override any previous packetization. Check what effect this method has on read() and read(int).</description> /// <remarks>Packets won't contain the end Byte <c>byt</c></remarks> /// <example><b>Example</b> /// Calling setEndByte(13), then read() or read(int) will return the next available bunch of bytes as a <c>byte</c> array that ends with the byte <c>13</c>, /// if there was no end Byte '13' in your sequence of bytes, they won't return anything. /// </example> /// <param name="byt">a <c>byte</c> that seperates each packate from the next one</param> public void setEndByte(byte byt) { if (isDeviceReady()) { javaBtConnection.Call(SET_END_BYTE, byt); reading_mode = READING_MODES.END_BYTE_PACKET; } }
/// <summary> /// Packetize data into packets of a <c>size</c> number of bytes per each. /// </summary> /// <description>Should be called before reading started, otherwize it might make no effect, so it's safer to call it before calling connect().<br> /// The method will override any previous packetization. Check what effect this method has on read() and read(int).</description> /// /// <example><b>Example</b> /// Calling setPacketSize(10), then read() or read(int) will return a <c>byte</c> array of size 10, if 10 or more bytes are available. /// </example> /// <param name="size">size of each packet</param> public void setPacketSize(int size) { if (isDeviceReady()) { javaBtConnection.Call(SET_PACKET_SIZE, size); reading_mode = READING_MODES.LENGTH_PACKET; } }