Development

Examples:

Communication / Bluetooth Low Energy

» BLE 01 Normal scan

Last edition: Jan 10th, 2017 |

This example shows how to make a normal scan with Bluetooth low energy, printing number of discovered devices and scan results stored in EEPROM.

» BLE 02 Name scan

Last edition: Jan 10th, 2017 |

This example shows how to make a name scan with Bluetooth low energy, printing number of discovered devices and scan results stored in EEPROM.

» BLE 03 Limited scan

Last edition: Jan 10th, 2017 |

This example shows how to make a limited scan with Bluetooth low energy, till find two devices, printing them by USB

» BLE 04 Scan device

Last edition: May 09th, 2017 |

This example shows how to make a scan with Bluetooth low energy and look for a specific BLE module, printing number of discovered devices and scan results.

» BLE 05 Configuring a scan

Last edition: Jan 10th, 2017 |

This example shows how to configure scan parameters and makin a scan with them, printing number of discovered devices and scan results stored in EEPROM.

» BLE 06 Configuring a connection

Last edition: Jan 10th, 2017 |

This example configures the parameters involved when connecting to a slave. It performs a device scan and if detected, it connects to the BLE module with the selected paramenters.

» BLE 07 Connecting to a BLE device as Master

Last edition: Jan 10th, 2017 |

This examples shows how to connect to other BLE device, using default connecting parameters. Waspmote will be the master and the remote device will be the slave. A remote attribute is read / written on the slave.

» BLE 08 Connecting to a BLE device as Slave

Last edition: Jan 10th, 2017 |

this code set discoverable/connectable mode on Waspmote to allow connections from other BLE devices. Then wait during 30 seconds for incoming connections. If a connection is established, then Waspmote keeps connected till the master ends the connection.

» BLE 09 Encrypted connection

Last edition: Jan 10th, 2017 |

This code set discoverable/connectable mode on Waspmote to allow connections from other BLE devices. Then wait during 30 seconds for incoming connections. If a connection is established, the connection is encrypted and then Waspmote keeps connected till the master ends the connection.

» BLE 10 Characteristic notification as master

Last edition: Jan 10th, 2017 |

This example shows how notifying processes works. The program first look for a certain BLE device and connects to it. Then, it subscribes to notifications of a certain characteristic and wait for notifications from the slave. Once 5 notifications are received (or timeout is reached) the Master terminates the connection and starts again. This example is though to be used together with example BLE_11.

» BLE 11 Characteristic notification slave

Last edition: Jan 10th, 2017 |

This example shows how notifying processes works. The program first make itself discoverable and connectable, waiting for incoming connections. Once connected, waits for notification subscribing events and, when they are found, the subscribed attribute is written five times to allow the master receive notification events. Then, it keeps waiting events till the connection is over.

» BLE 12 Characteristic indication Master

Last edition: Jan 10th, 2017 |

This example shows how indicate processes works. The program first look for a certain BLE device and connects to it. Then, it subscribes to indications of a certain characteristic and wait for indications from the slave. Once 5 indications are received (or timeout is reached) the Master terminates the connection and starts again. This example is though to be used together with example BLE_11.

» BLE 13 characteristic indication slave

Last edition: Jan 10th, 2017 |

This example shows how indicate processes works. The program first make itself discoverable and connectable, waiting for incoming connections. Once connected, waits for indication subscribing events and, when they are found, the subscribed attribute is written five times to allow the master receive indication events. Then, it waits till the indication acknowledge event from the written value. Finally, it keeps waiting events till the connection is over.

» BLE 17 Configuring advertisements

Last edition: Jan 10th, 2017 |

This example changes the advertisement parameters to show the ability of sending data in the advertisement payload. Remember that maximum advertisement data length is 31 bytes.

» BLE 18 Sleep mode

Last edition: Jan 10th, 2017 |

This example show how to manage BLE sleep mode. * Do not confuse BLE sleep mode with Waspmote sleep modes.