Package killerbee :: Class KillerBee
[hide private]
[frames] | no frames]

Class KillerBee

source code

Instance Methods [hide private]
None
__init__(self, device=None)
Instantiates the KillerBee class.
source code
 
__search_bus(self, bus, device) source code
Boolean
check_capability(self, capab)
Uses the specified capability to determine if the opened device is supported.
source code
List
get_capabilities(self)
Returns a list of capability information for the device.
source code
None
__set_rz_capabilities(self)
Sets the capability information for RZUSB devices.
source code
 
__usb_write(self, endpoint, data)
Write data to the USB device opened as self.handle.
source code
String
__usb_read(self, endpoint, timeout=100)
Reads data from the USB device on the specified endpoint.
source code
None
_set_mode(self, mode)
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
 
__handle_open(self)
Opens the device identified as self.dev, populating self.handle
source code
None
close(self)
Closes the device handle.
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
List
dev_list(self)
Return device information for all present devices.
source code
Method Details [hide private]

__init__(self, device=None)
(Constructor)

source code 

Instantiates the KillerBee class.

Parameters:
  • device (String) - USB device identifier
Returns: None
None

check_capability(self, capab)

source code 

Uses the specified capability to determine if the opened device is supported. Returns True when supported, else False.

Returns: Boolean

get_capabilities(self)

source code 

Returns a list of capability information for the device.

Returns: List
Capability information for the opened device.

__set_rz_capabilities(self)

source code 

Sets the capability information for RZUSB devices. This should not be called outside of the class.

Returns: None
None

__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

__usb_read(self, endpoint, timeout=100)

source code 

Reads data from the USB device on the specified endpoint.

Parameters:
  • endpoint (Integer) - The USB endpoint to read from
  • timeout (Integer) - Timeout in usec for read operation before return
Returns: String
Data returned from USB device

_set_mode(self, mode)

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

close(self)

source code 

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

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 strings identifying device.

dev_list(self)

source code 

Return device information for all present devices.

Returns: List
List of device information present.