(self)
Run the demo-rx transmission loop
Run the demo-rx transmission loop
Run the demo - rx transmission loop
def run(self):
        """Run the demo-rx transmission loop"""
        logger.info("Connecting with Satellite API server...")
        while (True):
            try:
                # Server-sent Events (SSE) Client
                r = requests.get(self.server + "/subscribe/transmissions",
                                 stream=True,
                                 cert=(self.tls_cert, self.tls_key))
                r.raise_for_status()
                client = sseclient.SSEClient(r)
                logger.info("Connected. Waiting for events...\n")

                # Continuously wait for events
                for event in client.events():
                    self._handle_event(event)

            except requests.exceptions.ChunkedEncodingError as e:
                logger.debug(e)
                pass

            except requests.exceptions.ConnectionError as e:
                logger.debug(e)
                time.sleep(2)
                pass

            except requests.exceptions.RequestException as e:
                logger.debug(e)
                time.sleep(2)
                pass

            except KeyboardInterrupt:
                exit()

            logger.info("Reconnecting...")
def run ( self ) : logger . info ( "Connecting with Satellite API server..." ) while ( True ) : try : # Server-sent Events (SSE) Client r = requests . get ( self . server + "/subscribe/transmissions" , stream = True , cert = ( self . tls_cert , self . tls_key ) ) r . raise_for_status ( ) client = sseclient . SSEClient ( r ) logger . info ( "Connected. Waiting for events...\n" ) # Continuously wait for events for event in client . events ( ) : self . _handle_event ( event ) except requests . exceptions . ChunkedEncodingError as e : logger . debug ( e ) pass except requests . exceptions . ConnectionError as e : logger . debug ( e ) time . sleep ( 2 ) pass except requests . exceptions . RequestException as e : logger . debug ( e ) time . sleep ( 2 ) pass except KeyboardInterrupt : exit ( ) logger . info ( "Reconnecting..." )