BspEmulator Package

BspBoard Module

class openvisualizer.BspEmulator.BspBoard.BspBoard(motehandler)

Bases: openvisualizer.BspEmulator.BspModule.BspModule

Emulates the ‘board’ BSP module

cmd_init()

emulates: void board_init()

cmd_sleep()

emulates void board_init()

BspBsp_timer Module

class openvisualizer.BspEmulator.BspBsp_timer.BspBsp_timer(motehandler)

Bases: openvisualizer.BspEmulator.BspModule.BspModule

Emulates the ‘bsp_timer’ BSP module.

INTR_COMPARE = 'bsp_timer.compare'
INTR_OVERFLOW = 'bsp_timer.overflow'
ROLLOVER = 65536
cmd_cancel_schedule()

emulates void bsp_timer_cancel_schedule()

cmd_get_currentValue()

emulates uin16_t bsp_timer_get_currentValue()

cmd_init()

emulates void bsp_timer_init()

cmd_reset()

emulates void bsp_timer_reset()

cmd_scheduleIn(delayTicks)

emulates void bsp_timer_scheduleIn(PORT_TIMER_WIDTH delayTicks)

intr_compare()

A compare event happened.

intr_overflow()

An (internal) overflow event happened.

BspDebugpins Module

class openvisualizer.BspEmulator.BspDebugpins.BspDebugpins(motehandler)

Bases: openvisualizer.BspEmulator.BspModule.BspModule

Emulates the ‘debugpins’ BSP module

cmd_debug_clr()

emulates void debugpins_debug_clr()

cmd_debug_set()

emulates void debugpins_debug_set()

cmd_frame_clr()

emulates void debugpins_frame_clr()

cmd_frame_set()

emulates void debugpins_frame_set()

cmd_frame_toggle()

emulates void debugpins_frame_toggle()

cmd_fsm_clr()

emulates void debugpins_fsm_clr()

cmd_fsm_set()

emulates void debugpins_fsm_set()

cmd_fsm_toggle()

emulates void debugpins_fsm_toggle()

cmd_init()

emulates void debugpins_init()

cmd_isr_clr()

emulates void debugpins_isr_clr()

cmd_isr_set()

emulates void debugpins_isr_set()

cmd_isr_toggle()

emulates void debugpins_isr_toggle()

cmd_ka_clr()

emulates void debugpins_ka_clr()

cmd_ka_set()

emulates void debugpins_ka_set()

cmd_radio_clr()

emulates void debugpins_radio_clr()

cmd_radio_set()

emulates void debugpins_radio_set()

cmd_radio_toggle()

emulates void debugpins_radio_toggle()

cmd_slot_clr()

emulates void debugpins_slot_clr()

cmd_slot_set()

emulates void debugpins_slot_set()

cmd_slot_toggle()

emulates void debugpins_slot_toggle()

cmd_syncAck_clr()

emulates void debugpins_syncAck_clr()

cmd_syncAck_set()

emulates void debugpins_syncAck_set()

cmd_syncPacket_clr()

emulates void debugpins_syncPacket_clr()

cmd_syncPacket_set()

emulates void debugpins_syncPacket_set()

cmd_task_clr()

emulates void debugpins_task_clr()

cmd_task_set()

emulates void debugpins_task_set()

cmd_task_toggle()

emulates void debugpins_task_toggle()

get_debugPinHigh()
get_framePinHigh()
get_fsmPinHigh()
get_isrPinHigh()
get_kaPinHigh()
get_radioPinHigh()
get_slotPinHigh()
get_syncAckPinHigh()
get_syncPacketPinHigh()

BspEui64 Module

class openvisualizer.BspEmulator.BspEui64.BspEui64(motehandler)

Bases: openvisualizer.BspEmulator.BspModule.BspModule

Emulates the ‘eui64’ BSP module

cmd_get()

emulates void eui64_get(uint8_t* addressToWrite)

BspLeds Module

class openvisualizer.BspEmulator.BspLeds.BspLeds(motehandler)

Bases: openvisualizer.BspEmulator.BspModule.BspModule

Emulates the ‘leds’ BSP module

cmd_all_off()

emulates void leds_all_off()

cmd_all_on()

emulates’ void leds_all_on()

cmd_all_toggle()

emulates void leds_all_toggle()

cmd_circular_shift()

