yumapro  23.10T-6
YumaPro SDK
Loading...
Searching...
No Matches
Message Utilities

YControl message utilities are used internally to construct messages to the main server and receive messages from the main server. More...

Collaboration diagram for Message Utilities:

Functions

const xmlChar * ycontrol_msg_cmn_get_msgtype (ycontrol_msgtype_t msgtype)
 Get the string for the message type enumeration. More...
 
ycontrol_msgtype_t ycontrol_msg_cmn_get_msgtype_enum (val_value_t *msgval, status_t *res)
 Get the message type enumeration from the message. More...
 
status_t ycontrol_msg_cmn_new (const xmlChar *server_id, const xmlChar *subsys_id, obj_template_t *msgobj, uint32 msgid, ycontrol_msgtype_t msgtype, const xmlChar *service_id, val_value_t **ret_msgval)
 Create a new YControl message. More...
 
status_t ycontrol_msg_cmn_reuse (val_value_t *msgval, uint32 msgid, ycontrol_msgtype_t msgtype, const xmlChar *server_id, const xmlChar *subsys_id, const xmlChar *service_id)
 Reuse a message value struct and replace only changing fields. More...
 
status_t ycontrol_msg_cmn_new_payload (obj_template_t *msgobj, val_value_t **ret_payload)
 Create a new payload value for the message object. More...
 
status_t ycontrol_msg_cmn_new_error (obj_template_t *msgobj, status_t res, const xmlChar *errstr, val_value_t **ret_error)
 Create a new YControl error response message. More...
 
status_t ycontrol_msg_cmn_reuse_error (val_value_t *error_val, status_t res, const xmlChar *errstr)
 Reuse an error message value struct and replace only changing fields. More...
 
status_t ycontrol_msg_cmn_new_ok (obj_template_t *msgobj, val_value_t **ret_ok)
 Create a new YControl OK response message. More...
 

Detailed Description

YControl message utilities are used internally to construct messages to the main server and receive messages from the main server.

These APIs help manage the message caches used to make message processing faster.

All functions in this module are system APIs for subsystem use only!

Function Documentation

◆ ycontrol_msg_cmn_get_msgtype()

const xmlChar * ycontrol_msg_cmn_get_msgtype ( ycontrol_msgtype_t  msgtype)

Get the string for the message type enumeration.

Parameters
msgtypeenumeration to convert
Returns
string version of the enum
Here is the caller graph for this function:

◆ ycontrol_msg_cmn_get_msgtype_enum()

ycontrol_msgtype_t ycontrol_msg_cmn_get_msgtype_enum ( val_value_t msgval,
status_t res 
)

Get the message type enumeration from the message.

Parameters
msgvalparseed message to check
[out]resaddress of return status
  • *res return status
Returns
message type enum
Here is the call graph for this function:

◆ ycontrol_msg_cmn_new()

status_t ycontrol_msg_cmn_new ( const xmlChar *  server_id,
const xmlChar *  subsys_id,
obj_template_t msgobj,
uint32  msgid,
ycontrol_msgtype_t  msgtype,
const xmlChar *  service_id,
val_value_t **  ret_msgval 
)

Create a new YControl message.

Parameters
server_idserver that the message will be sent to
subsys_idthe ID of this subsystem to use in the message
msgobjobject template for message to send
msgidmessage ID to use
msgtypemessage type to send
service_idservice name sending the message
[out]ret_msgvaladdress of created messagen
  • *ret_msgval malloced message, must free with val_free_value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ycontrol_msg_cmn_new_error()

status_t ycontrol_msg_cmn_new_error ( obj_template_t msgobj,
status_t  res,
const xmlChar *  errstr,
val_value_t **  ret_error 
)

Create a new YControl error response message.

Parameters
msgobjobject template for the service layer object
reserror code for operation failure
errstrerror string for operation failure
[out]ret_erroraddress of return message
  • *ret_error malloced return message.
  • Must free with val_free_value.
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ycontrol_msg_cmn_new_ok()

status_t ycontrol_msg_cmn_new_ok ( obj_template_t msgobj,
val_value_t **  ret_ok 
)

Create a new YControl OK response message.

Parameters
msgobjobject template for the service layer object
[out]ret_okaddress of return OK message
  • *ret_ok malloced return message.
  • Must free with val_free_value.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ycontrol_msg_cmn_new_payload()

status_t ycontrol_msg_cmn_new_payload ( obj_template_t msgobj,
val_value_t **  ret_payload 
)

Create a new payload value for the message object.

Parameters
msgobjobject template for message to create payload for. The payload object will be found as a child node.
[out]ret_payloadaddress of return payload
  • *ret_payload malloced return payload;
  • Must free with val_free_value.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ycontrol_msg_cmn_reuse()

status_t ycontrol_msg_cmn_reuse ( val_value_t msgval,
uint32  msgid,
ycontrol_msgtype_t  msgtype,
const xmlChar *  server_id,
const xmlChar *  subsys_id,
const xmlChar *  service_id 
)

Reuse a message value struct and replace only changing fields.

Parameters
msgvalvalue tree containing message to reuse
msgidmessage ID to use
msgtypemessage type to send
server_idserver that the message will be sent to
subsys_idthe ID of this subsystem to use in the message
service_idservice name sending the message
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ycontrol_msg_cmn_reuse_error()

status_t ycontrol_msg_cmn_reuse_error ( val_value_t error_val,
status_t  res,
const xmlChar *  errstr 
)

Reuse an error message value struct and replace only changing fields.

Parameters
error_valvalue tree containing error message to reuse
resnew error status for operation failure to set
errstrnew error string for operation failure
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function: