DTLS AT Commands
Set or Get the DTLS Layer Parameters
The expected format of the PSK and its ID should be HEX ASCII. For security reasons, it is recommend that:
- The ID is 4 bytes long (8 characters in ASCII).
- The Key is at least 16 bytes long (32 characters in ASCII).
Possible hexadecimal numbers are 0 to 9, a to f or A to F.
For example:
- ID :
DEADBEEF
- Key :
11223344556677881122334455667788
.
What | Set | Get |
---|---|---|
Command | AT#CONFDTLS=<key_id, key, [nbr_try, handshake_timeout]> | AT#CONFDTLS? |
Parameter | <key_id> - See format expectations above | — |
Parameter | <key> - See format expectations above | — |
Parameter | <nbr_try> - Optional | — |
Parameter | <handshake_timeout> - Optional | — |
Result codes | OK | #CONFDTLS: <psk_id>,<psk>,<nbr_try>,<handshake_timeout> |
ERROR | — |
Perform a DTLS Handshake
What | Detail |
---|---|
Command | AT#HANDSHAKE |
Result codes | OK |
ERROR |
Transmissions
The OK
result code or an error is returned immediately. If OK
was returned, a transmission is attempted.
#HANDSHAKE
, the associated socket ID, a status and an error are returned at the end of the transmission.
The status that can be returned after a transmission failure are:
Numeric value | Error code | Comment |
---|---|---|
1 | DTGS_ERROR | Internal error |
10 | DTGS_L2_ERR | Error from L2 layer |
11 | DTGS_SEND_ABORT_ERR | Session aborted by the sender |
12 | DTGS_RECV_ABORT_ERR | Session aborted by the receiver |
25 | DTGS_HANDSHAKE_ERR | DTLS handshake failed |