UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
SSDP Device Functions

Functions to manage SSDP for UPnP Devices. More...

int AdvertiseAndReply (int AdFlag, UpnpDevice_Handle Hnd, enum SsdpSearchType SearchType, struct sockaddr *DestAddr, char *DeviceType, char *DeviceUDN, char *ServiceType, int Exp)
 Sends SSDP advertisements, replies and shutdown messages.
 
void advertiseAndReplyThread (void *data)
 Wrapper function to reply the search request coming from the control point.
 
int DeviceAdvertisement (char *DevType, int RootDev, char *Udn, char *Location, int Duration, int AddressFamily, int PowerState, int SleepPeriod, int RegistrationState)
 Creates the device advertisement request.
 
int SendReply (struct sockaddr *DestAddr, char *DevType, int RootDev, char *Udn, char *Location, int Duration, int ByType, int PowerState, int SleepPeriod, int RegistrationState)
 Creates the reply packet and send it to the Control Point addesss.
 
int DeviceReply (struct sockaddr *DestAddr, char *DevType, int RootDev, char *Udn, char *Location, int Duration, int PowerState, int SleepPeriod, int RegistrationState)
 Creates the reply packet and send it to the Control Point address.
 
int ServiceAdvertisement (char *Udn, char *ServType, char *Location, int Duration, int AddressFamily, int PowerState, int SleepPeriod, int RegistrationState)
 Creates the advertisement packet and send it to the multicast channel.
 
int ServiceReply (struct sockaddr *DestAddr, char *ServType, char *Udn, char *Location, int Duration, int PowerState, int SleepPeriod, int RegistrationState)
 Creates the advertisement packet and send it to the multicast channel.
 
int ServiceShutdown (char *Udn, char *ServType, char *Location, int Duration, int AddressFamily, int PowerState, int SleepPeriod, int RegistrationState)
 Creates a HTTP service shutdown request packet and sends it to the multicast channel through RequestHandler.
 
int DeviceShutdown (char *DevType, int RootDev, char *Udn, char *Location, int Duration, int AddressFamily, int PowerState, int SleepPeriod, int RegistrationState)
 Creates a HTTP device shutdown request packet and send it to the multicast channel through RequestHandler.
 

Detailed Description

Functions to manage SSDP for UPnP Devices.

Function Documentation

◆ AdvertiseAndReply()

int AdvertiseAndReply ( int  AdFlag,
UpnpDevice_Handle  Hnd,
enum SsdpSearchType  SearchType,
struct sockaddr *  DestAddr,
char *  DeviceType,
char *  DeviceUDN,
char *  ServiceType,
int  Exp 
)

Sends SSDP advertisements, replies and shutdown messages.

Note
This function is only available when the Device option was enabled on compiling the library.
Returns
On success: UPNP_E_SUCCESS
There are several messages on stderr if DEBUG is enabled.
On error:
  • UPNP_E_INVALID_HANDLE
Parameters
[in]AdFlag-1 = Send shutdown, 0 = send reply, 1 = Send Advertisement.
[in]HndDevice handle.
[in]SearchTypeSearch type for sending replies.
[in]DestAddrDestination address.
[in]DeviceTypeDevice type.
[in]DeviceUDNDevice UDN.
[in]ServiceTypeService type.
[in]ExpAdvertisement age.

Definition at line 972 of file ssdp_device.cpp.

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

◆ advertiseAndReplyThread()

void advertiseAndReplyThread ( void *  data)

Wrapper function to reply the search request coming from the control point.

Parameters
[in]dataStructure containing the search request.

Definition at line 1315 of file ssdp_device.cpp.

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

◆ DeviceAdvertisement()

int DeviceAdvertisement ( char *  DevType,
int  RootDev,
char *  Udn,
char *  Location,
int  Duration,
int  AddressFamily,
int  PowerState,
int  SleepPeriod,
int  RegistrationState 
)

Creates the device advertisement request.

Create it based on the input parameter, and send it to the multicast channel.

Returns
On success: UPNP_E_SUCCESS
On error:
  • UPNP_E_OUTOF_MEMORY
  • UPNP_E_INVALID_PARAM
  • UPNP_E_NETWORK_ERROR
  • UPNP_E_SOCKET_WRITE

Definition at line 570 of file ssdp_device.cpp.

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

◆ SendReply()

int SendReply ( struct sockaddr *  DestAddr,
char *  DevType,
int  RootDev,
char *  Udn,
char *  Location,
int  Duration,
int  ByType,
int  PowerState,
int  SleepPeriod,
int  RegistrationState 
)

Creates the reply packet and send it to the Control Point addesss.

Creates the reply packet based on the input parameter, and send it to the Control Point addesss given in its input parameter DestAddr.

Returns
On success: UPNP_E_SUCCESS
On error:
  • UPNP_E_OUTOF_MEMORY
  • UPNP_E_INVALID_PARAM
  • UPNP_E_NETWORK_ERROR
  • UPNP_E_SOCKET_WRITE
Parameters
[in]DestAddrdestination IP address.
[in]DevTypeDevice type.
[in]RootDev1 means root device 0 means embedded device.
[in]UdnDevice UDN.
[in]LocationLocation of Device description document.
[in]DurationLife time of this device.
[in]ByType
[in]PowerStatePowerState as defined by UPnP Low Power.
[in]SleepPeriodSleepPeriod as defined by UPnP Low Power.
[in]RegistrationStateRegistrationState as defined by UPnP Low Power.

