com.buglabs.bug.module.bugbee.pub
Interface IBUGBeePacket

All Known Implementing Classes:
BUGBeeModletPacket

public interface IBUGBeePacket

An interface to the BUGbee packet connection, for sending data to, and receiving data, from other nodes in the PAN.


Field Summary
static int MSG_DONTWAIT
          Flag to indicate that the call should not wait for data if none is already available.
static int MSG_PEEK
          Flag to indicate that the incoming data should not be removed from the queue.
 
Method Summary
 int read(byte[] buf, int len, int flags)
          Read data coming in from the ZigBee PAN.
 int write(byte[] buf, int len, int flags)
          Send out a data packet.
 

Field Detail

MSG_PEEK

static final int MSG_PEEK
Flag to indicate that the incoming data should not be removed from the queue.

See Also:
Constant Field Values

MSG_DONTWAIT

static final int MSG_DONTWAIT
Flag to indicate that the call should not wait for data if none is already available.

See Also:
Constant Field Values
Method Detail

write

int write(byte[] buf,
          int len,
          int flags)
          throws java.io.IOException
Send out a data packet. If you've done a bind, be sure to send data in the appropriate format (so if you did an AppRegister, send SAPI packets, and if you did an AFRegister, send AF packets).

Parameters:
buf - the buffer containing the data to be sent
len - the number of bytes to send from buf
flags -
Returns:
Throws:
java.io.IOException

read

int read(byte[] buf,
         int len,
         int flags)
         throws java.io.IOException
Read data coming in from the ZigBee PAN. This interface is only appropriate if there's only one application that needs to receive data; that is only one application that made use of IBUGBeeControl.registerAppRequest(byte, short, short, byte, short[], short[]) or IBUGBeeControl.registerAFRequest(byte, short, short, byte, short[], short[]).

Parameters:
buf - the buffer to read data into
len - the maximum amount of data to read
flags - MSG_PEEK or MSG_DONTWAIT
Returns:
Throws:
java.io.IOException