XDK API  3.6.0
Documentation
Files | Macros | Typedefs | Enumerations | Functions | Variables
SendVirtualSensorDataOverUsb

Demo application of printing sensor data on serialport. More...

+ Collaboration diagram for SendVirtualSensorDataOverUsb:

Files

file  AppController.c
 

Macros

#define BCDS_MODULE_ID   XDK_APP_MODULE_ID_APP_CONTROLLER
 
#define MATCHING_FACTOR   0.9f
 

Typedefs

typedef enum
FingPrintMonitoringState_E 
FingPrintMonitoringState_T
 
typedef enum FingPrintSetValue_E FingPrintSetValue_T
 
typedef enum menuLevel_E MenuLevel_T
 

Enumerations

enum  FingPrintMonitoringState_E
 
enum  FingPrintSetValue_E
 
enum  menuLevel_E
 

Functions

void AppController_Init (void *cmdProcessorHandle, uint32_t param2)
 Gives control to the Application controller. More...
 
static void AppControllerEnable (void *param1, uint32_t param2)
 To enable the necessary modules for the application. More...
 
static void AppControllerFire (void *pvParameters)
 Print the enabled VirtualSensor for every PRINT_DATA_INTERVAL mS. More...
 
static void AppControllerSetup (void *param1, uint32_t param2)
 To setup the necessary modules for the application. More...
 
static void Button1Callback (ButtonEvent_T buttonEvent)
 Process the Button1 Data in side the Application context. More...
 
static void Button2Callback (ButtonEvent_T buttonEvent)
 Process the Button2 Data in side the Application context. More...
 
static void PrintCalibratedAccel (void)
 
static void PrintCalibratedGyro (void)
 
static void PrintCalibratedMag (void)
 
static void PrintCompass (void)
 
static void PrintGesture (void)
 
static void PrintGravity (void)
 
static void PrintHumidity (void)
 
static void PrintLinearAccel (void)
 
static void PrintRotation (void)
 
static void PrintStepCounter (void)
 
static void ProcessFingerPrint (void)
 

Variables

static CmdProcessor_TAppCmdProcessor
 
static xTaskHandle AppControllerHandle = NULL
 
static uint8_t ButtonLeftPressedCnt = UINT8_C(0)
 
static Button_Setup_T ButtonSetup
 
static FingPrintSetValue_T FingPrintRequest [FINGERPRINT_REFVAL_MAX] = { NO_REQUEST, NO_REQUEST, NO_REQUEST }
 
static FingPrintMonitoringState_T FingPrintStatus = PROCESS_OFF
 
const VirtualSensor_Enable_T VirtualSensors
 

Detailed Description

Demo application of printing all the defined sensors on serialport (USB virtual comport) every configured interval (PRINT_DATA_INTERVAL) Sensors can be selected via a compile-time switch in the application. #sensorToPrint

VirtualSensors

Following are the Virtual Sensors that are supported currently.

Rotation

Test Procedure:

  1. Enable "Rotation" variable in VirtualSensors structure(VirtualSensor_Enable_T)
  2. Compiled and flash the bin file to XDK board.
  3. Observe Rotation Sensor data value on the TeraTerm.

Acceleration

Test Procedure:

  1. Enable "LinearAccel" variable in VirtualSensors structure(VirtualSensor_Enable_T)
  2. Compiled and flash the bin file to XDK board.
  3. Start moving the XDK in all axis.
  4. Observe linear acceleration Sensor data value on the TeraTerm.

Gravity

Test Procedure:

  1. Enable "Gravity" variable in VirtualSensors structure(VirtualSensor_Enable_T)
  2. Compiled and flash the bin file to XDK board.
  3. Start moving the XDK in all axis.
  4. Observe gravity Sensor data value on the TeraTerm

Gesture

Test Procedure:

  1. Enable "Gesture" variable in VirtualSensors structure(VirtualSensor_Enable_T)
  2. Compiled and flash the bin file to XDK board.
  3. Start tilting the XDK in all the directions.
  4. Observe the number of tilts detected on the TeraTerm

CompassData

Test Procedure:

  1. Enable "Compass" variable in VirtualSensors structure(VirtualSensor_Enable_T)
  2. Compiled and flash the bin file to XDK board.
  3. Observe Compass Sensor data value on the TeraTerm.

Humidity

Test Procedure:

  1. Enable "AbsoluteHumidity" variable in VirtualSensors structure(VirtualSensor_Enable_T)
  2. Compiled and flash the bin file to XDK board.
  3. Observe Humidity Sensor data value on the TeraTerm.

StepCounter

Test Procedure:

  1. Enable "StepCounter" variable in VirtualSensors structure(VirtualSensor_Enable_T)
  2. Compiled and flash the bin file to XDK board.
  3. Observe Step counter data value on the TeraTerm.

CalibratedAccelerometer

Test Procedure:

  1. Enable "CalibratedAccel" variable in VirtualSensors structure(VirtualSensor_Enable_T)
  2. Compiled and flash the bin file to XDK board.
  3. Keep the XDK board flat on the table for few seconds. Yellow LED will start blinking continuously.
  4. Start rotating XDK to +/-90 degree in all axis and Wait for 5 sec in each axis.
  5. Observe Calibrated Accelerometer Sensor data value on the TeraTerm.

