Skip to content

Commit

Permalink
doc: update README.md with new API
Browse files Browse the repository at this point in the history
  • Loading branch information
mchitre authored Oct 5, 2023
1 parent 1e5943b commit 527a518
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The usage of the package is best illustrated with a simple example:
using ProtocolDataUnits

# define PDU format
Base.@kwdef struct EthernetFrame <: PDU
Base.@kwdef struct EthernetFrame <: AbstractPDU
dstaddr::NTuple{6,UInt8} # fixed length
srcaddr::NTuple{6,UInt8} # fixed length
ethtype::UInt16 # fixed length
Expand All @@ -35,10 +35,10 @@ frame = EthernetFrame(
)

# convert to a byte array
bytes = Vector{UInt8}(frame)
bytes = PDU.encode(frame)

# convert back to Ethernet frame
decoded = EthernetFrame(bytes)
decoded = PDU.decode(bytes, EthernetFrame)

# check that they are the same
@assert frame == decoded
Expand Down

2 comments on commit 527a518

@mchitre
Copy link
Member Author

@mchitre mchitre commented on 527a518 Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/92833

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.0 -m "<description of version>" 527a518156525a2ea4d3444edf5cfd4e5cbe3bc4
git push origin v0.3.0

Please sign in to comment.