romupnp toolkits bob van andel president allegro software
TRANSCRIPT
RomUPNP Toolkits
Bob Van Andel
President
Allegro Software
About Allegro Software
Leading provider of embedded Internet toolkits
Founded 1996, Boxborough, MA
Privately held, profitable, debt-free
Selected customers Agilent, APC, Cisco, D-Link, Echostar, Extreme Networks, Foundry Networks, Gemstar, McData, Nielsen, Netopia, Proxim, Sony, 3Com, Xerox, Zyxel
Embedded Product Line Highly Portable
ANSI-C Software Abstraction Layer No file system required
Small Footprint, Custom Developed
Any RTOS and TCP stack INTEGRITY, OSE, ThreadX, AMX, uCOS, Nucleus, VRTX, MQX, QNX, pSOS, VxWorks, Windows, Unix, Linux
Allegro Product Line
Embedded Web Services Technology Web Servers - RomPager Web Clients - RomWebClient XML services - RomXML
Embedded Email SMTP Clients - RomMailer POP3 Clients - RomPOP
Allegro Product Line - II Device Management
Command Line Interface - RomCLI
Universal Plug and Play Technology Basic Device - RomUPNP Basic Full Device - RomUPNP Advanced Control Point - RomUPNP Control
RomUPNP Basic Device
Discovery Services (SSDP)
Uses RomPager Web Server for Description and Presentation
Small Runtime Footprint (15- 25KB)
Simple API
Leverages Windows Desktop Services
RomUPNP ToolkitsProcess Flow
PlugBuilderUPnP CompilerCompiler,Linker, etc.PlugBuild.xmlDevice.xmlServices.xml
BootImageSSDP Control TablesDevice.c, Device_v.cServices.c
RomUPNP Basic Device PlugBuild.xml sample
<a:RomUPNP xmlns:a="urn:schemas-allegro-com:romupnp-toolkit-1-0"> <Support>Basic</Support> <DeviceDescription file=”Description.xml”> <device id=”1234”> <serialNumber> <a:GetData Access="Direct" AccessPtr="gDeviceSerialNumber" DataType="String"> </serialNumber> <UDN> <a:GetData Prefix=“uuid:” AccessType="Direct" AccessPtr="gRootDeviceUdn" DataType="String"> </UDN> </device> </DeviceDescription> <ServiceDescription file=”Services.xml”> </ServiceDescription></a:RomUPNP>
RomUPNP Basic DeviceDiscovery (SSDP) API
extern void UpnpNotifyInit(void * theTaskDataPtr,Unsigned32 theMaxAge,Unsigned32 theNotifyPeriod,Unsigned8 theXmitCount,Unsigned8 theXmitPeriod,Unsigned8 theTimeToLive,char * theDescriptionPath,upnpDeviceInfoPtr theDeviceInfoPtr);
extern void UpnpNotifyShutdown(void * theTaskDataPtr,ruCompletionFuncPtr theCompletionFunctionPtr);
RomUPNP Advanced Device Discovery, Description, Presentation
Adds Control and Eventing Services
Includes RomPager Advanced
Includes RomWebClient
Includes Full RomXML Parser/Framer
Small Runtime Footprint (<100Kb)
Sample Templates for devices (IGD, etc.)
RomUPNP Advanced Device PlugBuild.xml sample
<a:RomUPNP xmlns:a="urn:schemas-allegro-com:romupnp-toolkit-1-0"> <Support>Advanced</Support> <DeviceDescription file=”Description.xml”> <device id=”1234”> <serialNumber> <a:GetData Access="Direct" AccessPtr="gDeviceSerialNumber" DataType="String"> </serialNumber> <UDN> <a:GetData Prefix=“uuid:” AccessType="Direct" AccessPtr="gRootDeviceUdn" DataType="String"> </UDN> </device> </DeviceDescription> <ServiceDescription type="urn:schemas-upnp-org:service:serviceType:v” file=”Services.xml” > <action name=”DoSomething” handler=”MyDoSomethingAction” /> <action name=”DoSomethingElse” handler=”MyDoSomethingElseAction” /> </ServiceDescription></a:RomUPNP>
RomUPNP Advanced DeviceControl API
typedef struct {Unsigned16 fServiceIndex;void * fInArgPtr; /* Argument list for Action */void * fOutArgPtr; /* Normal Reply Arguments */upnpErrorBody * fErrorPtr;char * fNamePtr; /* Action Name */
} rpSoapActionArg, *rpSoapActionArgPtr;
typedef enum {eSoapCompleteOk,eSoapPending,eSoapCompleteErr
} rpSoapResponse;
static rpSoapResponse MyDoSomethingAction(void *theTaskDataPtr, rpSoapActionArgPtr theActionArgPtr);
RomUPNP Advanced DeviceEventing API
extern Boolean RuPublishUpnpEvent(void *theTaskDataPtr, Unsigned16 theServiceId, Unsigned16 theServiceIndex,char **theVarList, Unsigned16 theVarListLength);
Integrated Event Handling Application provides Variable List RomUPNP builds Notification Message HTTP Client Sends Event Notifications to concerned
subscribers
RomUPNP Control Point Discovery, Description, Control, Events
Includes Web Server, Web Client, XML
Search for UPnP Devices
Listen for UPnP Device Announcements
Retrieve Device/Service Descriptions
Control UPnP Device with Actions
Subscribe and Receive Events
RomUPNP Control Point Search for UPnP Devices
typedef enum {eCpReportAll,eCpReportRoot,eCpReportDevice,eCpReportUPnPDeviceType,eCpReportDomainDeviceType,
} cpFilterType;
extern cpSearchStatus CpInitSearch(void * theTaskPointer, cpFilterType theSearchTarget, char * theSearchData, Unsigned8 theXmitCount, Unsigned8 theXmitPeriod, Unsigned8 theTimeToLive, cpSearchCompletionFuncPtr theSearchCompletionPtr, void * theCookie);
typedef void (*cpSearchCompletionFuncPtr)(cpSearchStatus theStatus, void * theCookie, cpDiscoveryInfoPtr theDiscoveryInfoPtr);
RomUPNP Control Point Listen for UPnP Device Announcements
void CpRegisterSsdpListener(void *theTaskDataPtr, cpSsdpListenerFuncPtr theListenerFuncPtr); ypedef enum {
eCpSsdpAlive,eCpSsdpBye,eCpSsdpExpired
} cpSsdpNotifyStatus;
typedef void (*cpSsdpListenerFuncPtr)(cpSsdpNotifyStatus theStatus, cpDiscoveryInfoPtr theDiscoveryInfoPtr);
RomUPNP Control Point Retrieve Device/Service Descriptions
extern cpGetStatus CpGetDeviceDescription(void *theTaskDataPtr, cpDevicePtr theDevicePtr,void * theParsedDataBufferPtr,Unsigned32 theParsedDataBufferSize,CpGetCompletionFuncPtr theCompletionFunctionPtr, void * theCookie);
typedef void (*cpGetCompletionFuncPtr)(cpGetStatus theStatus, cpRootDeviceDataPtr theRootDataPtr, Unsigned32 theDataSize, void * theCookie);
Integrated Retrieval HTTP Client Retrieves Descriptions XML Parser turns into C structures
RomUPNP Control Point Control UPnP Device with Actions
void CpInvokeAction(void * theTaskDataPtr, cpDeviceDataPtr theDeviceDataPtr,char * theServiceIdPtr, char * theActionName,void * theActionArgsPtr, void * theActionResponsePtr,cpActionCompletionPtr theCompletionFuncPtr,void * theCookie);
typedef void (*cpActionCompletionPtr)(cpActionStatus theStatus, void * theCookie, cpActionErrorInfoPtr theErrorInfoPtr);
Integrated Action Handling Application provides Action Arguments RomUPNP builds XML/SOAP request HTTP Client Sends/Retrieves SOAP request RomUPNP parses XML/SOAP response
RomUPNP Control Point Subscribe and Receive Events
cpSubStatus CpSubscribe(void * theTaskDataPtr, cpDeviceDataPtr theDeviceDataPtr,char * theServiceIdPtr, Unsigned16 theDeviceInstanceIndex,Unsigned16 theServiceInstanceIndex,cpSubNotificationFuncPtr theNotificationFuncPtr,void * theCookie);
typedef void (*cpSubNotificationFuncPtr)(cpSubStatus theStatus, void *theSubscription, void *theCookie);
Integrated Event Handling Application provides Variable Action routines HTTP Server receives Event Notification RomXML Parses Event Variables Variable sent to Variable Action routines
RomUPNP Toolkits RomUPNP Basic Device
Simple Discovery, Description, Presentation
No SOAP, or XML parsing required
RomUPNP Advanced Device Full UPnP Implementation
RomUPNP Control Point Full UPnP Implementation
For the interconnected lifestyle