On Mac, to verify that the modem is available, run ls /dev/tty.usb*
You should see a usb modem entry similar to the below:
/dev/tty.usbmodemD9E8C0FB84611
On Windows, you should find the COM port in Device Manager, under Ports (COM & LPT).
Use this in place of /dev/tty.usbmodemXXXX below.
$ blecon-cli
blecon 0.2.2
The Blecon CLI
USAGE:
blecon-cli [OPTIONS] --port <PORT> <SUBCOMMAND>
OPTIONS:
-d, --debug Show requests and responses exchanged with the modem
-h, --help Print help information
-p, --port <PORT> Set the serial port to use
-V, --version Print version information
SUBCOMMANDS:
command Raw Command
get-device-url Get device URL
get-identity Get device identity
get-info Get Info
help Print this message or the help of the given subcommand(s)
identify Identify device
ping Ping modem
read-status Reads modem status
request Request
set-application-data Set Application Data
wait Wait for event
Structure
All commands require the --port (or -p) parameter to be set to the serial port the modem is connected to.
To get help about any sub-command, prefix the sub-command with help. For instance:
$ blecon-cli help requestblecon-cli-requestRequestUSAGE:blecon-cli --port <PORT> request [OPTIONS] <REQUEST_PAYLOAD>ARGS:<REQUEST_PAYLOAD> The payload to send in hex formOPTIONS:-h, --help Print help information-t, --text Parse payload and response as text
High-level sub-commands
The Blecon CLI supports a range of high-level commands. The modem's output is parsed to human-readable format.
For instance, you can get the device's ID with the get-identity subcommand: