WSN specific functions

These are functions that can be used only with IEEE 802.15.4 (WSN’s) supported hardware and are considered as UPI candidates.

Submodules

Network fucntions

class wishful_upis.lowpan.net.LowPanRouteTableEntry(dest_ipv6_addr, num_hops, nexthop_ipv6_addr)[source]

Bases: object

wishful_upis.lowpan.net.LOWPAN_NET_RPL_DIO_INTERVAL_MIN = Attribute(key=rpl_dio_interval_min, type=<type 'int'>, isReadonly=False)

The value used to configure Imax for the DIO Trickle timer. The default value is 20. This configuration results in a maximum interval of 2.33 hours.

wishful_upis.lowpan.net.LOWPAN_NET_RPL_DIO_INTERVAL_DOUBLINGS = Attribute(key=rpl_dio_interval_doublings, type=<type 'int'>, isReadonly=False)

The value used to configure k for the DIO Trickle timer. The default value is 10. This configuration is a conservative value for Trickle suppression mechanism.

wishful_upis.lowpan.net.LOWPAN_NET_RPL_DIO_REDUNDANCY = Attribute(key=rpl_dio_redundancy, type=<type 'int'>, isReadonly=False)

Default route lifetime as a multiple of the lifetime unit. The lifetime unit is the granularity of time used in RPL lifetime values, in seconds.

wishful_upis.lowpan.net.LOWPAN_NET_RPL_DEFAULT_LIFETIME = Attribute(key=rpl_default_lifetime, type=<type 'int'>, isReadonly=False)

Updates the objective function used to for link estimation and path cost calculation.

wishful_upis.lowpan.net.LOWPAN_NET_RPL_OBJECTIVE_FUNCTION = Attribute(key=rpl_objective_function, type=<type 'int'>, isReadonly=False)
wishful_upis.lowpan.net.LOWPAN_NET_RPL_STATISTICS = Measurement(key=rpl_stats, type=<type 'list'>)

This function configures a node as RPL border router.

wishful_upis.lowpan.net.LOWPAN_NET_RPL_SET_BORDER_ROUTER = Action(key=rpl_set_border_router, args_types=(<type 'list'>,), return_type=<type 'int'>)

This function returns all route entries in the route table.

wishful_upis.lowpan.net.LOWPAN_NET_IPV6_GET_ROUTE_TABLE = Action(key=get_route_table, args_types=(), return_type=<type 'list'>)

Clears all route entries from the route table.

wishful_upis.lowpan.net.LOWPAN_NET_IPV6_CLEAR_ROUTE_TABLE = Action(key=clear_route_table, args_types=(), return_type=<type 'int'>)

Adds a route entry towards the destination IPv6 address given as argument.

wishful_upis.lowpan.net.LOWPAN_NET_IPV6_ADD_ROUTE = Action(key=add_route, args_types=(<class 'ipaddress.IPv6Address'>, <type 'int'>, <class 'ipaddress.IPv6Address'>), return_type=<type 'int'>)

Removes the route entry towards the destination IPv6 address given as argument.

wishful_upis.lowpan.net.LOWPAN_NET_IPV6_REMOVE_ROUTE = Action(key=remove_route, args_types=(<type 'list'>,), return_type=<type 'int'>)

This function retuns a list with the IPv6 addresses of all connected neighbors.

wishful_upis.lowpan.net.LOWPAN_NET_ND6_GET_NEIGHBOR_TABLE = Action(key=get_neighbor_table, args_types=(), return_type=<type 'list'>)

Add a neigbor to the ND6 neighbor table.

wishful_upis.lowpan.net.rpl_set_border_router(rpl_prefix)[source]

This function configures a node as RPL border router. The function requires an IPv6 rpl prefix as argument.

Args:
rpl_prefix (list): array with 8 bytes used as the IPv6 RPL prefix in the DODAG.
Returns:
int: Error value 0 = SUCCESS; -1 = FAIL
wishful_upis.lowpan.net.ipv6_get_route_table()[source]

