Skip to content

si48github/mx-ble-widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

mx-ble-widget

Add a widget to scan and connect to your BLE devices from a Mendix application.

Widget built for TI CC2650 SensorTag.

Requires PhoneGap plugin cordova-plugin-ble-central in your hybrid mobile Mendix application configuration.

Follow instructions at https://docs.mendix.com/howto/mobile/ to deploy your hybrid mobile application.

Thanks to Don Coleman (https://github.com/don) for the code and tutorials available at https://github.com/don/phonegap-ble-workshop

Watch the demo at https://youtu.be/eLvtzRvMy40

Installation

  1. Install the widget in your project
  2. Include the ScanBLE widget in a context wrapper (i.e. Data Grid, List view) on a page. Include the ConnectBLE widget in the context for the 'Scanned Device Types' entity.
  3. Create entities to store device types, scanned devices and device data.
  • Entity: AllowedDeviceTypes

    • Attributes: deviceType , String
      • Purpose: Provide a comma separated list of device type ids to limit the devices to be scanned.
      The widget does not currently use this value. It is hardcoded to look for TI CC2650 sensors
  • Entity: ScannedDevices

    • Attributes:
      • deviceID, String
      • deviceName, String
      • deviceType, String
      • deviceMfgData, String , unlimited
  • Entity: DeviceData

    • Attributes:
      • deviceID, String
      • deviceType, String
      • characteristicUUID, String
      • characteristicName, String
      • dataValue, String
      • dataUnits, String
  1. Configure the widget's settings: ScanBLE

    1. On the Input tab, Configure:
      1. 'BLE Device Types' : set to the deviceType field of the enclosing AllowedDeviceTypes
      2. 'Scan Time (seconds)': set to an integer value
    2. On the Output tab, Configure:
      1. 'Object to Create' : set to 'ScannedDevices' entity
      2. Map entity fields
    3. On the Button tab, Configure:
      1. 'Button Label'
      2. 'Button Class' : optional

    ConnectBLE

    1. On the Input tab, Configure:

      1. 'BLE Device ID' : set to the deviceID field of the enclosing ScannedDevices entity
    2. On the Device Data tab, Configure:

      1. 'Object to Create' : set to 'DeviceData' entity
      2. Map entity fields

Typical usage scenario

Known Limitations

Only scans TI CC2650 sensors.

Based on the Mendix Widget Boilerplate

See AppStoreWidgetBoilerplate for an example

About

Add a widget to scan and connect to your BLE devices from a Mendix application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published