XDK API  3.4.0
Documentation
Files | Macros | Functions | Variables
VirtualXdkDemo

Demo Application for Virtual XDK mobile application. More...

+ Collaboration diagram for VirtualXdkDemo:

Files

file  AppController.c
 

Macros

#define BCDS_MODULE_ID   XDK_APP_MODULE_ID_APP_CONTROLLER
 
#define BLE_SEND_TIMEOUT_IN_MS   UINT32_C(1000)
 
#define LEM_SENSOR_DATA_VOLTS_TO_MICROVOLTS   UINT32_C(1000000)
 

Functions

void AppController_Init (void *cmdProcessorHandle, uint32_t param2)
 Gives control to the Application controller. More...
 
static void AppControllerBleDataRxCB (uint8_t *rxBuffer, uint8_t rxDataLength, void *param)
 
static void AppControllerEnable (void *param1, uint32_t param2)
 To enable the necessary modules for the application. More...
 
static void AppControllerFire (void *pvParameters)
 Responsible for controlling the Virtual XDK demo application control flow. More...
 
static void AppControllerSetup (void *param1, uint32_t param2)
 To setup the necessary modules for the application. More...
 
static void Button1EventCallback (ButtonEvent_T buttonEvent)
 
static void Button2EventCallback (ButtonEvent_T buttonEvent)
 
static uint8_t * ConvertDecimalToSTring (uint8_t data, uint8_t *str)
 Convert Decimal/Hex value to String Format to display Version Information. More...
 
static void ConvertInteger32ToVersionString (uint32_t xdkVersion, uint8_t *str)
 This function is to convert the integer data into a string data. More...
 
static void GetFwVersionInfo (void)
 This function to Get the Firmware Version by combining the XDK SW Release (i.e., Workbench Release) version (i.e., 3.2.0) More...
 
static Retcode_T SampleAndNotifyHighPriorityData (void)
 

Variables

static CmdProcessor_TAppCmdProcessor
 
static xTaskHandle AppControllerHandle = NULL
 
static BLE_Setup_T BLESetupInfo
 
static uint8_t Button1Status = 0
 
static uint8_t Button2Status = 0
 
static Button_Setup_T ButtonSetup
 
static uint32_t DataSampleRateInMs = 200
 
static ExternalSensor_Setup_T ExternalSensorSetup
 
static uint8_t IsUseBuiltInSensorFusion = 1
 
static uint8_t ManufacturerCharacteristicValue [] = "Robert Bosch GmbH"
 
static uint8_t ModelNumberCharacteristicValue [] = "XDK110"
 
static uint16_t SampleCounter = 0
 
static bool SensorDataStartSampling = false
 
static Sensor_Setup_T SensorSetup
 
static uint8_t SoftwareRevisionCharacteristicValue [10U] = { 0 }
 
static Storage_Setup_T StorageSetup
 
const VirtualSensor_Enable_T VirtualSensors
 

Detailed Description

In this application, XDK is presented in a playful fashion on a mobile device that is connected to XDK via BLE. Interacting with the physical XDK will manipulate the virtual XDK.

The web links to get the Android/iOS App is given below:
Android App: Click_Here
iOS App: Click_Here
For further documentation please refer the page Virtual XDK Application Guide

Macro Definition Documentation

#define BCDS_MODULE_ID   XDK_APP_MODULE_ID_APP_CONTROLLER
#define BLE_SEND_TIMEOUT_IN_MS   UINT32_C(1000)
#define LEM_SENSOR_DATA_VOLTS_TO_MICROVOLTS   UINT32_C(1000000)

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 AppControllerBleDataRxCB ( uint8_t *  rxBuffer,
uint8_t  rxDataLength,
void *  param 
)
static

+ Here is the call graph for this function:

static void AppControllerEnable ( void *  param1,
uint32_t  param2 
)
static
  • BLE
  • Sensor
    • Internal
    • External
    • Virtual
  • Storage
  • LED
  • Button

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void AppControllerFire ( void *  pvParameters)
static
  • Wait for BLE to be connected
  • Based on user need, sample the sensor and notify all the necessary sensor / high priority data
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
  • BLE
  • Sensor
    • Internal
    • External
    • Virtual
  • Storage
  • 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 Button1EventCallback ( ButtonEvent_T  buttonEvent)
static
static void Button2EventCallback ( ButtonEvent_T  buttonEvent)
static
static uint8_t* ConvertDecimalToSTring ( uint8_t  data,
uint8_t *  str 
)
static
Parameters
[in]data- Number which needs to be convert into string to display in Decimal instead of HEX values.
in/out]*str - pointer to Store/write the Version number in String Format.

