1:name: Quark C1000 with CC2520 - 2 nodes 2 3###################################################################### 4# 5# Sample script creating 1 server node and 1 client node using a 6# range-based radio medium function - transmission is possible if 7# the nodes are in range of each other. The nodes are positioned in 3D space (x,y,z), 8# at a distance of 10 units on the x-axis. 9# 10# Differences in SyncUnit values for machines represent differences 11# in their relative speed. This prevents the machines from 12# synchronizing in full. 13# 14###################################################################### 15 16# Create a new wireless transmission medium. This command adds the `wireless` object to the emulation. 17emulation CreateIEEE802_15_4Medium "wireless" 18 19# The radio is using a range-based medium (with the `Range` set to `11`). 20# If not set, the default SimpleMediumFunction will be used (where range is not relevant). 21wireless SetRangeWirelessFunction 11 22 23######################### UDP SERVER - begin ######################### 24# This creates a server node, connects it to the wireless medium and sets the node's position. 25# 26# The `$bin` variable contains the path to the server ELF file. The `$name` variable will indicate 27# the name of the created machine. Both variables are used in quark_c1000.resc. 28$bin=@https://dl.antmicro.com/projects/renode/zephyr-echo-server.elf-s_1003060-56eb87aafc8c00f73ebe154dafee627a3a4f23f6 29$name="server" 30 31# Load the script for a single generic node: 32i @scripts/multi-node/quark-c1000-zephyr/quark_c1000.resc 33 34# Each radio device has to be connected to a wireless medium. Two devices can communicate 35# if they are connected to the same medium. 36# In this situation the radio is accessible via an SPI bus. 37connector Connect spi1.radio wireless 38 39# Each radio in a machine can have its position set independently. 40wireless SetPosition spi1.radio 0 0 0 41 42########################## UDP SERVER - end ########################## 43 44# The Monitor works in the context of the current machine. It allows the user to access the machine's peripherals 45# and to set variables local to this machine. The selection must be cleared before creating a new machine 46# so that the $bin and $name variables are global and accessible from the new context. 47mach clear 48 49######################### UDP CLIENT - begin ######################### 50# This creates a client node. 51 52$bin=@https://dl.antmicro.com/projects/renode/zephyr-echo-client.elf-s_1016316-bfb6584d9d63950e8106c6820efccdaf0b7738a5 53$name="client" 54 55i @scripts/multi-node/quark-c1000-zephyr/quark_c1000.resc 56connector Connect spi1.radio wireless 57 58# The node is placed 10 units from the server. With the maximum range set to 11, all packets will be delivered. 59wireless SetPosition spi1.radio 10 0 0 60 61########################## UDP CLIENT - end ########################## 62 63# This clears the Monitor's context. To select a machine, use the `mach set` command (try `help mach`). 64mach clear 65