Cape Fox Simulator - mszczodrak/swift-fox GitHub Wiki
Swift Fox programs can be tested in the Cape Fox Simulator. To prepare a Swift Fox program for the Cape Fox simulation, substitute each process' radio driver with cape().
The following is an example of a program running with one process called count, which consists of counter application, CTP network protocol, CSMACA MAC protocol running on top of the cc2420 radio driver.
configuration count { counter(15, 1024, 0, 2)
ctp(2)
csmaca(2, 200, 10, 10, 1, 1, 1)
# always ON, delay_after_receive, backoff, min_backoff
# ack, cca, crc
cc2420(26, 31, 1, 1)
# channel, power, ack, crc
}
state starting {count}
start starting
The same Swift Fox program configured for Cape Fox would substitute the cc2420(26, 31, 1, 1) line with cape():
configuration count { counter(15, 1024, 0, 2)
ctp(2)
csmaca(2, 200, 10, 10, 1, 1, 1)
# always ON, delay_after_receive, backoff, min_backoff
# ack, cca, crc
cape()
}
state starting {count}
start starting
Then, if this program would be saved in sample.sfp file, it would be compiled as follows:
user@linux $ sfc sample.sfp
user@linux $ fennec micaz cape
More information about Cape Fox simulator can be found here.