Skip to content

Commit

Permalink
coap: fauxhoc dependencies are available
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed May 15, 2024
1 parent bc9b6a6 commit c7e7329
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions examples/coap/fauxhoc.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Runtime requirements:
# * aiocoap
# * lakers as in https://github.com/openwsn-berkeley/lakers/pull/264
# * coap-console from https://gitlab.com/chrysn/scroll-ring's coap-scroll-ring-server/tools/ copied into coapconsole_tools.py
# (making all these automatically installable is WIP)
#!/usr/bin/env -S pipx run
# /// script
# requires-python = ">= 3.10"
# dependencies = [
# "lakers-python == 0.3.0",
# "aiocoap[oscore] == 0.4.8",
# "cbor2",
# "coap_console == 0.0.1",
# ]
# ///
"""
fake-it-until-you-make-it wrapper for sending an EDHOC+OSCORE request
Expand All @@ -27,7 +32,7 @@

import lakers

import coapconsole_tools
import coap_console

# Someone told us that these are the credentials of devices that are our legitimate peers
eligible_responders_ccs = {
Expand Down Expand Up @@ -149,7 +154,7 @@ async def main():
print((await ctx.request(normalrequest).response_raising).payload.decode('utf8'))

print("Reading stdiout through OSCORE:")
await coapconsole_tools.read_stream_to_console(ctx, "coap://10.42.0.61/stdout")
await coap_console.read_stream_to_console(ctx, "coap://10.42.0.61/stdout")

await ctx.shutdown()

Expand Down

0 comments on commit c7e7329

Please sign in to comment.