Initialization

Before starting to use a module, it needs to be initialized. During this process, the UART to communicate with the module has to be opened and the XBee switch has to be set on.

Setting on

The ON() function initializes all the global variables, opens the correspondent UART and switches the XBee on. The baud rate used to open the UART is defined on the library (115200 bps by default).

It returns nothing.

The initialized variables are:

  • protocol: specifies the protocol used (DIGIMESH in this case).

  • pos: specifies the position to use in received packets.

  • discoveryOptions: specifies the options in Node Discovery.

  • awakeTime: specifies the time to be awake before go sleeping.

  • sleepTime: specifies the time to be sleeping.

  • scanChannels: specifies the channels to scan.

  • scanTime: specifies the time to scan each channel.

  • timeEnergyChannel: specifies the time the channels will be scanned.

  • encryptMode: specifies if encryption mode is enabled.

  • powerLevel: specifies the power transmission level.

  • timeRSSI: specifies the time RSSI LEDs are on.

  • sleepOptions: specifies the options for sleeping.

  • networkHops: specifies the maximum number of hops expected to be seen in a network route.

  • netDelaySlots: specifies the maximum random number of network delay slots before rebroadcasting a network packet.

  • netRouteRequest: specifies the maximum number of route discovery retries allowed to find a path to the destination node.

  • meshNetRetries: specifies the maximum number of network packet delivery attempts.

Example of use:

{
xbeeDM.ON();
}

Setting off

The OFF() function closes the UART and switches the XBee off.

Example of use:

{
xbeeDM.OFF();
}

Last updated