-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add examples for coap client, update readme
Signed-off-by: 1998-felix <[email protected]>
- Loading branch information
1 parent
4efdea9
commit fcc030d
Showing
4 changed files
with
86 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
protocol=coaps | ||
host=localhost | ||
port=5684 | ||
path="test" | ||
content=0x32 | ||
message="{\"message\": \"Hello mProxy\"}" | ||
auth="TOKEN" | ||
cafile=ssl/certs/ca.crt | ||
certfile=ssl/certs/client.crt | ||
keyfile=ssl/certs/client.key | ||
|
||
echo "Posting message to ${protocol}://${host}:${port}/${path} with dtls ..." | ||
coap-client -m post coap://${host}:${port}/${path} -e "${message}" -O 12,${content} -O 15,auth=${auth} \ | ||
-c $certfile -k $keyfile -C $cafile | ||
|
||
echo "Getting message from ${protocol}://${host}:${port}/${path} with dtls ..." | ||
coap-client -m get coap://${host}:${port}/${path} -O 6,0x00 -O 15,auth=${auth} -c $certfile -k $keyfile -C $cafile | ||
|
||
echo "Posting message to ${protocol}://${host}:${port}/${path} with dtls and invalid client certificate..." | ||
coap-client -m post coap://${host}:${port}/${path} -e "${message}" -O 12,${content} -O 15,auth=${auth} \ | ||
-c ssl/certs/client_unknown.crt -k ssl/certs/client_unknown.key -C $cafile | ||
|
||
echo "Getting message from ${protocol}://${host}:${port}/${path} with dtls and invalid client certificate..." | ||
coap-client -m get coap://${host}:${port}/${path} -O 6,0x00 -O 15,auth=${auth} -c ssl/certs/client_unknown.crt -k ssl/certs/client_unknown.key -C $cafile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
protocol=coap | ||
host=localhost | ||
port=5682 | ||
path="test" | ||
content=0x32 | ||
message="{\"message\": \"Hello mProxy\"}" | ||
auth="TOKEN" | ||
|
||
echo "Posting message to ${protocol}://${host}:${port}/${path} without tls ..." | ||
coap-client -m post coap://${host}:${port}/${path} -e "${message}" -O 12,${content} -O 15,auth=${auth} | ||
|
||
echo "Getting message from ${protocol}://${host}:${port}/${path} without tls ..." | ||
coap-client -m get coap://${host}:${port}/${path} -O 6,0x00 -O 15,auth=${auth} - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters