-28-
v7.0
Software
3.11.6. Closing a socket
The
closeSocketClient()
function allows the user to close a TCP/UDP client previously open. The function needs
an input parameter for the socket identifier.
The
closeSocketServer()
function allows the user to close a TCP/UDP server previously open. The function needs
2 inputs:
•
Socket ID
: the socket identifier used for opening the connection.
•
Protocol
: This parameter indicates the protocol used by the socket:
WaspBG96::TCP
WaspBG96::UDP
3.11.7. SSL sockets
The NB-IoT / Cat-M module includes a stack for establishing SSL sockets. For this feature, the user must keep
in mind that it is necessary to install the proper security data in the module. For handling the SSL socket new
functions are defined for opening the socket, sending data, receiving data and closing the socket.
Currently, for SSL sockets only one single connection is permitted. So, regarding the socket identifiers the only
available option is:
WaspBG96::CONNECTION_1
.
The
manageSSL()
function allows the user to store, delete and read security data (Certificate, CA certificate, private
key) into the non volatile memory of the module. The function expects several inputs:
•
Socket ID
: the socket identifier used for opening the connection.
•
Action
: the action to perform:
-
WaspBG96::SSL_ACTION_DELETE
: Delete data from memory
-
WaspBG96::SSL_ACTION_STORE
: Store data into memory
-
WaspBG96::SSL_ACTION_READ
: Read data from memory
•
Data type
:
-
WaspBG96::SSL_TYPE_CERT
: Certificate
-
WaspBG96::SSL_TYPE_CA_CERT
: CA certificate
-
WaspBG96::SSL_TYPE_RSA
: RSA Private key
•
Data (optional)
: this input is needed when the user selects to store a new security data into module’s memory.
Possible error codes for this function:
1 if error setting security data
2 if error waiting module confirmation
3 if error getting security data
4 if error deleting security data
5 if invalid action input
The
openSocketSSL()
function allows the user to open a remote connection via socket secured through SSL.
Several inputs are needed for calling this function:
•
Socket ID
: The socket identifier used for opening the connection
•
Host
: Remote SSL server address
•
Remote port
: Remote TCP port to contact from 1 to 65535.
Содержание Cat-M
Страница 1: ...NB IoT Cat M Module Networking Guide ...