Morse Micro IoT SDK  2.9.7
Module tcp: TCP Socket IO, supports secure connections using TLS.

Detailed Description

Data Structures

struct  mmagic_core_tcp_connect_cmd_args
 Command arguments structure for tcp_connect. More...
 
struct  mmagic_core_tcp_connect_rsp_args
 Response arguments structure for tcp_connect. More...
 
struct  mmagic_core_tcp_bind_cmd_args
 Command arguments structure for tcp_bind. More...
 
struct  mmagic_core_tcp_bind_rsp_args
 Response arguments structure for tcp_bind. More...
 
struct  mmagic_core_tcp_recv_cmd_args
 Command arguments structure for tcp_recv. More...
 
struct  mmagic_core_tcp_recv_rsp_args
 Response arguments structure for tcp_recv. More...
 
struct  mmagic_core_tcp_send_cmd_args
 Command arguments structure for tcp_send. More...
 
struct  mmagic_core_tcp_read_poll_cmd_args
 Command arguments structure for tcp_read_poll. More...
 
struct  mmagic_core_tcp_write_poll_cmd_args
 Command arguments structure for tcp_write_poll. More...
 
struct  mmagic_core_tcp_accept_cmd_args
 Command arguments structure for tcp_accept. More...
 
struct  mmagic_core_tcp_accept_rsp_args
 Response arguments structure for tcp_accept. More...
 
struct  mmagic_core_tcp_close_cmd_args
 Command arguments structure for tcp_close. More...
 

Functions

static enum mmagic_status mmagic_controller_tcp_connect (struct mmagic_controller *controller, struct mmagic_core_tcp_connect_cmd_args *cmd_args, struct mmagic_core_tcp_connect_rsp_args *rsp_args)
 Opens a client TCP socket and returns its stream ID. More...
 
static enum mmagic_status mmagic_controller_tcp_bind (struct mmagic_controller *controller, struct mmagic_core_tcp_bind_cmd_args *cmd_args, struct mmagic_core_tcp_bind_rsp_args *rsp_args)
 Opens a server TCP socket and returns its stream ID. More...
 
static enum mmagic_status mmagic_controller_tcp_recv (struct mmagic_controller *controller, struct mmagic_core_tcp_recv_cmd_args *cmd_args, struct mmagic_core_tcp_recv_rsp_args *rsp_args)
 Reads from a socket. More...
 
static enum mmagic_status mmagic_controller_tcp_send (struct mmagic_controller *controller, struct mmagic_core_tcp_send_cmd_args *cmd_args)
 Writes to a socket. More...
 
static enum mmagic_status mmagic_controller_tcp_read_poll (struct mmagic_controller *controller, struct mmagic_core_tcp_read_poll_cmd_args *cmd_args)
 Polls the socket till it is ready for reading. More...
 
static enum mmagic_status mmagic_controller_tcp_write_poll (struct mmagic_controller *controller, struct mmagic_core_tcp_write_poll_cmd_args *cmd_args)
 Polls the socket till it is ready for writing. More...
 
static enum mmagic_status mmagic_controller_tcp_accept (struct mmagic_controller *controller, struct mmagic_core_tcp_accept_cmd_args *cmd_args, struct mmagic_core_tcp_accept_rsp_args *rsp_args)
 Waits for an incoming socket connection and returns a new stream ID. More...
 
static enum mmagic_status mmagic_controller_tcp_close (struct mmagic_controller *controller, struct mmagic_core_tcp_close_cmd_args *cmd_args)
 Closes and frees the socket. More...
 

Function Documentation

◆ mmagic_controller_tcp_accept()

static enum mmagic_status mmagic_controller_tcp_accept ( struct mmagic_controller *  controller,
struct mmagic_core_tcp_accept_cmd_args cmd_args,
struct mmagic_core_tcp_accept_rsp_args rsp_args 
)
inlinestatic

Waits for an incoming socket connection and returns a new stream ID.

