Having a working RCM connection (see Initializing and running the connection) allows us now to communicate with a RCM radio module and set it up for network operation. At this stage we usually need to configure the basic properties of the module that allow it to communicate across the RCM network. We will discuss them now.
Device unique identifier (UID).
The RCM protocol is based on IEEE 802.15.4 PHY and MAC layers, that define the addressing used to deliver messages across the network. Both of these standards relay on a concept of a 64-bit globally unique identifier (also called EUI-64) that unambiguously identifies a node. The RCM radio module hardware may have the EUI-64 built-in, however if it doesn't or if we want to enforce a different one, we can use the rcm::Connection::setUID method to set it up. The complementary rcm::Connection::getUID call can read the currently set UID from the device.
Network identifier (PANID), network role and network address.
Each RCM network is identified by unique 64-bit identifier called Personal Area Network ID (PAN ID). A node that wants to join a network can choose the network identifier it want's to connect to. Each RCM device can be given one of three roles: coordinator, router or end device. The coordinator is the node that starts and maintains the network. Routers are nodes that can route (relay) packets, while end devices can only communicate with coordinators or routers and do not have the routing capability. In addition to role, every node in the network is given a short 16-bit network address. This address can be set manually or picked up randomly by the RCM communication stack.
The rcm::Connection::configureNode method shall be used to deliver information about PAN ID, role and addressing mode to the RCM radio module. The following complementary set of methods can be used to read back these settings:
In order to enable message encryption, the rcm::Connection::enableNetworkSecurity method should be called, that also sets up a 128-bit network key that is used to cipher the messages. All nodes that wish to communicate within a secured network must provide the same network key. Security settings affect the maximum number of bytes that can fit into a single RCM message packet. In order to determine how many bytes can fit into a single RCM packet with the current settings, the rcm::Connection::getMaxPayloadSize method can be used.
The radio module features two PHY (physical layer) modes according to IEEE 802.15.4 specification:
- 20kbps BPSK-DSSS PHY
- 100kbps O-QPSK-DSSS PHY
The rcm::Connection::setAntenna method can be used to control which antenna output will be used. This setting is valid for radio modules supporting more than one antenna output. For single-antenna modules this setting does not influence device operation.
The following example illustrates the concepts that we have learned so far:
Generated on Thu Feb 22 2018 13:14:54 for RCM API C++ Library by 18.104.22.168