Thanks to visit codestin.com
Credit goes to github.com

Skip to content

doxxx/coap-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

coap-cli

This is a simple command-line tool to send CoAP requests via UDP and display the responses.

Usage

Usage: coap-cli.exe [OPTIONS] <URL> <COMMAND>

Commands:
  get     Retrieves a representation of a resource
  observe Registers to receive a representation of a resource whenever the resource changes
  post    Requests that the submitted data be processed
  put     Requests that the resource be updated or created with the submitted data
  delete  Requests that the resource be deleted
  help    Print this message or the help of the given subcommand(s)

Arguments:
  <URL>  COAP resource URL

Options:
      --timeout <TIMEOUT>  Receive timeout in seconds [default: 1]
  -h, --help               Print help

Get

Usage: coap-cli.exe <URL> get [OPTIONS]

Options:
      --accept <ACCEPT>    Acceptable content formats (comma-separated) for the response
      --timeout <TIMEOUT>  Receive timeout in seconds [default: 1]
  -h, --help               Print help

Observe

Usage: coap-cli.exe <URL> observe [OPTIONS]

Options:
      --accept <ACCEPT>    Acceptable content formats (comma-separated) for the responses
      --timeout <TIMEOUT>  Receive timeout in seconds [default: 1]
  -h, --help               Print help

Post

Usage: coap-cli.exe <URL> post [OPTIONS]

Options:
      --accept <ACCEPT>
          Acceptable content formats (comma-separated) for the response
      --timeout <TIMEOUT>
          Receive timeout in seconds [default: 1]
      --content-format <CONTENT_FORMAT>
          Content format of the submitted data
  -d, --data <DATA>
          Resource data
  -f, --file <FILE>
          Path to file containing resource data
  -h, --help
          Print help

Put

Usage: coap-cli.exe <URL> put [OPTIONS]

Options:
      --accept <ACCEPT>
          Acceptable content formats (comma-separated) for the response
      --timeout <TIMEOUT>
          Receive timeout in seconds [default: 1]
      --content-format <CONTENT_FORMAT>
          Content format of the submitted data
  -d, --data <DATA>
          Resource data
  -f, --file <FILE>
          Path to file containing resource data
  -h, --help
          Print help

Delete

Usage: coap-cli.exe <URL> delete [OPTIONS]

Options:
      --accept <ACCEPT>    Acceptable content formats (comma-separated) for the response
      --timeout <TIMEOUT>  Receive timeout in seconds [default: 1]
  -h, --help               Print help

Examples

$ coap-cli coap://10.1.2.3/version get
GET coap://10.1.2.3/version
2.05
{"version":"1.2.3.4"}
$ coap-cli coap://10.1.2.3/some/resource post -f path/to/data
POST coap://10.1.2.3/some/resource
2.04
$ coap-cli coap://10.1.2.3/some/resource put -d '{"name":"stuff"}'
PUT coap://10.1.2.3/some/resource
2.04

About

A simple command-line tool to send CoAP request via UDP and display the responses.

Topics

Resources

License

Stars

Watchers

Forks

Languages