Synergy Software Package User's Manual
Telnet Communication Framework on sf_comms_telnet

RTOS-integrated Communications Framework NetX telnet server implementation. More...

Data Structures

struct  sf_comms_telnet_instance_ctrl_t
 
struct  sf_comms_telnet_cfg_t
 

Macros

#define SF_COMMS_TELNET_OPEN   (0x434D544EU)
 

Functions

ssp_err_t SF_COMMS_TELNET_Open (sf_comms_ctrl_t *const p_api_ctrl, sf_comms_cfg_t const *const p_cfg)
 Initializes the Telnet server and other operating system resources. More...
 
ssp_err_t SF_COMMS_TELNET_Close (sf_comms_ctrl_t *const p_api_ctrl)
 Disconnect Telnet server and clean up resources. More...
 
ssp_err_t SF_COMMS_TELNET_Read (sf_comms_ctrl_t *const p_api_ctrl, uint8_t *const p_dest, uint32_t const bytes, UINT const timeout)
 Read data from the Telnet comms connection. More...
 
ssp_err_t SF_COMMS_TELNET_Write (sf_comms_ctrl_t *const p_api_ctrl, uint8_t const *const p_src, uint32_t const bytes, UINT const timeout)
 Write data to the Telnet comms connection. More...
 
ssp_err_t SF_COMMS_TELNET_Lock (sf_comms_ctrl_t *const p_api_ctrl, sf_comms_lock_t lock_type, UINT timeout)
 Acquire lock type for the Telnet comms instance. More...
 
ssp_err_t SF_COMMS_TELNET_Unlock (sf_comms_ctrl_t *const p_api_ctrl, sf_comms_lock_t lock_type)
 Release lock type for the Telnet comms instance. More...
 
ssp_err_t SF_COMMS_TELNET_VersionGet (ssp_version_t *const p_version)
 Get driver version. More...
 

Detailed Description

RTOS-integrated Communications Framework NetX telnet server implementation.

Macro Definition Documentation

◆ SF_COMMS_TELNET_OPEN

#define SF_COMMS_TELNET_OPEN   (0x434D544EU)

"CMTN" in ASCII, used to identify general timer handle

Function Documentation

◆ SF_COMMS_TELNET_Close()

ssp_err_t SF_COMMS_TELNET_Close ( sf_comms_ctrl_t *const  p_api_ctrl)

Disconnect Telnet server and clean up resources.

Return values
SSP_SUCCESSConnection successfully closed
SSP_ERR_ASSERTIONParameter check failed for one of the following:
  • Pointer p_api_ctrl is NULL
  • p_ctrl->p_telnet_server is NULL
  • Telnet server field nx_telnet_server_id indicate this instance is not created already thus invlaid instance of Telnet server.
SSP_ERR_NOT_OPENConnection is not open
Note
- For Telnet server specific API details, refer Telnet server user manual.
- For NetX specific API details, refer NetX user manual.
- For ThreadX specific API details, refer ThreadX user manual.
- This function is reentrant.

Check if connection is open

Update connection record.

Return connection not open if no record found

Stop and release Telnet server and ThreadX resources for this connection

Mark this connection uninitialized.

◆ SF_COMMS_TELNET_Lock()

ssp_err_t SF_COMMS_TELNET_Lock ( sf_comms_ctrl_t *const  p_api_ctrl,
sf_comms_lock_t  lock_type,
UINT  timeout 
)

Acquire lock type for the Telnet comms instance.

Return values
SSP_SUCCESSAcquired requested lock on given connection.
SSP_ERR_ASSERTIONPointer p_api_ctrl is NULL.
SSP_ERR_NOT_OPENConnection is not open.
SSP_ERR_TIMEOUTAcquiring requested lock timed-out.
Note
- For Telnet server specific API details, refer Telnet server user manual.
- For NetX specific API details, refer NetX user manual.
- For ThreadX specific API details, refer ThreadX user manual.

Check if connection is open

Get both lock if requested

Else get the lock type requested

◆ SF_COMMS_TELNET_Open()

ssp_err_t SF_COMMS_TELNET_Open ( sf_comms_ctrl_t *const  p_api_ctrl,
sf_comms_cfg_t const *const  p_cfg 
)

Initializes the Telnet server and other operating system resources.

Return values
SSP_SUCCESScomms Telnet instance opened successfully.
SSP_ERR_IN_USEcomms Telnet maximum connection limit reached.
SSP_ERR_ALREADY_OPENcomms Telnet instance already open.
SSP_ERR_ASSERTIONParameter check failed for one of the following:
  • Pointer p_api_ctrl is NULL.
  • Pointer p_cfg is NULL
  • Pointer p_cfg->p_extend is NULL
  • Pointer p_cfg_extend->p_telnet_server is NULL
  • Pointer p_cfg_extend->p_ip is NULL
  • Pointer p_cfg_extend->p_stack is NULL
  • Pointer p_cfg_extend->stack_size is invalid i.e. zero