+ Here is the caller graph for this function:

static void ConvertInteger32ToVersionString ( uint32_t  xdkVersion,
uint8_t *  str 
)
static
Parameters
[in]xdkVersion- 32 bit value containing the XDK SW version information
in/out]str - pointer to the parsed version string

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void GetFwVersionInfo ( void  )
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static Retcode_T SampleAndNotifyHighPriorityData ( 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

BLE_Setup_T BLESetupInfo
static
Initial value:
=
{
.IsMacAddrConfigured = false,
.MacAddr = 0UL,
.IsDeviceCharacteristicEnabled = true,
.CharacteristicValue =
{
.ModelNumber = &ModelNumberCharacteristicValue[0],
.Manufacturer = &ManufacturerCharacteristicValue[0],
.SoftwareRevision = &SoftwareRevisionCharacteristicValue[0]
},
.CustomServiceRegistryCB = NULL,
}
static uint8_t ModelNumberCharacteristicValue[]
Definition: AppController.c:95
#define APP_CONTROLLER_BLE_DEVICE_NAME
Definition: AppController.h:106
static void AppControllerBleDataRxCB(uint8_t *rxBuffer, uint8_t rxDataLength, void *param)
Definition: AppController.c:315
Definition: XDK_BLE.h:66
endcode Description XDK XDK XDK &above Remarks RTOS Task Creation const char *const NULL
Definition: XdkMigrationGuide.dox:814
static uint8_t ManufacturerCharacteristicValue[]
Definition: AppController.c:96
static uint8_t SoftwareRevisionCharacteristicValue[10U]
Definition: AppController.c:97

BLE setup parameters

uint8_t Button1Status = 0
static
uint8_t Button2Status = 0
static
Button_Setup_T ButtonSetup
static
Initial value:
=
{
.CmdProcessorHandle = NULL,
.InternalButton1isEnabled = true,
.InternalButton2isEnabled = true,
.InternalButton1Callback = Button1EventCallback,
.InternalButton2Callback = Button2EventCallback,
}
static void Button2EventCallback(ButtonEvent_T buttonEvent)
Definition: AppController.c:303
endcode Description XDK XDK XDK &above Remarks RTOS Task Creation const char *const NULL
Definition: XdkMigrationGuide.dox:814
static void Button1EventCallback(ButtonEvent_T buttonEvent)
Definition: AppController.c:291

Button setup parameters

uint32_t DataSampleRateInMs = 200
static

variable to store the sensor sample time

ExternalSensor_Setup_T ExternalSensorSetup
static
Initial value:
=
{
.CmdProcessorHandle = NULL,
.Enable =
{
.LemCurrent = false,
.MaxTemp = false,
.MaxResistance = false,
},
.LemConfig =
{
.CurrentRatedTransformationRatio = APP_CURRENT_RATED_TRANSFORMATION_RATIO,
},
.Max31865Config =
{
},
}
#define APP_CURRENT_RATED_TRANSFORMATION_RATIO
Definition: AppController.h:76
Definition: XDK_ExternalSensor.h:66
endcode Description XDK XDK XDK &above Remarks RTOS Task Creation const char *const NULL
Definition: XdkMigrationGuide.dox:814
#define ENABLE_EXTERNAL_LEM_SENSOR
Definition: AppController.h:54

External Sensor setup parameters

uint8_t IsUseBuiltInSensorFusion = 1
static
uint8_t ManufacturerCharacteristicValue[] = "Robert Bosch GmbH"
static
uint8_t ModelNumberCharacteristicValue[] = "XDK110"
static
uint16_t SampleCounter = 0
static

counter used for toggling low priority data messages.

bool SensorDataStartSampling = false
static
Sensor_Setup_T SensorSetup
static

Sensor setup parameters

uint8_t SoftwareRevisionCharacteristicValue[10U] = { 0 }
static
Storage_Setup_T StorageSetup
static
Initial value:
=
{
.SDCard = true,
.WiFiFileSystem = false,
}

Storage setup parameters

const VirtualSensor_Enable_T VirtualSensors
Initial value:
=
{
.Rotation = true,
.Compass = false,
.AbsoluteHumidity = false,
.CalibratedAccel = false,
.CalibratedGyro = false,
.CalibratedMag = false,
.Gravity = false,
.StepCounter = false,
.FingerPrint = false,
.LinearAccel = false,
.Gesture = false
}

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 Sat Jul 28 2018 21:51:59 by doxygen 1.8.8