com.sun.spot.peripheral.radio
Class RadiogramProtocolManager
java.lang.Object
com.sun.spot.peripheral.radio.RadioProtocolManager
com.sun.spot.peripheral.radio.RadiogramProtocolManager
- All Implemented Interfaces:
- IProtocolManager, IRadiogramProtocolManager, IRadioProtocolManager
public class RadiogramProtocolManager
- extends RadioProtocolManager
- implements IProtocolManager, IRadiogramProtocolManager
PROTOCOL_NUMBER
public static final byte PROTOCOL_NUMBER
- See Also:
- Constant Field Values
PROTOCOL_NAME
public static final String PROTOCOL_NAME
- See Also:
- Constant Field Values
RadiogramProtocolManager
public RadiogramProtocolManager()
- Construct an instance to manage the given protocol number.
main
public static void main(String[] args)
getInstance
public static IRadiogramProtocolManager getInstance()
send
public long send(ConnectionID cid,
long toAddress,
byte[] payload,
int length)
throws NoAckException,
ChannelBusyException,
NoRouteException
- Description copied from interface:
IRadioProtocolManager
- Send a byte array using a ConnectionID. The client code should leave
IPortBasedProtocolManager.DATA_OFFSET bytes free at the front of their
payload as these will be overwritten.
- Specified by:
send
in interface IRadioProtocolManager
- Parameters:
cid
- the ConnectionID to send the packet over.payload
- the datalength
- number of bytes to send, starting with index 0
- Returns:
- the time at which the data was sent
- Throws:
NoAckException
ChannelBusyException
NoRouteException
processIncomingData
public void processIncomingData(byte[] payload,
LowPanHeaderInfo headerInfo)
- Description copied from interface:
IProtocolManager
- Called whenever data is received that is addressed to this
IProtocolManager
.
IProtocolManagers should do as little processing as possible inside
this method, to avoid blocking other INewProtocolManagers from receiving
their packets. Typically an IProtocolManager will queue received
packets for later dispatch to applications.
- Specified by:
processIncomingData
in interface IProtocolManager
getName
public String getName()
- Specified by:
getName
in class RadioProtocolManager
addServerConnection
public ConnectionID addServerConnection(byte portNo)
- Description copied from interface:
IRadiogramProtocolManager
- Register a server connection
- Specified by:
addServerConnection
in interface IRadiogramProtocolManager
- Parameters:
portNo
- - port number to communicate over
- Returns:
- resultant ConnectionID
addBroadcastConnection
public ConnectionID addBroadcastConnection(byte portNo)
- Description copied from interface:
IRadiogramProtocolManager
- Register a broadcast connection
- Specified by:
addBroadcastConnection
in interface IRadiogramProtocolManager
- Parameters:
portNo
- - port number to communicate over
- Returns:
- resultant ConnectionID
Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.