This function returns all route entries in the route table. Each route entry contains the destination IPv6 address, the number of hops towards the destination and the IPv6 address of the nexthop.

Returns:
list: list of LowPanRouteTableEntry objects.
wishful_upis.lowpan.net.ipv6_clear_route_table()[source]

Clears all route entries from the route table.

Returns:
int: Error value 0 = SUCCESS; -1 = FAIL
wishful_upis.lowpan.net.ipv6_route_add(dest_ipv6_addr, num_hops, nexthop_ipv6_addr)[source]

Adds a route entry towards the destination IPv6 address given as argument. The number of hops and nexthop IPv6 address are also required.

Args:
dest_ipv6_addr (IPv6Address): IPv6 address of the destination. num_hops (int): Number of hops between source and destination. nexthop_ipv6_addr (IPv6Address): Next hop towards destination.
Returns:
int: Error value 0 = SUCCESS; -1 = FAIL
wishful_upis.lowpan.net.ipv6_route_remove(dest_ipv6_addr)[source]

Removes the route entry towards the destination IPv6 address given as argument.

Args:
dest_ipv6_addr (IPv6Address): IPv6 address of the destination.
Returns:
int: Error value 0 = SUCCESS; -1 = FAIL
wishful_upis.lowpan.net.nd6_get_neighbor_table()[source]

This function retuns a list with the IPv6 addresses of all connected neighbors.

Returns:
list: the IPv6 addresses of all connected neighbors.
wishful_upis.lowpan.net.nd6_add_neighbor(neighbor_ipv6_addr, neighbor_mac_addr, is_router)[source]

Add a neigbor to the ND6 neighbor table. This function takes the IPv6 address, the extended MAC address and the role of the neighbor as arguments.

Args:
neighbor_ipv6_addr (IPv6Address): Neighbor IPv6 address. neighbor_mac_addr (list): Neighbor extended MAC address (64-bit). is_router (bool): Indicates if the neighbor has routing capabilities enabled.
Returns:
int: Error value 0 = SUCCESS; -1 = FAIL

Radio fucntions

class wishful_upis.lowpan.radio.DOT_802154E_TimeSlot(slot_index, slot_option, channel_offset)[source]

Bases: object

Bases: object

class wishful_upis.lowpan.radio.DOT_802154E_SlotFrame(slot_offset=0, num_slots=0, slot_frame=None)[source]

Bases: object

class wishful_upis.lowpan.radio.DOT_802154E_SlotList(num_slots, slot_list=None)[source]

Bases: object

wishful_upis.lowpan.radio.DOT_802154_PHY_CURRENTCHANNEL = Attribute(key=IEEE802154_phyCurrentChannel, type=<type 'int'>, isReadonly=False)

IEEE-802.15.4 channel number.

wishful_upis.lowpan.radio.DOT_802154_PHY_TXPOWER = Attribute(key=IEEE802154_phyTXPower, type=<type 'int'>, isReadonly=False)

The transmit power of the device.

wishful_upis.lowpan.radio.DOT_802154_MAC_EXTENDEDADDRESS = Attribute(key=IEEE802154_macExtendedAddress, type=<type 'list'>, isReadonly=False)

The extended 64-bit IEEE address assigned to the device.

wishful_upis.lowpan.radio.DOT_802154_MAC_SHORTADDRESS = Attribute(key=IEEE802154_macShortAddress, type=<type 'int'>, isReadonly=False)

The short 16-bit address that the device uses to communicate in the PAN.

wishful_upis.lowpan.radio.DOT_802154_MAC_PANID = Attribute(key=IEEE802154_macPANId, type=<type 'int'>, isReadonly=False)

The 16-bit identifier of the PAN on which the device is operating.

wishful_upis.lowpan.radio.DOT_802154_MAC_CW = Attribute(key=IEEE802154_macCW, type=<type 'int'>, isReadonly=False)

