Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 10 months ago.
SimpleBLE error
Hi,
I'm having troubles with the SimpleBLE library. Every time I try to compile the Project, I'm getting 2 errors:
- Error: Too few arguments in function call in "main.cpp", Line: 9, Col: 16
- Error: Class "SimpleBLE" has no member "waitForEvent" in "main.cpp", Line: 11, Col: 14
The project consists of example code from the homepage of SimpleBLE https://os.mbed.com/teams/mbed-x/code/SimpleBLE/
#include "mbed.h"
#include "SimpleBLE.h"
SimpleBLE ble("DEVICE_NAME"); // second argument is the advertisement interval (default: 1000 ms.)
// variables here!
int main(int, char**) {
ble.start();
while (1) {
ble.waitForEvent();
}
}
I'm using X-NUCLEO-IDB05A1 so I imported the X-NUCLEO-IDB0XA1 library. mbed, SimpleBLE and BLE_API were imported as well. I'm using the L476RG board.
Am I missing something? Please help
1 Answer
7 years, 10 months ago.
Which SimpleBLE revision are you using? If you're on Mbed 2, use 15329a3de04c, not latest.
Alternatively, use SimpleBLE-Example-mbedos5 which compiles fine for L476RG (but have not tested whether it actually works as I don't have the shield with me).
Thank you so much for your answer! The version I'm using is the Mbed 5. Your project " SimpleBLE-Example-mbedos5" seems to work now.
But how do I send and receive messages with the help of this library? In other words I wanna receive some string and react to it by sending back an another string?
posted by 20 Feb 2018