CalibratedGyroscope

Test Procedure:

  1. Enable "CalibratedGyro" variable in VirtualSensors structure(VirtualSensor_Enable_T)
  2. Compiled and flash the bin file to XDK board.
  3. Keep the XDK board flat on the table for few seconds. Yellow LED will start blinking continuously.
  4. Start rotating XDK to +/-90 degree in all axis.
  5. Observe Calibrated Gyroscope Sensor data value on the TeraTerm.

CalibratedMagnetometer

Test Procedure: The below steps has to follow to test the Calibrated Magnetometer Sensor.

  1. Enable "CalibratedMag" variable in VirtualSensors structure(VirtualSensor_Enable_T)
  2. Compiled and flash the bin file to XDK board.
  3. Keep the XDK board flat on the table for few seconds. Yellow LED will start blinking continuously.
  4. Start rotating XDK to +/-90 degrees in all axis.
  5. Observe Calibrated Magnetometer Sensor data value on the TeraTerm.

MagneticFingerPrint

Test Procedure:

  1. Enable "FingerPrint" variable in VirtualSensors structure(VirtualSensor_Enable_T)
  2. Compiled and flash the bin file to XDK board.
  3. Procedure to experiment this application can be found in the attached image please see below
    FingerPrintUI.png

Macro Definition Documentation

#define BCDS_MODULE_ID   XDK_APP_MODULE_ID_APP_CONTROLLER
#define MATCHING_FACTOR   0.9f

Macro represents fingerprint matching factor

Typedef Documentation

enum to represent magnetic fingerprint operational status

typedef enum menuLevel_E MenuLevel_T

enum to represent user interface menu level

Enumeration Type Documentation

enum to represent magnetic fingerprint operational status

Enumerator
PROCESS_OFF 
PROCESS_ON 
Enumerator
NO_REQUEST 
VALUE_RESET_REQUEST 
VALUE_SET_REQUEST 

enum to represent user interface menu level

Enumerator
UI_MENU_LEVEL_0 
UI_MENU_LEVEL_1 
UI_MENU_LEVEL_2 
UI_MENU_LEVEL_3 

Function Documentation

void AppController_Init ( void *  cmdProcessorHandle,
uint32_t  param2 
)

This is a template function where the user can write his custom application.

Refer interface header for description

+ Here is the call graph for this function:

static void AppControllerEnable ( void *  param1,
uint32_t  param2 
)
static
  • LED
  • Button
Parameters
[in]param1Unused
[in]param2Unused

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void AppControllerFire ( void *  pvParameters)
static
  • LED
  • Button
Parameters
[in]pvParametersUnused

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void AppControllerSetup ( void *  param1,
uint32_t  param2 
)
static
  • LED
  • Button
Parameters
[in]param1Unused
[in]param2Unused

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void Button1Callback ( ButtonEvent_T  buttonEvent)
static
Parameters
[in]buttonEvent

+ Here is the call graph for this function:

static void Button2Callback ( ButtonEvent_T  buttonEvent)
static
Parameters
[in]buttonEvent

+ Here is the call graph for this function:

static void PrintCalibratedAccel ( void  )
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void PrintCalibratedGyro ( void  )
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void PrintCalibratedMag ( void  )
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void PrintCompass ( void  )
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void PrintGesture ( void  )
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void PrintGravity ( void  )
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void PrintHumidity ( void  )
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void PrintLinearAccel ( void  )
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void PrintRotation ( void  )
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void PrintStepCounter ( void  )
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ProcessFingerPrint ( void  )
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

CmdProcessor_T* AppCmdProcessor
static

Handle to store the main Command processor handle to be used by run-time event driven threads

xTaskHandle AppControllerHandle = NULL
static

OS thread handle for Application controller to be used by run-time blocking threads

uint8_t ButtonLeftPressedCnt = UINT8_C(0)
static

counter to monitor menu level: 0-> mag fing print monitoring; 1->set/reset/check MF1; 2->set/reset/check MF2; 3->set/reset/check MF3

Button_Setup_T ButtonSetup
static
Initial value:
=
{
.CmdProcessorHandle = NULL,
.InternalButton1isEnabled = true,
.InternalButton2isEnabled = true,
.InternalButton1Callback = Button1Callback,
.InternalButton2Callback = Button2Callback,
}
static void Button1Callback(ButtonEvent_T buttonEvent)
Process the Button1 Data in side the Application context.
Definition: AppController.c:311
#define NULL
Definition: BCDS_Basics.h:80
static void Button2Callback(ButtonEvent_T buttonEvent)
Process the Button2 Data in side the Application context.
Definition: AppController.c:221

Button setup parameters

variable to store whether a fingerprint has been requested

FingPrintMonitoringState_T FingPrintStatus = PROCESS_OFF
static

variable to store magnetic fingerprint oparation status

const VirtualSensor_Enable_T VirtualSensors
Initial value:
=
{
.Rotation = 0,
.Compass = 0,
.AbsoluteHumidity = 0,
.CalibratedAccel = 1,
.CalibratedGyro = 0,
.CalibratedMag = 0,
.Gravity = 0,
.StepCounter = 0,
.FingerPrint = 0,
.LinearAccel = 0,
.Gesture = 0
}
Note
More than one sensor is not supported

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:55 by doxygen 1.8.8