SSP_ERR_INTERNALAn internal ThreadX Or NetX error has occurred. This is typically a failure to create/use thread mutex or failure create/enable an internal thread/feature for NetX service.
Note
- Do not modify sf_comms_ctrl_t structure returned by this API as it is for module's internal purpose.
- For Telnet server specific API details, refer Telnet server user manual.
- For NetX specific API details, refer NetX user manual.
- For ThreadX specific API details, refer ThreadX user manual.
- This function is reentrant.

Initialize and start Telnet server and ThreadX resources for this connection

Mark this connection initialized.

◆ SF_COMMS_TELNET_Read()

ssp_err_t SF_COMMS_TELNET_Read ( sf_comms_ctrl_t *const  p_api_ctrl,
uint8_t *const  p_dest,
uint32_t const  bytes,
UINT const  timeout 
)

Read data from the Telnet comms connection.

Return values
SSP_SUCCESSData reception ends successfully.
SSP_ERR_ASSERTIONOne of the following invalid parameter passed.
  • Pointer p_api_ctrl is NULL
  • Pointer p_dest is NULL
  • Invalid read length i.e. bytes value is zero
SSP_ERR_NOT_OPENConnection is not open
SSP_ERR_TIMEOUTOne of the following operation timed out.
  • 'Event flags get' timed out
  • 'Receive mutex get' timed out
  • 'Queue receive' timed out
SSP_ERR_INTERNALAn internal ThreadX Or NetX error has occurred. This is typically a failure to create/use thread mutex or failure create/enable an internal thread/feature for NetX service.
Note
- For Telnet server specific API details, refer Telnet server user manual.
- For NetX specific API details, refer NetX user manual.
- For ThreadX specific API details, refer ThreadX user manual.
- This API is reentrant.

Check if connection is open

Check and wait for client to be connected with timeout.

Get read lock.

Get data from read queue.

Release read lock.

◆ SF_COMMS_TELNET_Unlock()

ssp_err_t SF_COMMS_TELNET_Unlock ( sf_comms_ctrl_t *const  p_api_ctrl,
sf_comms_lock_t  lock_type 
)

Release lock type for the Telnet comms instance.

Return values
SSP_SUCCESSReleased requested lock on given connection..
SSP_ERR_ASSERTIONPointer p_api_ctrl is NULL.
SSP_ERR_NOT_OPENConnection is not open.
Note
- For Telnet server specific API details, refer Telnet server user manual.
- For NetX specific API details, refer NetX user manual.
- For ThreadX specific API details, refer ThreadX user manual.

Check if connection is open

Release Lock(s) on this connection.

◆ SF_COMMS_TELNET_VersionGet()

ssp_err_t SF_COMMS_TELNET_VersionGet ( ssp_version_t *const  p_version)

Get driver version.

Return values
SSP_SUCCESSOperation successful
SSP_ERR_ASSERTIONp_version pointer is NULL
Note
- This function is reentrant.

◆ SF_COMMS_TELNET_Write()

ssp_err_t SF_COMMS_TELNET_Write ( sf_comms_ctrl_t *const  p_api_ctrl,
uint8_t const *const  p_src,
uint32_t const  bytes,
UINT const  timeout 
)

Write data to the Telnet comms connection.

Return values
SSP_SUCCESSData transmission finished successfully.
SSP_ERR_ASSERTIONOne of the following invalid parameter passed.
  • Pointer p_api_ctrl is NULL.
  • Pointer p_src is NULL.
  • Invalid write length i.e. bytes value is zero.
SSP_ERR_NOT_OPENConnection is not open
SSP_ERR_TIMEOUTOne of the following operation timed out.
  • 'Event flags get' timed out
  • 'Transmit mutex get' timed out
SSP_ERR_OUT_OF_MEMORYCouldn't allocate pool memory for Telnet server
SSP_ERR_INTERNALAn internal ThreadX Or NetX error has occurred. This is typically a failure to create/use thread mutex or failure create/enable an internal thread/feature for NetX service.
Note
- For Telnet server specific API details, refer Telnet server user manual.
- For NetX specific API details, refer NetX user manual.
- For ThreadX specific API details, refer ThreadX user manual.
- This function is reentrant.

Check if connection is open

Check and wait for client to be connected with timeout.

Get write lock.

Send data to the connected client.

Release write lock.