Definition at line 649 of file ssdp_device.cpp.

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

◆ DeviceReply()

int DeviceReply ( struct sockaddr *  DestAddr,
char *  DevType,
int  RootDev,
char *  Udn,
char *  Location,
int  Duration,
int  PowerState,
int  SleepPeriod,
int  RegistrationState 
)

Creates the reply packet and send it to the Control Point address.

Creates the reply packet based on the input parameter, and send it to the Control Point address given in its input parameter DestAddr.

Returns
On success: UPNP_E_SUCCESS
On error:
  • UPNP_E_OUTOF_MEMORY
  • UPNP_E_INVALID_PARAM
  • UPNP_E_OUTOF_SOCKET
  • UPNP_E_NETWORK_ERROR
  • UPNP_E_SOCKET_WRITE
Parameters
[in]DestAddrdestination IP address.
[in]DevTypeDevice type.
[in]RootDev1 means root device 0 means embedded device.
[in]UdnDevice UDN.
[in]LocationLocation of Device description document.
[in]DurationLife time of this device.
[in]PowerStatePowerState as defined by UPnP Low Power.
[in]SleepPeriodSleepPeriod as defined by UPnP Low Power.
[in]RegistrationStateRegistrationState as defined by UPnP Low Power.

Definition at line 707 of file ssdp_device.cpp.

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

◆ ServiceAdvertisement()

int ServiceAdvertisement ( char *  Udn,
char *  ServType,
char *  Location,
int  Duration,
int  AddressFamily,
int  PowerState,
int  SleepPeriod,
int  RegistrationState 
)

Creates the advertisement packet and send it to the multicast channel.

Returns
On success: UPNP_E_SUCCESS
On error:
  • UPNP_E_OUTOF_MEMORY
  • UPNP_E_INVALID_PARAM
  • UPNP_E_OUTOF_SOCKET
  • UPNP_E_NETWORK_ERROR
  • UPNP_E_SOCKET_WRITE
Parameters
[in]UdnDevice UDN.
[in]ServTypeService Type.
[in]LocationLocation of Device description document.
[in]DurationLife time of this device.
[in]AddressFamilyDevice address family.
[in]PowerStatePowerState as defined by UPnP Low Power.
[in]SleepPeriodSleepPeriod as defined by UPnP Low Power.
[in]RegistrationStateRegistrationState as defined by UPnP Low Power.

Definition at line 767 of file ssdp_device.cpp.

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

◆ ServiceReply()

int ServiceReply ( struct sockaddr *  DestAddr,
char *  ServType,
char *  Udn,
char *  Location,
int  Duration,
int  PowerState,
int  SleepPeriod,
int  RegistrationState 
)

Creates the advertisement packet and send it to the multicast channel.

Returns
On success: UPNP_E_SUCCESS
On error:
  • UPNP_E_OUTOF_MEMORY
  • UPNP_E_INVALID_PARAM
  • UPNP_E_OUTOF_SOCKET
  • UPNP_E_NETWORK_ERROR
  • UPNP_E_SOCKET_WRITE
Parameters
[in]DestAddr
[in]ServTypeService Type.
[in]UdnDevice UDN.
[in]LocationLocation of Device description document.
[in]DurationLife time of this device.
[in]PowerStatePowerState as defined by UPnP Low Power.
[in]SleepPeriodSleepPeriod as defined by UPnP Low Power.
[in]RegistrationStateRegistrationState as defined by UPnP Low Power.

Definition at line 818 of file ssdp_device.cpp.

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

◆ ServiceShutdown()

int ServiceShutdown ( char *  Udn,
char *  ServType,
char *  Location,
int  Duration,
int  AddressFamily,
int  PowerState,
int  SleepPeriod,
int  RegistrationState 
)

Creates a HTTP service shutdown request packet and sends it to the multicast channel through RequestHandler.

Returns
On success: UPNP_E_SUCCESS
On error:
  • UPNP_E_OUTOF_MEMORY
  • UPNP_E_INVALID_PARAM
  • UPNP_E_OUTOF_SOCKET
  • UPNP_E_NETWORK_ERROR
  • UPNP_E_SOCKET_WRITE

Definition at line 843 of file ssdp_device.cpp.

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

◆ DeviceShutdown()

int DeviceShutdown ( char *  DevType,
int  RootDev,
char *  Udn,
char *  Location,
int  Duration,
int  AddressFamily,
int  PowerState,
int  SleepPeriod,
int  RegistrationState 
)

Creates a HTTP device shutdown request packet and send it to the multicast channel through RequestHandler.

Returns
On success: UPNP_E_SUCCESS
On error:
  • UPNP_E_OUTOF_MEMORY
  • UPNP_E_INVALID_PARAM
  • UPNP_E_OUTOF_SOCKET
  • UPNP_E_NETWORK_ERROR
  • UPNP_E_SOCKET_WRITE
Parameters
[in]DevTypeDevice Type.
[in]RootDev1 means root device.
[in]UdnDevice UDN.
[in]LocationLocation URL.
[in]DurationDevice duration in sec.
[in]AddressFamilyDevice address family.
[in]PowerStatePowerState as defined by UPnP Low Power.
[in]SleepPeriodSleepPeriod as defined by UPnP Low Power.
[in]RegistrationStateRegistrationState as defined by UPnP Low Power.

Definition at line 894 of file ssdp_device.cpp.

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