def test_send_beacon(self):
        self._start()

        self.system.comm.put_frame(telecommand.SendBeacon())

        frame = self.system.comm.get_frame(20, filter_type=BeaconFrame)

        self.assertIsInstance(frame, BeaconFrame)
Example #2
0
def session(start, stop):
    yield Loop(title="Get few beacons",
               tasks=[[tc.SendBeacon(), Send], [20, Sleep]],
               until=Received(rf.little_oryx.LittleOryxDeepSleepBeacon,
                              min_count=2))

    yield Loop(
        title="Delay reboot",
        tasks=[
            [tc.little_oryx.DelayRebootToNormal(10, 48), Send],  # 3.5 days
            [20, Sleep],
            [tc.SendBeacon(), Send],
            [20, Sleep]
        ],
        until=Received(rf.little_oryx.DelayRebootSuccessFrame))

    yield Loop(title="Get beacons at the end",
               tasks=[[tc.SendBeacon(), Send], [20, Sleep]],
               until=Eternity())
    def test_beacon_parsing(self):
        self._start()

        self.system.comm.put_frame(telecommand.SendBeacon())

        frame = self.system.comm.get_frame(20, filter_type=BeaconFrame)

        self.assertIsInstance(frame, BeaconFrame)
        store = BeaconStorage()
        parser = BitArrayParser(
            FullBeaconParser(),
            ''.join(map(lambda x: pack('B', x), frame._payload)), store)
        parser.parse()
Example #4
0
def session(start, stop):
    yield Loop(
        title="Ensure bitrate 9600",
        tasks=[
            [10, Sleep],
            [tc.SetBitrate(correlation_id=12, bitrate=BaudRate.BaudRate9600), Send],
        ],
        until=Received(rf.SetBitrateSuccessFrame)
    )

    yield Loop(
        title="Get few beacons",
        tasks=[
            [tc.SendBeacon(), Send],
            [20, Sleep]
        ],
        until=Received(rf.BeaconFrame, min_count=2)
    )

    yield Loop(
        title="Get file list",
        tasks=[
            [tc.ListFiles(correlation_id=13, path='/'), Send],
            [20, Sleep],
            [tc.SendBeacon(), Send],
            [20, Sleep]
        ],
        until=Received(rf.FileListSuccessFrame)
    )

    yield Loop(
        title="Get beacons at the end",
        tasks=[
            [tc.SendBeacon(), Send],
            [40, Sleep]
        ],
        until=Eternity()
    )
Example #5
0
    def get_additional_tasks(self):
        command = {"command": "GetTasklistWithAllMissings"}
        data = self._send_command_with_receive(command)
        if not data:
            return None

        newItems = json.loads(data, object_hook=DownloadFileTask.from_dict)
        newTasks = []
        for newItem in newItems:
            newCommand = DownloadFile(newItem.correlation_id, newItem.path,
                                      newItem.chunks)
            newTasks.append([newCommand, Send, WaitMode.Wait])
        newTasks.append([[tc.SendBeacon(), 20], SendLoop, WaitMode.NoWait])
        return newTasks
Example #6
0
 def send_additional_beacon(style, ns_wrapper):
     import telecommand as tc
     sendExtraCommand(style, ns_wrapper, tc.SendBeacon())
Example #7
0
 def jebnij_bekona():
     import telecommand
     sender.send(telecommand.SendBeacon())
Example #8
0
 def _send_beacon(self, evt):
     self._system.comm.put_frame(telecommand.SendBeacon())
     beacon_frame = self._system.comm.get_frame(30)
     self._system.transmitter.current_beacon_timestamp = time.localtime()
     self._system.transmitter.current_beacon = beacon_frame.payload()
Example #9
0
def session(start, stop):
    yield Loop(title="Get beacons at the end",
               tasks=[[tc.SendBeacon(), Send], [20, Sleep]],
               until=Eternity())