Skip to content

The ITU BLE Service that will connect, collect and post measurements from sensors

License

Notifications You must be signed in to change notification settings

EnergyFutures/ITUBleService

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ITUBleService

The ITU BLE Service that will connect, collect and post measurements from sensors.

Android min. 4.3 is required due to Bluetooth 4.0 requirements

This is a proof of concept with some values hardcoded for now

The threading is not optimized

It is an android service that will auto start on boot, and is marked as STICKY (auto restart by system).

Service does the following:

  • Loop the following: Start a BLE scan, sleep 5 min, stop the scan, sleep 25 min

  • For each device found advertising

The below is done once on device connect*

-- If device name includes "ITU" then connect to it. This is mainly to the bug in filtered scanning

-- Start a service discovery

-- For each ITU SERVICE found in discovery

--- Change the config characteristic to: Show id + value

--- Ask for notifications of the value characteristic

The below is the basic loop*

  • On each notification save the measurement

  • If measurements count is more than 100, post for each id the measurements to SMAP, and empty list

Batched post packages are used to minimize the conflicts between the WIFI and BT

Thread pooling is used for worker tasks

About

The ITU BLE Service that will connect, collect and post measurements from sensors

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages