Package killerbee :: Module dev_rzusbstick :: Class RZUSBSTICK
[hide private]
[frames] | no frames]

Class RZUSBSTICK

source code

Instance Methods [hide private]
None
__init__(self, dev, bus)
Instantiates the KillerBee class for the RZUSBSTICK hardware.
source code
 
__handle_open(self)
Opens the device identified as self.dev, populating self.handle.
source code
 
__dev_setup_v1x(self) source code
 
__handle_open_v0x(self) source code
None
close(self)
Closes the device handle.
source code
 
check_capability(self, capab) source code
 
get_capabilities(self) source code
None
__set_capabilities(self)
Sets the capability information for RZUSB devices.
source code
List
get_dev_info(self)
Returns device information in a list identifying the device identifier, product string and serial number in a list of strings.
source code
 
__usb_write(self, endpoint, data)
Write data to the USB device opened as self.handle.
source code
None
_set_mode(self, mode=0)
Change the operating mode of the USB device to one of the RZ_CMD_MODE_* values.
source code
 
_open_stream(self)
Opens a data stream for receiving packets.
source code
 
_close_stream(self)
Closes a data stream.
source code
None
sniffer_on(self, channel=None)
Turns the sniffer on such that pnext() will start returning observed data.
source code
None
sniffer_off(self)
Turns the sniffer off, freeing the hardware for other functions.
source code
None
jammer_on(self, channel=None)
Not yet implemented.
source code
None
jammer_off(self, channel=None)
Not yet implemented.
source code
None
set_channel(self, channel)
Sets the radio interface to the specifid channel.
source code
None
inject(self, packet, channel=None, count=1, delay=0)
Injects the specified packet contents.
source code
List
pnext(self, timeout=100)
Returns packet data as a string, else None.
source code
None
ping(self, da, panid, sa, channel=None)
Not yet implemented.
source code
Method Details [hide private]

__init__(self, dev, bus)
(Constructor)

source code 

Instantiates the KillerBee class for the RZUSBSTICK hardware.

Parameters:
  • dev (TODO) - USB device identifier
  • bus (TODO) - Identifies the USB bus the device is on
Returns: None
None

__handle_open(self)

source code 

Opens the device identified as self.dev, populating self.handle.
An RZUSBSTICK has a hierarchy of:
\_ Config value: 1
  \_ Interface number 0, with alternate setting 0
     |- Endpoint 132 for responses
     |- Endpoint 2   for control
     |- Endpoint 129 for packets

close(self)

source code 

Closes the device handle. To be re-used, class should be re-instantiated.

Returns: None
None

__set_capabilities(self)

source code 

Sets the capability information for RZUSB devices.

Returns: None
None

get_dev_info(self)

source code 

Returns device information in a list identifying the device identifier, product string and serial number in a list of strings.

Returns: List
List of 3 strings identifying device.

__usb_write(self, endpoint, data)

source code 

Write data to the USB device opened as self.handle.

Parameters:
  • endpoint (Integer) - The USB endpoint to write to
  • data (Mixed) - The data to send to the USB endpoint

_set_mode(self, mode=0)

source code 

Change the operating mode of the USB device to one of the RZ_CMD_MODE_* values. Currently, RZ_CMD_MODE_AC (Air Capture) is the only mode that is used other than RZ_CMD_MODE_NONE.

Parameters:
  • mode (Integer) - Operating mode for the USB stick
Returns: None

sniffer_on(self, channel=None)

source code 

Turns the sniffer on such that pnext() will start returning observed data. Will set the command mode to Air Capture if it is not already set.

Parameters:
  • channel (Integer) - Sets the channel, optional
Returns: None

sniffer_off(self)

source code 

Turns the sniffer off, freeing the hardware for other functions. It is not necessary to call this function before closing the interface with close().

Returns: None

jammer_on(self, channel=None)

source code 

Not yet implemented. Stay tuned.

Parameters:
  • channel (Integer) - Sets the channel, optional
Returns: None

jammer_off(self, channel=None)

source code 

Not yet implemented. Stay tuned.

Returns: None
None

set_channel(self, channel)

source code 

Sets the radio interface to the specifid channel. Currently, support is limited to 2.4 GHz channels 11 - 26.

Parameters:
  • channel (Integer) - Sets the channel, optional
Returns: None

inject(self, packet, channel=None, count=1, delay=0)

source code 

Injects the specified packet contents.

Parameters:
  • packet (String) - Packet contents to transmit, without FCS.
  • channel (Integer) - Sets the channel, optional
  • count (Integer) - Transmits a specified number of frames, def=1
  • delay (Float) - Delay between each frame, def=1
Returns: None

pnext(self, timeout=100)

source code 

Returns packet data as a string, else None.

Parameters:
  • timeout (Integer) - Timeout to wait for packet reception in usec
Returns: List
Returns None is timeout expires and no packet received. When a packet is received, a list is returned, in the form [ String: packet contents | Bool: Valid CRC | Int: Unscaled RSSI ]

ping(self, da, panid, sa, channel=None)

source code 

Not yet implemented.

Returns: None
None