def main(): device_uuid = uuid.uuid4() local_ip_address = get_ip_address() web_server_port = 8088 http_server = UPNPHTTPServer(web_server_port, friendly_name="Xeleum Xi-Fi Gateway", manufacturer="Xeleum Lighting", manufacturer_url='http://www.xeleum.com/', model_description='Xi-Fi Gateway', model_name="Xi-F Gateway", model_number="XRF001", model_url="http://www.xeleum.com", serial_number="XRF1234", uuid=device_uuid, presentation_url="index.html") http_server.start() ssdp_server = SSDPServer() ssdp_server.register( 'local', 'uuid:{}::upnp:rootdevice'.format(device_uuid), 'upnp:rootdevice', 'http://{}:{}/description.xml'.format(local_ip_address, web_server_port)) ssdp_server.start() XrfAPI.getInstance().start() app.run(debug=True, host='0.0.0.0', port=port, use_reloader=False)
def _start_ssdp(): ssdp = SSDPServer() thread_ssdp = threading.Thread(target=ssdp.run, args=()) thread_ssdp.daemon = True # Daemonize thread thread_ssdp.start() ssdp.register( 'local', 'uuid:{}::upnp:rootdevice'.format(discoverData['DeviceID']), 'upnp:rootdevice', 'http://{}:{}/device.xml'.format(config['tvhProxyHost'], config['tvhProxyPort']), 'SSDP Server for tvhProxy')
def startssdp(dvbtype): discover = getdeviceinfo.discoverdata(dvbtype) device_uuid = discover['DeviceUUID'] if config.hrtunerproxy.debug.value: logger.info('Starting SSDP for %s, device_uuid: %s' % (dvbtype,device_uuid)) local_ip_address = getIP() ssdp = SSDPServer() ssdp.register('local', 'uuid:{}::upnp:rootdevice'.format(device_uuid), 'upnp:rootdevice', 'http://{}:{}/device.xml'.format(local_ip_address,tunerports[dvbtype])) thread_ssdp = threading.Thread(target=ssdp.run, args=()) thread_ssdp.daemon = True # Daemonize thread thread_ssdp.start()
def startssdp(dvbtype): discover = getdeviceinfo.deviceinfo(dvbtype) device_uuid = discover[dvbtype]['DeviceUUID'] print '[Plex DVR API] Starting SSDP for %s, device_uuid: %s' % ( dvbtype, device_uuid) local_ip_address = getIP() ssdp = SSDPServer() ssdp.register( 'local', 'uuid:{}::upnp:rootdevice'.format(device_uuid), 'upnp:rootdevice', 'http://{}:{}/device.xml'.format(local_ip_address, tunerports[dvbtype])) thread_ssdp = threading.Thread(target=ssdp.run, args=()) thread_ssdp.daemon = True # Daemonize thread thread_ssdp.start()
def __getattr__(self, attr): if attr is 'ssdp': from ssdp import SSDPServer self.ssdp = SSDPServer(self) return self.ssdp elif attr is 'http': from http import HTTPServer self.http = HTTPServer(self) return self.http elif attr is 'https': from http import HTTPServer self.https = HTTPServer(self, True) return self.https else: raise AttributeError("'%s' has no attribute %r" % (self.__class__.__name__, attr))
def __init__(self, connection_type, mqtt_port): self.network_interface = connection_type self.device_uuid = uuid.uuid4() self.local_ip_address = self.__get_network_interface_ip_address( self.network_interface) self.http_server = UPNPHTTPServer( 8088, friendly_name="Camera Test", manufacturer="L-IoT-ning", manufacturer_url='http://liotningshop.azurewebsites.net/', model_description='Pi Camera Test', model_name="PiCamera", model_number="3000", model_url="", serial_number="JBN425133", uuid=self.device_uuid, presentation_url=("tcp://{}:" + mqtt_port).format( self.local_ip_address)) self.ssdp = SSDPServer() self.ssdp.register( 'local', 'uuid:{}::upnp:rootdevice'.format(self.device_uuid), 'upnp:rootdevice', 'http://{}:8088/jambon-3000.xml'.format(self.local_ip_address))
from ssdp import SSDPServer from upnp_http_server import UPNPHTTPServer import uuid import logging logger = logging.getLogger() logger.setLevel(logging.DEBUG) device_uuid = uuid.uuid4() http_server = UPNPHTTPServer( 8088, friendly_name="Bigfoot device", manufacturer="Yeti SL", manufacturer_url='https://getyeti.co/', model_description='Yeti Python appliance V1', model_name="Python", model_number="1", model_url="https://github.com/netbeast/bigfoot/python", serial_number="v1", uuid=device_uuid, presentation_url="http://localhost:5000/") http_server.start() ssdp = SSDPServer() ssdp.register('local', 'uuid:{}::upnp:rootdevice'.format(device_uuid), 'bigfoot:all', 'http://localhost:8088/python-v1.xml') ssdp.run()