![]() |
RDK Documentation (Open Sourced RDK Components)
|
Describe the details about XUPnP XCal-Discovery specifications.
Functions | |
void | xupnp_logger (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) |
This function is used to log the messages of XUPnP applications. Each Log message will be written to a file along with the timestamp formated in ISO8601 format. More... | |
gboolean | checkDeviceExists (const char *sno, char *outPlayUrl) |
This will Scan through the device list to check whether a particular device entry exists. More... | |
gboolean | processBooleanRequest (const GUPnPServiceProxy *sproxy, const char *requestFn, const char *responseFn, gboolean *result, gboolean isInCriticalPath) |
This function is used to retrieve a boolean parameter from discovered data. Use this function only when there are no parameters passed to the action call. More... | |
gboolean | processStringRequest (const GUPnPServiceProxy *sproxy, const char *requestFn, const char *responseFn, gchar **result, gboolean isInCriticalPath) |
This function is used to retrieve a string parameter from discovered data. Use this function only when there are no parameters passed to the action call. More... | |
gboolean | processIntRequest (const GUPnPServiceProxy *sproxy, const char *requestFn, const char *responseFn, guint *result, gboolean isInCriticalPath) |
This function is used to retrieve a int parameter from discovered data. Use this function only when there are no parameters passed to the action call. More... | |
gboolean | process_gw_services (GUPnPServiceProxy *sproxy, GwyDeviceData *gwData) |
This function is used to get attributes of different Gateway services using GUPnP Service Proxy. More... | |
gboolean | replace_hn_with_local (GwyDeviceData *gwyData) |
Replace IP Address part of the Gateway URL attributes from home networking IP with the local host IP. It Replaces the URL attribute of playbackurl, baseurl, basetrmurl. More... | |
gboolean | init_gwydata (GwyDeviceData *gwydata) |
Initializes gateway attributes such as serial number, IP details , MAC details, URL details etc. More... | |
gboolean | free_gwydata (GwyDeviceData *gwydata) |
Uninitialize gateway data attributes by resetting them to default value. More... | |
static gboolean | update_gwylist (GwyDeviceData *gwydata) |
Check for any addition or deletion of gateway from the list. If any update occurs, this routine will validate and add/delete the entry to/from the gateway list and the updated list will be published to others. More... | |
gboolean | delete_gwyitem (const char *serial_num) |
Deletes a gateway entry from the list of Gateway devices if it matches with the serial number supplied as input. More... | |
gboolean | sendDiscoveryResult (const char *outfilename) |
This will store the updated device discovery results in local storage as JSON formatted data. More... | |
void * | verify_devices () |
Verify and update the gateway list according to the availability of the gateway devices connected to the network. New devices will be added to the list and dead devices will be deleted from the list. | |
void | delOldItemsFromList (gboolean bDeleteAll) |
Delete all the devices from the device list or delete devices marked as "Not Found" from device list. More... | |
gboolean | readconffile (const char *configfile) |
This will parse and load the configuration file in a key/value pair format as specified in GLib encoding. The configuration file contain attributes which are categorized into following: More... | |
gboolean | getserialnum (GString *ownSerialNo) |
Get the serial number of the device from Vendor specific UDHCPC config file. More... | |
char * | replace_string (char *src_string, char *sub_string, char *replace_string) |
Replace all occurrences of a sub-string in the given string to value the specified. More... | |
int | getipaddress (const char *ifname, char *ipAddressBuffer, gboolean ipv6Enabled) |
This function gets the IP address for the given interface. The IP Address will be formatted to IPv6 or IPv4 address depending upon the configuration. More... | |
gboolean | replace_local_device_ip (GwyDeviceData *gwydata) |
When the discovered device is the own device then MOcA IP is replaced. More... | |
gboolean | checkvalidip (char *ipAddress) |
This will check whether the input IP Address is a valid IPv4 or IPv6 address. More... | |
gboolean | checkvalidhostname (char *hostname) |
This function will check whether a Host name is valid by validating all the associated IP addresses. More... | |
void xupnp_logger | ( | const gchar * | log_domain, |
GLogLevelFlags | log_level, | ||
const gchar * | message, | ||
gpointer | user_data | ||
) |
This function is used to log the messages of XUPnP applications. Each Log message will be written to a file along with the timestamp formated in ISO8601 format.
[in] | log_domain | Defines the log domain. For applications, this is typically left as the default NULL domain. Libraries should define this so that any messages that they log can be differentiated from messages from other libraries/applications. |
[in] | log_level | Log level used to categorize messages of type warning, error, info, debug etc. |
[in] | message | The Message to be logged represented in string format. |
[in] | user_data | Contains the Log file name. |
Definition at line 859 of file xdiscovery.c.
gboolean checkDeviceExists | ( | const char * | sno, |
char * | outPlayUrl | ||
) |
This will Scan through the device list to check whether a particular device entry exists.
It will Match the device serial number in the list to find the desired device entry.
[in] | sno | Serial number of the device represented in string format. |
Definition at line 919 of file xdiscovery.c.
gboolean processBooleanRequest | ( | const GUPnPServiceProxy * | sproxy, |
const char * | requestFn, | ||
const char * | responseFn, | ||
gboolean * | result, | ||
gboolean | isInCriticalPath | ||
) |
This function is used to retrieve a boolean parameter from discovered data. Use this function only when there are no parameters passed to the action call.
[in] | sproxy | The Service proxy object |
[in] | requestFn | The required parameter to be retrieved |
[in] | responseFn | The function to retrieve requried function |
[out] | result | the result to be stored. |
[in] | isInCriticalPath | if true, a log message will be printed for telemetry |
Definition at line 2005 of file xdiscovery.c.
gboolean processStringRequest | ( | const GUPnPServiceProxy * | sproxy, |
const char * | requestFn, | ||
const char * | responseFn, | ||
gchar ** | result, | ||
gboolean | isInCriticalPath | ||
) |
This function is used to retrieve a string parameter from discovered data. Use this function only when there are no parameters passed to the action call.
[in] | sproxy | The Service proxy object |
[in] | requestFn | The required parameter to be retrieved |
[in] | responseFn | The function to retrieve requried function |
[out] | result | the result to be stored. |
[in] | isInCriticalPath | if true, a log message will be printed for telemetry |
Definition at line 2050 of file xdiscovery.c.
gboolean processIntRequest | ( | const GUPnPServiceProxy * | sproxy, |
const char * | requestFn, | ||
const char * | responseFn, | ||
guint * | result, | ||
gboolean | isInCriticalPath | ||
) |
This function is used to retrieve a int parameter from discovered data. Use this function only when there are no parameters passed to the action call.
[in] | sproxy | The Service proxy object |
[in] | requestFn | The required parameter to be retrieved |
[in] | responseFn | The function to retrieve requried function |
[out] | result | the result to be stored. |
[in] | isInCriticalPath | if true, a log message will be printed for telemetry |
Definition at line 2095 of file xdiscovery.c.
gboolean process_gw_services | ( | GUPnPServiceProxy * | sproxy, |
GwyDeviceData * | gwData | ||
) |
This function is used to get attributes of different Gateway services using GUPnP Service Proxy.
GUPnP Service Proxy sends commands to a remote UPnP service and handles incoming event notifications. It will request the proxy to get services and attributes such as:
[in] | sproxy | Address of the GUPnP Service Proxy instance. |
[in] | gwData | Address of the Structure holding gateway service attributes. |
Definition at line 2149 of file xdiscovery.c.
gboolean replace_hn_with_local | ( | GwyDeviceData * | gwyData | ) |
Replace IP Address part of the Gateway URL attributes from home networking IP with the local host IP. It Replaces the URL attribute of playbackurl, baseurl, basetrmurl.
[in] | gwyData | Address of the structure holding Gateway attributes. |
Definition at line 2709 of file xdiscovery.c.
gboolean init_gwydata | ( | GwyDeviceData * | gwydata | ) |
Initializes gateway attributes such as serial number, IP details , MAC details, URL details etc.
[in] | gwyData | Address of the structure holding gateway attributes. |
Definition at line 2744 of file xdiscovery.c.
gboolean free_gwydata | ( | GwyDeviceData * | gwydata | ) |
Uninitialize gateway data attributes by resetting them to default value.
[in] | gwyData | Address of the structure variable holding Gateway attributes. |
Definition at line 2803 of file xdiscovery.c.
|
static |
Check for any addition or deletion of gateway from the list. If any update occurs, this routine will validate and add/delete the entry to/from the gateway list and the updated list will be published to others.
[in] | gwyData | Address of the structure holding Gateway attributes. |
Definition at line 2870 of file xdiscovery.c.
gboolean delete_gwyitem | ( | const char * | serial_num | ) |
Deletes a gateway entry from the list of Gateway devices if it matches with the serial number supplied as input.
[in] | serial_num | Serial number of the gateway device represented in string format. |
Definition at line 2999 of file xdiscovery.c.
gboolean sendDiscoveryResult | ( | const char * | outfilename | ) |
This will store the updated device discovery results in local storage as JSON formatted data.
Whenever there's add/delete of gateway list it will create a json file, and all service variables will be added to output.json. It will notify to all the listeners that listen for change of xupnp data.
[in] | outfilename | Name of the output file to store JSON data. |
Definition at line 3087 of file xdiscovery.c.
void delOldItemsFromList | ( | gboolean | bDeleteAll | ) |
Delete all the devices from the device list or delete devices marked as "Not Found" from device list.
[in] | bDeleteAll | Boolean variable indicating whether to delete all entries. |
Definition at line 3637 of file xdiscovery.c.
gboolean readconffile | ( | const char * | configfile | ) |
This will parse and load the configuration file in a key/value pair format as specified in GLib encoding. The configuration file contain attributes which are categorized into following:
This function is used to retrieve the data from the device configuration file.
[in] | configfile | Name of the configuration file. |
Definition at line 3812 of file xdiscovery.c.
gboolean getserialnum | ( | GString * | ownSerialNo | ) |
Get the serial number of the device from Vendor specific UDHCPC config file.
This function is used to get the serial number of the device from the vendor specific file.
[out] | ownSerialNo | Address of the string to return the Serial number. |
Definition at line 3907 of file xdiscovery.c.
char* replace_string | ( | char * | src_string, |
char * | sub_string, | ||
char * | replace_string | ||
) |
Replace all occurrences of a sub-string in the given string to value the specified.
[in] | src_string | Source String. |
[in] | sub_string | Sub string which has to be searched and replaced. |
[in] | replace_string | New sub string that will be replaced. |
Definition at line 4009 of file xdiscovery.c.
int getipaddress | ( | const char * | ifname, |
char * | ipAddressBuffer, | ||
gboolean | ipv6Enabled | ||
) |
This function gets the IP address for the given interface. The IP Address will be formatted to IPv6 or IPv4 address depending upon the configuration.
This function is used to get the IP address based on IPv6 or IPv4 is enabled.
[in] | ifname | Name of the network interface. |
[out] | ipAddressBuffer | String which will store the result IP Address. |
[in] | ipv6Enabled | Boolean value indicating whether IPv6 is enabled. |
1 | If an IP address is found. |
0 | If No IP address found on specified interface. |
Definition at line 4063 of file xdiscovery.c.
gboolean replace_local_device_ip | ( | GwyDeviceData * | gwydata | ) |
When the discovered device is the own device then MOcA IP is replaced.
[in] | gwyData | Address of structure holding the Gateway device attributes. |
Definition at line 4130 of file xdiscovery.c.
gboolean checkvalidip | ( | char * | ipAddress | ) |
This will check whether the input IP Address is a valid IPv4 or IPv6 address.
[in] | ipAddress | IP Address in string format. |
Definition at line 4153 of file xdiscovery.c.
gboolean checkvalidhostname | ( | char * | hostname | ) |
This function will check whether a Host name is valid by validating all the associated IP addresses.
[in] | hostname | Host name represented as a string. |
Definition at line 4184 of file xdiscovery.c.