public class BTMessage
extends java.lang.Object
BTMessage
represents a simple way to exchange data over bluetooth.
It has a message type, useful to select the way to handle the message (see BTMessageHandler
)
and a payload.Constructor and Description |
---|
BTMessage() |
Modifier and Type | Method and Description |
---|---|
byte |
getMsgType()
Get the message type.
|
byte[] |
getPayload()
Get the payload.
|
void |
read(java.io.InputStream input)
Decode the input stream to extract message.
|
void |
setMsgType(byte msgType)
Set the Message type
|
void |
setPayload(byte[] payload)
Set the payload
|
void |
write(java.io.OutputStream output)
Writes this message to the given outputstream.
|
public void setMsgType(byte msgType)
public void setPayload(byte[] payload)
public void read(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public void write(java.io.OutputStream output) throws java.io.IOException
java.io.IOException
public byte getMsgType()
public byte[] getPayload()