Skip to content

Commit

Permalink
Ensure consistency in use of _raw variable
Browse files Browse the repository at this point in the history
  • Loading branch information
mikewadsten committed Jan 16, 2018
1 parent 09bfe55 commit e102693
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions digi/xbee/packets/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,16 @@ def create_packet(raw, operating_mode):
if operating_mode != OperatingMode.ESCAPED_API_MODE and operating_mode != OperatingMode.API_MODE:
raise InvalidOperatingModeException(operating_mode.name + " is not supported.")

raw = XBeeAPIPacket._unescape_data(raw) if operating_mode == OperatingMode.ESCAPED_API_MODE else raw
_raw = XBeeAPIPacket._unescape_data(raw) if operating_mode == OperatingMode.ESCAPED_API_MODE else raw

XBeeAPIPacket._check_api_packet(raw, min_length=RXIPv4Packet.__MIN_PACKET_LENGTH)
XBeeAPIPacket._check_api_packet(_raw, min_length=RXIPv4Packet.__MIN_PACKET_LENGTH)

if raw[3] != ApiFrameType.RX_IPV4.code:
if _raw[3] != ApiFrameType.RX_IPV4.code:
raise InvalidPacketException("This packet is not an RXIPv4Packet.")

return RXIPv4Packet(IPv4Address(bytes(raw[4:8])), utils.bytes_to_int(raw[8:10]),
utils.bytes_to_int(raw[10:12]), IPProtocol.get(raw[12]),
raw[14:-1])
return RXIPv4Packet(IPv4Address(bytes(_raw[4:8])), utils.bytes_to_int(_raw[8:10]),
utils.bytes_to_int(_raw[10:12]), IPProtocol.get(_raw[12]),
_raw[14:-1])

def needs_id(self):
"""
Expand Down

0 comments on commit e102693

Please sign in to comment.