Skip to content
This repository was archived by the owner on Apr 22, 2024. It is now read-only.

Commit ec0351a

Browse files
authored
Merge pull request #615 from renanrodrigo/small-readme-fix
Change unpack example in README
2 parents 0de4159 + 89d5bb3 commit ec0351a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,15 @@ its binary representation to be sent through the network:
8383
b"\x01\x05\x00\x08\x14\xad'\x8d"
8484
>>> # Use a controller (e.g. Kytos SDN controller) to send "binary_msg"
8585
86-
To parse a message, use ``unpack_message()``:
86+
To parse a message, use the ``unpack()`` function:
8787

8888
.. code:: python
8989
90-
>>> from pyof.v0x01.common.utils import unpack_message
90+
>>> from pyof.utils import unpack
9191
>>> binary_msg = b"\x01\x05\x00\x08\x14\xad'\x8d"
92-
>>> msg = unpack_message(binary_msg)
92+
>>> msg = unpack(binary_msg)
93+
>>> print(msg.header.version)
94+
UBInt8(1) # OpenFlow 1.0
9395
>>> print(msg.header.message_type)
9496
Type.OFPT_FEATURES_REQUEST
9597

0 commit comments

Comments
 (0)