Parameters
controllerReference to the controller handle.
[in]cmd_argsCommand arguments
[out]rsp_argsPointer to the data structure to be filled out with the result. If the If the return code is not MMAGIC_STATUS_OK then the contents of this structure will be undefined.
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 5054 of file mmagic_controller.h.

◆ mmagic_controller_tcp_bind()

static enum mmagic_status mmagic_controller_tcp_bind ( struct mmagic_controller *  controller,
struct mmagic_core_tcp_bind_cmd_args cmd_args,
struct mmagic_core_tcp_bind_rsp_args rsp_args 
)
inlinestatic

Opens a server TCP socket and returns its stream ID.

Parameters
controllerReference to the controller handle.
[in]cmd_argsCommand arguments
[out]rsp_argsPointer to the data structure to be filled out with the result. If the If the return code is not MMAGIC_STATUS_OK then the contents of this structure will be undefined.
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 4818 of file mmagic_controller.h.

◆ mmagic_controller_tcp_close()

static enum mmagic_status mmagic_controller_tcp_close ( struct mmagic_controller *  controller,
struct mmagic_core_tcp_close_cmd_args cmd_args 
)
inlinestatic

Closes and frees the socket.

Parameters
controllerReference to the controller handle.
[in]cmd_argsCommand arguments
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 5090 of file mmagic_controller.h.

◆ mmagic_controller_tcp_connect()

static enum mmagic_status mmagic_controller_tcp_connect ( struct mmagic_controller *  controller,
struct mmagic_core_tcp_connect_cmd_args cmd_args,
struct mmagic_core_tcp_connect_rsp_args rsp_args 
)
inlinestatic

Opens a client TCP socket and returns its stream ID.

Parameters
controllerReference to the controller handle.
[in]cmd_argsCommand arguments
[out]rsp_argsPointer to the data structure to be filled out with the result. If the If the return code is not MMAGIC_STATUS_OK then the contents of this structure will be undefined.
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 4770 of file mmagic_controller.h.

◆ mmagic_controller_tcp_read_poll()

static enum mmagic_status mmagic_controller_tcp_read_poll ( struct mmagic_controller *  controller,
struct mmagic_core_tcp_read_poll_cmd_args cmd_args 
)
inlinestatic

Polls the socket till it is ready for reading.

Parameters
controllerReference to the controller handle.
[in]cmd_argsCommand arguments
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 4952 of file mmagic_controller.h.

◆ mmagic_controller_tcp_recv()

static enum mmagic_status mmagic_controller_tcp_recv ( struct mmagic_controller *  controller,
struct mmagic_core_tcp_recv_cmd_args cmd_args,
struct mmagic_core_tcp_recv_rsp_args rsp_args 
)
inlinestatic

Reads from a socket.

Parameters
controllerReference to the controller handle.
[in]cmd_argsCommand arguments
[out]rsp_argsPointer to the data structure to be filled out with the result. If the If the return code is not MMAGIC_STATUS_OK then the contents of this structure will be undefined.
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 4868 of file mmagic_controller.h.

◆ mmagic_controller_tcp_send()

static enum mmagic_status mmagic_controller_tcp_send ( struct mmagic_controller *  controller,
struct mmagic_core_tcp_send_cmd_args cmd_args 
)
inlinestatic

Writes to a socket.

Parameters
controllerReference to the controller handle.
[in]cmd_argsCommand arguments
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 4916 of file mmagic_controller.h.

◆ mmagic_controller_tcp_write_poll()

static enum mmagic_status mmagic_controller_tcp_write_poll ( struct mmagic_controller *  controller,
struct mmagic_core_tcp_write_poll_cmd_args cmd_args 
)
inlinestatic

Polls the socket till it is ready for writing.

Parameters
controllerReference to the controller handle.
[in]cmd_argsCommand arguments
Returns
MMAGIC_STATUS_OK else an appropriate error code.

Definition at line 4999 of file mmagic_controller.h.