def generate_request(queue, satelliteId): # Send the first request to activate the stream. Telemetry will start # to be received at this point. satellite_stream_request = stellarstation_pb2.SatelliteStreamRequest( satellite_id=satelliteId) satellite_stream_request.accepted_framing.extend( [transport.AX25, transport.BITSTREAM]) yield satellite_stream_request try: while True: commands = queue.get() command_request = stellarstation_pb2.SendSatelliteCommandsRequest( command=commands) satellite_stream_request = stellarstation_pb2.SatelliteStreamRequest( satellite_id=satelliteId, send_satellite_commands_request=command_request) satellite_stream_request.accepted_framing.extend( [transport.AX25, transport.BITSTREAM]) yield satellite_stream_request queue.task_done() while True: time.sleep(3) except Exception as e: print("Encountered error") print(e)
def generate_request(queue): # Send the first request to activate the stream. Telemetry will start # to be received at this point. yield stellarstation_pb2.SatelliteStreamRequest(satellite_id=SATELLITE_ID) while True: commands = queue.get() command_request = stellarstation_pb2.SendSatelliteCommandsRequest(command=commands) satellite_stream_request = stellarstation_pb2.SatelliteStreamRequest( satellite_id=SATELLITE_ID, send_satellite_commands_request=command_request) yield satellite_stream_request queue.task_done()
def sendTelecommand(self, tcArray): """ This method sends an array of telecommands through the open stream. @param tcArray -- array of telecommands to be sent, each of them needs to be a bytearray object """ self._l.debug('Telecommands array request') command_request = stellarstation_pb2.SendSatelliteCommandsRequest( output_framing=self.framing, command=tcArray) satellite_stream_request = stellarstation_pb2.SatelliteStreamRequest( satellite_id=self.satellite_id, send_satellite_commands_request=command_request) yield satellite_stream_request self._l.debug('Telecommands array sent')
def generate_request(): # Send the first request to activate the stream. Telemetry will start # to be received at this point. yield stellarstation_pb2.SatelliteStreamRequest(satellite_id=SATELLITE_ID) while True: command_request = stellarstation_pb2.SendSatelliteCommandsRequest( command=[ bytes(b'a' * 5000), bytes(b'b' * 5000), bytes(b'c' * 5000), bytes(b'd' * 5000), bytes(b'e' * 5000), ]) satellite_stream_request = stellarstation_pb2.SatelliteStreamRequest( satellite_id=SATELLITE_ID, send_satellite_commands_request=command_request) yield satellite_stream_request time.sleep(3)