Initialization

Before start using the module, it needs to be initialized. During this process, the UART to communicate with the module has to be opened, module is powered and some variables are initialized.

Setting ON

With the function ON() the module is powered and the UART is opened. It returns \'1\' on success, \'0\' if error.

Besides, default configuration parameters are sent to the Bluetooth module.

Example of use:

{
    BLE.ON(); // starts power and configuration parameters
}

Setting OFF

Bluetooth function OFF() closes the UART and switches off the module.

Example of use:

{
    BLE.OFF(); // switches the module off
}

Sleep mode

The module has a sleep mode to reduce power consumption when UART interface is not needed. Basically, this function disables UART interface, allowing the module to enter in the Bluetooth low power modes. Waspmote and its sleep modes are independent from the BLE sleep mode.

There are three low power modes, which are automatically managed by the module, so the user has no control on them. The module has been optimized by the manufacturer to select the best power mode for each condition.

Table: Low power modes of the BLE module

The function to enter in sleep mode is Sleep(). When this function is called, the module will enter in the best power mode available, and it will continue advertising, or being visible if the user has previously enabled these features.

Example of use:

{
    BLE.sleep(); // puts the BLE module into sleep mode
}

The function to leave sleep mode and enable again UART interface is wakeUp().

Example of use:

{
    BLE.wakeUp(); // wakes up BLE module
}

In the Waspmote Development section you can find a complete example about using this function.

Go to: https://development.libelium.com/ble-18-sleep-mode/

Reset

If a software reset is needed for the BLE module, then the reset function would be used.

Example of use:

{
    BLE.reset();
}

In the Waspmote Development section you can find a complete example about using this function.

Go to: https://development.libelium.com/ble-21-software-reset/

Last updated