IEEE-802.15.4 channel.

wishful_upis.lowpan.radio.DOT_802154_MAC_MAX_BE = Attribute(key=IEEE802154_macMaxBE, type=<type 'int'>, isReadonly=False)

The maximum value of the backoff exponent, BE, in the CSMA-CA algorithm, as defined in Section 5.1.1.4. of the IEEE-802.15.4 standard.

wishful_upis.lowpan.radio.DOT_802154_MAC_MIN_BE = Attribute(key=IEEE802154_macMinBE, type=<type 'int'>, isReadonly=False)

IEEE-802.15.4 channel.

wishful_upis.lowpan.radio.DOT_802154_MAC_MAXCSMABACKOFFS = Attribute(key=IEEE802154_macMaxCSMABackoffs, type=<type 'int'>, isReadonly=False)

IEEE-802.15.4 channel.

wishful_upis.lowpan.radio.DOT_802154_MAC_MAXFRAMERETRIES = Attribute(key=IEEE802154_macMaxFrameRetries, type=<type 'int'>, isReadonly=False)

IEEE-802.15.4 channel.

wishful_upis.lowpan.radio.DOT_802154E_MAC_HOPPINGSEQUENCELENGTH = Attribute(key=IEEE802154e_macHoppingSequenceLength, type=<type 'int'>, isReadonly=False)

IEEE-802.15.4 channel.

wishful_upis.lowpan.radio.DOT_802154E_MAC_HOPPINGSEQUENCELIST = Attribute(key=IEEE802154e_macHoppingSequenceList, type=<type 'list'>, isReadonly=False)

IEEE-802.15.4 channel.

wishful_upis.lowpan.radio.DOT_802154E_MAC_SLOTFRAMESIZE = Attribute(key=IEEE802154e_macSlotframeSize, type=<type 'int'>, isReadonly=False)

IEEE-802.15.4 channel.

wishful_upis.lowpan.radio.DOT_802154E_MAC_TIMESLOT = Attribute(key=IEEE802154e_macTimeslot, type=<class 'wishful_upis.lowpan.radio.DOT_802154E_TimeSlot'>, isReadonly=False)

IEEE-802.15.4 channel.

wishful_upis.lowpan.radio.DOT_802154E_MAC_TSTIMESLOTLENGTH = Attribute(key=IEEE802154e_macTsTimeslotLength, type=<type 'int'>, isReadonly=False)

IEEE-802.15.4 channel.

wishful_upis.lowpan.radio.DOT_802154E_MAC_SLOTLIST = Attribute(key=IEEE802154e_macSlotList, type=<class 'wishful_upis.lowpan.radio.DOT_802154E_SlotList'>, isReadonly=False)

IEEE-802.15.4 channel.

wishful_upis.lowpan.radio.DOT_802154E_MAC_SLOTFRAME = Attribute(key=IEEE802154e_macSlotFrame, type=<class 'wishful_upis.lowpan.radio.DOT_802154E_SlotFrame'>, isReadonly=False)

IEEE-802.15.4 channel.

wishful_upis.lowpan.radio.DOT_802154_MAC_LPL_CHANNELCHECKRATE = Attribute(key=IEEE802154_macLplChannelCheckRate, type=<type 'int'>, isReadonly=False)

IEEE-802.15.4 channel.

wishful_upis.lowpan.radio.DOT_802154_MAC_LPL_PHASEOPTIMIZATION = Attribute(key=IEEE802154_macLplPhaseOptimization, type=<type 'bool'>, isReadonly=False)

IEEE-802.15.4 channel.

wishful_upis.lowpan.radio.DOT_802154_MAC_TAISC_ACTIVE_RADIO_PROGRAM = Attribute(key=TAISCActiveRadioProgram, type=<type 'str'>, isReadonly=False)

IEEE-802.15.4 channel.

wishful_upis.lowpan.radio.blacklist_channels()[source]

“Network OS” helpers