X-NUCLEO-IKS01A1 Environmental/Motion sensors data transmitted via X-NUCLEO-IDB04A1 BLE board. Compatible with iOS/Android ST BlueMS V2.1 application.

Dependencies:   BLE_API X_NUCLEO_IDB0XA1 X_NUCLEO_IKS01A1 mbed

Fork of Bluemicrosystem1 by ST Expansion SW Team

BlueMicrosystem application

This application is the mbed equivalent of ST BlueMicrosystem1 and provides an example of motion and environmental data exported via Bluetooth Low Energy to an Android or IOS device.
It runs on a ST NUCLEO-F401RE board connected with a X-NUCLEO-IKS01A1 and a X-NUCLEO-IDB04A1 expansion boards and is compatible with Android and iOS ST BlueMS smartphone applications (based on Android and iOS BlueST SDKs).
By default the application is not providing sensor fusion and activity recognition features. However sensor fusion can be enabled following the steps below:

  • Download and install osxMotionFX library on your PC.
  • Obtain the free license for your board following the instructions
  • Copy the correct license into Middlewares/ST/STM32_OSX_MotionFX_Library/osx_license.h of your mbed program folder
  • Copy Middlewares/ST/STM32_OSX_MotionFX_Library/Inc/osx_motion_fx.h file
  • Rename the provided .lib Keil binary library giving it a .ar extension, then copy it into Middlewares/ST/STM32_OSX_MotionFX_Library/Lib of your mbed program folder
  • Enable USE_SENSOR_FUSION_LIB macro into MotionFX_Manager.h file and recompile.
Revision:
13:d00147d01d4e
Parent:
12:baf8b5294320
--- a/CustomConfigService.h	Mon Jun 20 15:46:53 2016 +0000
+++ b/CustomConfigService.h	Tue Jun 21 13:04:42 2016 +0000
@@ -98,17 +98,17 @@
         }   
     
     bool isConfHandle (Gap::Handle_t handle) {
-            if (handle == configw2stCharacteristic.getValueAttribute().getHandle()-1) return true;
+            if (handle == configw2stCharacteristic.getValueAttribute().getHandle() - BLE_HANDLE_VALUE_OFFSET) return true;
             return false;
     }           
 
     void enNotify (Gap::Handle_t handle) {
-            if (isConfHandle(handle-2)) { 
+            if (isConfHandle(handle - BLE_HANDLE_EN_DIS_OFFSET)) { 
                 PRINTF("enNotify! %d\n\r", handle); isEnabledConfNotify = true; return; }    
     }
     
     void disNotify (Gap::Handle_t handle) {
-            if (isConfHandle(handle-2)) { 
+            if (isConfHandle(handle - BLE_HANDLE_EN_DIS_OFFSET)) { 
                             isEnabledConfNotify = false; return; }    
     }