USER MANUAL RC188x-GPR
2019 Radiocrafts AS
RIIM User Manual (rev.1.2)
Page
17
of
23
8.8. Network
The Network module has the functions needed for network operations. Before the node can join any network, it
must be started by a call to either startBorderRouter, startRouterNode or startLeafNode.
The following example shows how to start a node as a Router:
Example : ICI code
RIIM_SETUP
()
{
// Simply start as a router node. Nothing more is needed.
Network
.
startRouterNode
();
return
UAPI_OK
;
}
Example 8 - Network example code
The following functions are part of the Network module.
Function
Description
startBorderRouter
(IPv6_Prefix,
IPv4_Address, IPv4_Netmask,
IPv4_Gateway)
Start the node as a Border Router. The arguments are optional, but
must be provided for your chosen technology (IPv4 or IPv6) if you
want to enable automatic connection to the outside world
startRouterNode
()
Start the node as a Router. This means that the node is capable of
routing packets through itself
startLeafNode
()
Start the node as a Leaf. This means that the node is NOT capabe of
forwarding packets to other nodes, but will use less energy
getRootNodeAddress
(IPAddress)
This function returns the address of the WSN root node. It will only do
so if the node is part of a WSN and the root is reachable.
getLastRSSI
()
Get the RSSI value of the last packet received
getLastLQI
()
The the LQI value of the last packet received
getNetworkState
()
Get the state of the network
join
()
RESERVED
leave
()
RESERVED
setFreqBand
(FrequencyBand)
Sets the frequency band. Only 868 MHz is available
getPanId
()
Get the PAN ID of the node
getAddress
(IPAddress)
Get the IP address of the node
setTxPower
(TxPower)
Set the output transmission power
ping
(IPAddress)
Perform a ping to any IP address
getNodeType
()
Return the type of node we are configured as
Set Channel(ChannelNumber)
Sets the RF channel to use
Table 8 - Network functions