 
 
 # Need an object to reference a device by its type.
-devices = MediaServer: MediaServer
+devices = mediaserver: mediaserver
 
 # Asynchronous operations to get some device properties.
 init = (device, callback) ->

xml        = require './xml'

exports.createDevice = (type, name, address) ->
    unless type of devices
        device = new EventEmitter()
        device.emit 'error', new Error "UPnP device of type #{type} is not yet implemented."
        return device

    device = Object.create devices[type],
        type: { value: type, enumerable: true }

    device.name = name or type
    device.address = address if address?

    device


device = new EventEmitter()

device.announce = (callback = ->) ->
    ssdp.start.call @
    do callback
    @

mediaserver = Object.create device,
    type: { value: 'MediaServer' }
    version: { value: 1 }
    schemaPrefix: { value: 'urn:schemas-upnp-org' }
    schemaVersion: { value: '1.0' }