emulates void leds_circular_shift()

cmd_debug_isOn()

emulates uint8_t leds_debug_isOn()

cmd_debug_off()

emulates void leds_debug_off()

cmd_debug_on()

emulates void leds_debug_on()

cmd_debug_toggle()

emulates void leds_debug_toggle()

cmd_error_isOn()

emulates uint8_t leds_error_isOn()

cmd_error_off()

emulates void leds_error_off()

cmd_error_on()

emulates void leds_error_on()

cmd_error_toggle()

emulates void leds_error_toggle()

cmd_increment()

emulates void leds_increment()

cmd_init()

emulates void leds_init()

cmd_radio_isOn()

emulates uint8_t leds_radio_isOn()

cmd_radio_off()

emulates void leds_radio_off()

cmd_radio_on()

emulates void leds_radio_on()

cmd_radio_toggle()

emulates void leds_radio_toggle()

cmd_sync_isOn()

emulates uint8_t leds_sync_isOn()

cmd_sync_off()

emulates void leds_sync_off()

cmd_sync_on()

emulates void leds_sync_on()

cmd_sync_toggle()

emulates void leds_sync_toggle()

get_debugLedOn()
get_errorLedOn()
get_radioLedOn()
get_syncLedOn()

BspModule Module

class openvisualizer.BspEmulator.BspModule.BspModule(name)

Bases: object

Emulates the ‘board’ BSP module

getIsInitialized()

BspRadio Module

class openvisualizer.BspEmulator.BspRadio.BspRadio(motehandler)

Bases: openvisualizer.BspEmulator.BspModule.BspModule, openvisualizer.eventBus.eventBusClient.eventBusClient

Emulates the ‘radio’ BSP module

INTR_ENDOFFRAME_MOTE = 'radio.endofframe_fromMote'
INTR_ENDOFFRAME_PROPAGATION = 'radio.endofframe_fromPropagation'
INTR_STARTOFFRAME_MOTE = 'radio.startofframe_fromMote'
INTR_STARTOFFRAME_PROPAGATION = 'radio.startofframe_fromPropagation'
cmd_getReceivedFrame()

emulates void radio_getReceivedFrame( uint8_t* pBufRead, uint8_t* pLenRead, uint8_t maxBufLen, int8_t* pRssi, uint8_t* pLqi, uint8_t* pCrc)

cmd_getTimerPeriod()

emulates PORT_TIMER_WIDTH radio_getTimerPeriod()

cmd_getTimerValue()

emulates PORT_TIMER_WIDTH radio_getTimerValue()

cmd_init()

emulates void radio_init()

cmd_loadPacket(packetToLoad)

emulates void radio_loadPacket(uint8_t* packet, uint8_t len)

cmd_reset()

emulates void radio_reset()

cmd_rfOff()

emulates void radio_rfOff()

cmd_rfOn()

emulates void radio_rfOn()

cmd_rxEnable()

emulates void radio_rxEnable()

cmd_rxNow()

emulates void radio_rxNow()

cmd_setFrequency(frequency)

emulates void radio_setFrequency(uint8_t frequency)

cmd_setTimerPeriod(period)

emulates void radio_setTimerPeriod(PORT_TIMER_WIDTH period)

cmd_startTimer(period)

emulates void radio_startTimer(PORT_TIMER_WIDTH period)

cmd_txEnable()

emulates void radio_txEnable()

cmd_txNow()

emulates void radio_txNow()

indicateTxEnd(moteId)
indicateTxStart(moteId, packet, channel)
intr_endOfFrame_fromMote()
intr_endOfFrame_fromPropagation()
intr_startOfFrame_fromMote()
intr_startOfFrame_fromPropagation()
class openvisualizer.BspEmulator.BspRadio.RadioState
ENABLING_RX = 'ENABLING_RX'
ENABLING_TX = 'ENABLING_TX'
FREQUENCY_SET = 'FREQUENCY_SET'
LISTENING = 'LISTENING'
LOADING_PACKET = 'LOADING_PACKET'
PACKET_LOADED = 'PACKET_LOADED'
RECEIVING = 'RECEIVING'
RFOFF = 'RFOFF'
SETTING_FREQUENCY = 'SETTING_FREQUENCY'
STOPPED = 'STOPPED'
TRANSMITTING = 'TRANSMITTING'
TURNING_OFF = 'TURNING_OFF'
TXRX_DONE = 'TXRX_DONE'
TX_ENABLED = 'TX_ENABLED'

