upnp_event.h

来自「AMLOGIC DPF source code」· C头文件 代码 · 共 81 行

H
81
字号
/*******************************************************************
 * 
 *  Copyright C 2005 by Amlogic, Inc. All Rights Reserved.
 *
 *  Description: UPnP Event subscription.
 *
 *  Author: Eric Knudstrup
 *  Created: Wed Oct  5 23:42:10 2005
 *
 *******************************************************************/

#ifndef UPNP_EVENT_H
#define UPNP_EVENT_H

typedef struct upnp_event_s UPnPEvent_t;
typedef struct upnp_var_s UPnPEventVar_t;
typedef struct upnp_sub_s UPnPEventSubscriber_t;

typedef void (*UPnPVarCb_t) (void);

/*;emacs generated header for file upnp_event.c. Global function declarations only. */
/**
 * Initialize UPnP Event subscription capability.
 */
extern void
upnp_event_init(void);

/**
 * Given a \a event \a subscription \a URL, and the \a variable
 * \a name, add subscription capability.
 *
 * @param eventSubURL Event subscription URL string.
 *
 * @returns A \a UPnPEvent_t if successful, NULL otherwise.
 */
extern UPnPEvent_t *
upnp_event_add(char *eventSubURL);

/**
 * Add a new evented variable to a \a UPnPEvent_t handle.
 *
 * @param event The \a UPnPEvent_t.
 * @param var_name The new UPnP variable name.
 * @param initial_value Initial string.
 *
 * @returns A new UPnPEventVar_t if successful, NULL if not.
 */
extern UPnPEventVar_t *
upnp_event_add_var(UPnPEvent_t *event, char *var_name, char *initial_value);

/**
 * Retrieve the value for an evented variable.
 *
 * @param [in] var Variable to retrieve the value for.
 * @param [out] buffer A buffer pointer to copy the variable's value into.
 * @param [out] len Length of the output buffer.
 *
 * @returns A string pointer containing the variable's value.
 */
extern char *
upnp_event_var_get(UPnPEventVar_t *var, char *buffer, int len);

/**
 * Given a \a UPnPEventVar_t, change its value and notify subscribers.
 */
extern void
upnp_event_var_change(UPnPEvent_t *event, UPnPEventVar_t *var, char *value);


/**
 * Given the Timeout string from a UPnP SUBSCRIBE or NOTIFY request,
 * extract the seconds value.
 * If the \a timeout_field is NULL or is equal to "Second-infinite"
 * the function will return \a default_timeout.
 */
extern int
get_subscribe_timeout(char *timeout_field, int default_timeout);
/*;end emacs generated header for file upnp_event.c. Global function declarations only. */

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?