deviceinfoclient.c File Reference

#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <expat.h>
#include "rtv.h"
#include "rtvlib.h"
#include "httpclient.h"
#include "deviceinfoclient.h"

Go to the source code of this file.

Defines

#define MAX_TAG_SZ   (100)
#define MAX_VAL_SZ   (200)

Enumerations

enum  xml_fields_t {
  RTV_TYPE = (1<<0), RTV_NAME = (1<<1), RTV_MDESC = (1<<2), RTV_MNAME = (1<<3),
  RTV_MNUM = (1<<4), RTV_VER = (1<<5), RTV_SNUM = (1<<6), RTV_UDN = (1<<7),
  RTV_EXPECTED_FIELDS = (RTV_TYPE | RTV_NAME | RTV_MDESC | RTV_MNAME | RTV_MNUM | RTV_SNUM | RTV_UDN)
}

Functions

static void XMLCALL devinfo_xml_start (void *data, const char *el, const char **attr)
static void XMLCALL devinfo_xml_end (void *data, const char *el)
static void XMLCALL devinfo_xml_charhndlr (void *userData, const XML_Char *s, int len)
static void XMLCALL devinfo_default_handler (void *userData, const XML_Char *s, int len)
static int get_deviceinfo_callback (unsigned char *buf, size_t len, void *info)
static int parse_version_info (rtv_device_info_t *devinfo)
int rtv_get_device_info (const char *address, char *queryStr, rtv_device_t **device_p)
void rtv_free_device_info (rtv_device_info_t *devinfo)
void rtv_print_device_info (const rtv_device_info_t *devinfo)

Variables

static char curr_tag [MAX_TAG_SZ+1] = ""
static char val_buff [MAX_VAL_SZ+1] = ""
static XML_Parser parser


Define Documentation

#define MAX_TAG_SZ   (100)
 

Definition at line 25 of file deviceinfoclient.c.

Referenced by devinfo_xml_start().

#define MAX_VAL_SZ   (200)
 

Definition at line 26 of file deviceinfoclient.c.

Referenced by devinfo_xml_charhndlr().


Enumeration Type Documentation

enum xml_fields_t
 

Enumerator:
RTV_TYPE 
RTV_NAME 
RTV_MDESC 
RTV_MNAME 
RTV_MNUM 
RTV_VER 
RTV_SNUM 
RTV_UDN 
RTV_EXPECTED_FIELDS 

Definition at line 28 of file deviceinfoclient.c.


Function Documentation

static void XMLCALL devinfo_default_handler void *  userData,
const XML_Char *  s,
int  len
[static]
 

Definition at line 144 of file deviceinfoclient.c.

Referenced by rtv_get_device_info().

static void XMLCALL devinfo_xml_charhndlr void *  userData,
const XML_Char *  s,
int  len
[static]
 

Definition at line 119 of file deviceinfoclient.c.

References MAX_VAL_SZ.

Referenced by rtv_get_device_info().

static void XMLCALL devinfo_xml_end void *  data,
const char *  el
[static]
 

Definition at line 68 of file deviceinfoclient.c.

References rtv_device_info_t::deviceType, rtv_device_info_t::modelDescr, rtv_device_info_t::modelName, rtv_device_info_t::modelNumber, rtv_device_info_t::name, RTV_MDESC, RTV_MNAME, RTV_MNUM, RTV_NAME, RTV_SNUM, RTV_TYPE, RTV_UDN, RTV_VER, rtv_device_info_t::serialNum, rtv_device_info_t::status, rtv_device_info_t::udn, and rtv_device_info_t::versionStr.

Referenced by rtv_get_device_info().

static void XMLCALL devinfo_xml_start void *  data,
const char *  el,
const char **  attr
[static]
 

Definition at line 49 of file deviceinfoclient.c.

References MAX_TAG_SZ.

Referenced by rtv_get_device_info().

static int get_deviceinfo_callback unsigned char *  buf,
size_t  len,
void *  info
[static]
 

Definition at line 150 of file deviceinfoclient.c.

References RTV_ERRLOG.

Referenced by rtv_get_device_info().

static int parse_version_info rtv_device_info_t devinfo  )  [static]
 

Definition at line 166 of file deviceinfoclient.c.

References rtv_device_version_t::build, rtv_device_version_t::major, rtv_device_version_t::minor, rtv_device_info_t::modelNumber, RTV_DEVICE_4K, RTV_DEVICE_5K, rtv_globals_t::rtv_emulate_mode, RTV_ERRLOG, rtv_globals, rtv_print_device_info(), rtv_device_info_t::version, rtv_device_info_t::versionStr, and rtv_device_version_t::vintage.

Referenced by rtv_get_device_info().

void rtv_free_device_info rtv_device_info_t devinfo  ) 
 

Definition at line 290 of file deviceinfoclient.c.

References rtv_device_info_t::deviceType, rtv_device_info_t::ipaddr, rtv_device_info_t::modelDescr, rtv_device_info_t::modelName, rtv_device_info_t::modelNumber, rtv_device_info_t::name, rtv_device_info_t::serialNum, rtv_device_info_t::udn, and rtv_device_info_t::versionStr.

Referenced by rtv_free_devices(), and rtv_get_device_info().

int rtv_get_device_info const char *  address,
char *  queryStr,
rtv_device_t **  device_p
 

Definition at line 218 of file deviceinfoclient.c.

References rtv_device_t::device, devinfo_default_handler(), devinfo_xml_charhndlr(), devinfo_xml_end(), devinfo_xml_start(), errno, get_deviceinfo_callback(), hc_free(), hc_read_pieces(), hc_send_request(), hc_start_request(), rtv_device_info_t::ipaddr, rtv_device_list_t::num_rtvs, parse_version_info(), rc, RTV_DBGLOG, rtv_devices, RTV_ERRLOG, RTV_EXPECTED_FIELDS, rtv_free_device_info(), rtv_get_device_struct(), rtv_print_device_info(), RTVLOG_DSCVR, and rtv_device_info_t::status.

Referenced by bogus_discover(), ciGetDeviceInfo(), process_ssdp_response(), and server_process_connection().

void rtv_print_device_info const rtv_device_info_t devinfo  ) 
 

Definition at line 306 of file deviceinfoclient.c.

References rtv_device_version_t::build, rtv_device_info_t::deviceType, rtv_device_info_t::ipaddr, rtv_device_version_t::major, rtv_device_version_t::minor, rtv_device_info_t::modelDescr, rtv_device_info_t::modelName, rtv_device_info_t::modelNumber, rtv_device_info_t::name, RTV_PRT, rtv_device_info_t::serialNum, rtv_device_info_t::status, rtv_device_info_t::udn, rtv_device_info_t::version, rtv_device_info_t::versionStr, and rtv_device_version_t::vintage.

Referenced by ciGetDeviceInfo(), parse_version_info(), and rtv_get_device_info().


Variable Documentation

char curr_tag[MAX_TAG_SZ+1] = "" [static]
 

Definition at line 43 of file deviceinfoclient.c.

XML_Parser parser [static]
 

Definition at line 45 of file deviceinfoclient.c.

char val_buff[MAX_VAL_SZ+1] = "" [static]
 

Definition at line 44 of file deviceinfoclient.c.


Generated on Wed Sep 8 03:13:22 2010 for mvpmc by  doxygen 1.4.6