BspRadiotimer Module

class openvisualizer.BspEmulator.BspRadiotimer.BspRadiotimer(motehandler)

Bases: openvisualizer.BspEmulator.BspModule.BspModule

Emulates the ‘radiotimer’ BSP module

INTR_COMPARE = 'radiotimer.compare'
INTR_OVERFLOW = 'radiotimer.overflow'
OVERFLOW = 65536
cmd_cancel()

emulates void radiotimer_cancel()

cmd_getCapturedTime()

emulates uint16_t radiotimer_getCapturedTime()

cmd_getPeriod()

emulates uint16_t radiotimer_getPeriod()

cmd_getValue()

emulates uint16_t radiotimer_getValue()

cmd_init()

emulates void radiotimer_init()

cmd_schedule(offset)

emulates void radiotimer_schedule(uint16_t offset)

cmd_setPeriod(period)

emulates void radiotimer_setPeriod(uint16_t period)

cmd_start(period)

emulates void radiotimer_start(uint16_t period)

getCounterVal()
intr_compare()

A compare event happened.

intr_overflow()

An overflow event happened.

BspUart Module

class openvisualizer.BspEmulator.BspUart.BspUart(motehandler)

Bases: openvisualizer.BspEmulator.BspModule.BspModule

Emulates the ‘uart’ BSP module

BAUDRATE = 115200
INTR_RX = 'uart.rx'
INTR_TX = 'uart.tx'
cmd_clearRxInterrupts()

emulates void uart_clearRxInterrupts()

cmd_clearTxInterrupts()

emulates void uart_clearTxInterrupts()

cmd_disableInterrupts()

emulates void uart_disableInterrupts()

cmd_enableInterrupts()

emulates void uart_enableInterrupts()

cmd_init()

emulates void uart_init()

cmd_readByte()

emulates uint8_t uart_readByte()

cmd_writeByte(byteToWrite)

emulates void uart_writeByte(uint8_t byteToWrite)

cmd_writeCircularBuffer_FASTSIM(buffer)

emulates void uart_writeCircularBuffer_FASTSIM(uint8_t* buffer, uint8_t len)

doneReading()
intr_rx()

Interrupt to indicate to mote it received a byte from the UART.

intr_tx()

Mote is done sending a byte over the UART.

read()

Read a byte from the mote.

uart_writeBufferByLen_FASTSIM(buffer)

emulates void uart_writeBufferByLen_FASTSIM(uint8_t* buffer, uint8_t len)

write(bytesToWrite)

Write a string of bytes to the mote.

HwCrystal Module

class openvisualizer.BspEmulator.HwCrystal.HwCrystal(motehandler)

Bases: openvisualizer.BspEmulator.HwModule.HwModule

Emulates the mote’s crystal.

FREQUENCY = 32768
MAXDRIFT = 0
getTicksSince(eventTime)

Return the number of ticks since some timestamp.

Parameters:eventTime

The time of the event of interest.

eventTime currentTime
| period

V V <———->

| | | | | |

timeLastTick

^ ^ ^ ^ | | | | +———-+———-+———-+

Returns:The number of ticks since the time passed.
getTimeIn(numticks)

Return the time it will be in a given number of ticks.

param numticks:

The number of ticks of interest.

called here
period

V <———->

| | | | | |

^ ^ ^ ^ | | | | +———-+———-+——— +

numticks ticks

^ ^ | |

timeLastTick returned value

returns:The time it will be in a given number of ticks.
getTimeLastTick()

Return the timestamp of the last tick.

self.tsTick currentTime
| period

V v <———->

| ... | | | | |
<————————->
timeSinceLast

timeLastTick

returns:The timestamp of the last tick.
start()

Start the crystal.

HwModule Module

class openvisualizer.BspEmulator.HwModule.HwModule(name)

Bases: object

Parent class for all hardware modules.

HwSupply Module

class openvisualizer.BspEmulator.HwSupply.HwSupply(motehandler)

Bases: openvisualizer.BspEmulator.HwModule.HwModule

Emulates the mote’s power supply

INTR_SWITCHON = 'hw_supply.switchOn'
isOn()
switchOff()
switchOn()