UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
anonymous_namespace{soap_ctrlpt.cpp} Namespace Reference

Functions

Functions scope restricted to file
int dom_cmp_name (const char *name, IXML_Node *node)
 Compares 'name' and node's name.
 
int dom_find_node (const char *node_name, IXML_Node *start_node, IXML_Node **matching_node)
 Goes thru each child of 'start_node' looking for a node having the name 'node_name'.
 
int dom_find_deep_node (const char *names[], int num_names, IXML_Node *start_node, IXML_Node **matching_node)
 Searches for the node specifed by the last name in the 'name' array.
 
const DOMString get_node_value (IXML_Node *node)
 This function returns the value of the text node.
 
int get_host_and_path (char *ctrl_url, const memptr *host, const memptr *path, uri_type *url)
 This function retrives the host and path from the control URL.
 
int get_action_name (char *action, memptr *name)
 This function retrives the action name in the buffer.
 
int add_man_header (membuffer *headers)
 Adds "MAN" field in the HTTP header.
 
int soap_request_and_response (membuffer *request, uri_type *destination_url, http_parser_t *response)
 This function sends the control point's request to the device and receives a response from it.
 
int get_response_value (http_message_t *hmsg, int code, char *name, int *upnp_error_code, IXML_Node **action_value, DOMString *str_value)
 This function handles the response coming back from the device.
 

Variables

Variable scope restricted to file
constexpr int SOAP_ACTION_RESP {1}
 Control point SOAP status.
 
constexpr int SOAP_VAR_RESP {2}
 Control point SOAP status.
 
constexpr int SOAP_ACTION_RESP_ERROR {3}
 Control point SOAP status.
 
constexpr int SOAP_VAR_RESP_ERROR {4}
 Control point SOAP status.
 

Function Documentation

◆ dom_cmp_name()

int anonymous_namespace{soap_ctrlpt.cpp}::dom_cmp_name ( const char *  name,
IXML_Node node 
)

Compares 'name' and node's name.

Returns
On success: 0 if both are equal; 1 if not equal
On error: UPNP_E_OUTOF_MEMORY

Definition at line 88 of file soap_ctrlpt.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dom_find_node()

int anonymous_namespace{soap_ctrlpt.cpp}::dom_find_node ( const char *  node_name,
IXML_Node start_node,
IXML_Node **  matching_node 
)

Goes thru each child of 'start_node' looking for a node having the name 'node_name'.

Returns
On success: UPNP_E_SUCCESS
On error: UPNP_E_NOT_FOUND

Definition at line 125 of file soap_ctrlpt.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dom_find_deep_node()

int anonymous_namespace{soap_ctrlpt.cpp}::dom_find_deep_node ( const char *  names[],
int  num_names,
IXML_Node start_node,
IXML_Node **  matching_node 
)

Searches for the node specifed by the last name in the 'name' array.

Returns
On success: UPNP_E_SUCCESS
On error: UPNP_E_NOT_FOUND

Definition at line 158 of file soap_ctrlpt.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_node_value()

const DOMString anonymous_namespace{soap_ctrlpt.cpp}::get_node_value ( IXML_Node node)

This function returns the value of the text node.

Note
The given node must have a text node as its first child.
Returns
DOMString - string containing the node value.
Parameters
[in]nodeinput node

Definition at line 201 of file soap_ctrlpt.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_host_and_path()

int anonymous_namespace{soap_ctrlpt.cpp}::get_host_and_path ( char *  ctrl_url,
const memptr host,
const memptr path,
uri_type url 
)
inline

This function retrives the host and path from the control URL.

Returns
On success: 0
On error: -1
Parameters
[in]ctrl_urlURL
[out]hosthost string
[out]pathpath string
[out]urlURL type

Definition at line 223 of file soap_ctrlpt.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_action_name()

int anonymous_namespace{soap_ctrlpt.cpp}::get_action_name ( char *  action,
memptr name 
)
inline

This function retrives the action name in the buffer.

Returns
On success: 0
On error: -1
Parameters
[in]actionString containing action name.
[out]nameName of the action.

Definition at line 249 of file soap_ctrlpt.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_man_header()

int anonymous_namespace{soap_ctrlpt.cpp}::add_man_header ( membuffer headers)
inline

Adds "MAN" field in the HTTP header.

Returns
On success: 0
On error: UPNP_E_OUTOF_MEMORY

Definition at line 268 of file soap_ctrlpt.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ soap_request_and_response()

int anonymous_namespace{soap_ctrlpt.cpp}::soap_request_and_response ( membuffer request,
uri_type destination_url,
http_parser_t response 
)

This function sends the control point's request to the device and receives a response from it.

Returns
On success: 0
On error:
  • UPNP_E_SOCKET_ERROR
  • UPNP_E_SOCKET_CONNECT
  • UPNP_E_OUTOF_MEMORY
  • UPNP_E_FILE_READ_ERROR
  • UPNP_E_TIMEDOUT
  • UPNP_E_SOCKET_WRITE
  • UPNP_E_BAD_HTTPMSG
Parameters
[in]requestRequest that will be sent to the device.
[in]destination_urlDestination address string.
[out]responseResponse from the device.

Definition at line 305 of file soap_ctrlpt.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_response_value()

int anonymous_namespace{soap_ctrlpt.cpp}::get_response_value ( http_message_t hmsg,
int  code,
char *  name,
int *  upnp_error_code,
IXML_Node **  action_value,
DOMString str_value 
)

This function handles the response coming back from the device.

This function parses the response and gives back the SOAP response node.

Returns
On success: The type of the SOAP message.
On error:
  • UPNP_E_BAD_RESPONSE
  • UPNP_E_OUTOF_MEMORY
  • SOAP_ACTION_RESP
  • SOAP_VAR_RESP
  • SOAP_VAR_RESP_ERROR
  • SOAP_ACTION_RESP_ERROR
  • HTTP error codes >400
Parameters
[in]hmsgHTTP response message.
[in]codeReturn code in the HTTP response.
[in]nameName of the action.
[out]upnp_error_codeUPnP error code.
[out]action_valueSOAP response node.
[out]str_valueState varible value (in the case of querry state variable request).

Definition at line 356 of file soap_ctrlpt.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ SOAP_ACTION_RESP

constexpr int anonymous_namespace{soap_ctrlpt.cpp}::SOAP_ACTION_RESP {1}
constexpr

Control point SOAP status.

Definition at line 69 of file soap_ctrlpt.cpp.

◆ SOAP_VAR_RESP

constexpr int anonymous_namespace{soap_ctrlpt.cpp}::SOAP_VAR_RESP {2}
constexpr

Control point SOAP status.

Definition at line 70 of file soap_ctrlpt.cpp.

◆ SOAP_ACTION_RESP_ERROR

constexpr int anonymous_namespace{soap_ctrlpt.cpp}::SOAP_ACTION_RESP_ERROR {3}
constexpr

Control point SOAP status.

Definition at line 72 of file soap_ctrlpt.cpp.

◆ SOAP_VAR_RESP_ERROR

constexpr int anonymous_namespace{soap_ctrlpt.cpp}::SOAP_VAR_RESP_ERROR {4}
constexpr

Control point SOAP status.

Definition at line 73 of file soap_ctrlpt.cpp.