{"id":23646452,"url":"https://github.com/francescogabbrielli/beacons","last_synced_at":"2026-05-19T14:05:05.865Z","repository":{"id":120467328,"uuid":"77834312","full_name":"francescogabbrielli/beacons","owner":"francescogabbrielli","description":"Android Prototype: Beacons/Bluetooth LE Sensors Tracker","archived":false,"fork":false,"pushed_at":"2017-05-01T15:10:54.000Z","size":3005,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-18T17:13:18.809Z","etag":null,"topics":["android","beacon","bluetooth-low-energy","eddystone","temperature-monitoring"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/francescogabbrielli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-02T13:11:32.000Z","updated_at":"2018-02-26T01:55:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"eb07050f-dbb1-4b6c-8b97-793f3a1162cc","html_url":"https://github.com/francescogabbrielli/beacons","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/francescogabbrielli/beacons","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francescogabbrielli%2Fbeacons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francescogabbrielli%2Fbeacons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francescogabbrielli%2Fbeacons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francescogabbrielli%2Fbeacons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/francescogabbrielli","download_url":"https://codeload.github.com/francescogabbrielli/beacons/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francescogabbrielli%2Fbeacons/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33219395,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-19T07:54:09.561Z","status":"ssl_error","status_checked_at":"2026-05-19T07:54:08.508Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","beacon","bluetooth-low-energy","eddystone","temperature-monitoring"],"created_at":"2024-12-28T13:35:25.283Z","updated_at":"2026-05-19T14:05:05.836Z","avatar_url":"https://github.com/francescogabbrielli.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Beacons Transponder\n   \t\t\t\t\t\t\t\t\n## 0. Definitions\n\n- **App**: the app running on a smartphone\n\n- **DataManager**: a component of the app that will record the data for each device\n\tand take care of transmitting them to the central repository (server)\n\twhen the network is available;\n\tis also responsible for activating alerts and send real time notifications\n\tto the user\n\t\n- **Device**: a bluetooth low energy (BLE) device with sensors and data logger\n\n- **Server**: database and backend engine\n\n- **TransferService**: is a component running in a thread both in the DataManager and \n\tthe GATT connection managing client/server data interchange when a connection is\n\testablished:\n\n\t\tCLIENT                                  SERVER\n\t\t---*---------------------------------------*--\n\t\t   |                                       |\n\t\t   |[Send last data]\u003e\u003e--------------------\u003e|\n\t\t   |                                       |\n\t\t   |                                       | 1. Data received (trigger actions)\n\t\t   |                                       | 2. Store\n\t\t   |                                       |\n\t\t   |\u003c----------------------\u003c\u003c[Send confirm]|\n\t\t   |                                       |\n\t\t   | 1. Remove Data*                       |\n\t\t   | 2. Update pointer to last data        |\n\t\t   |                                       |\n\n\t\t* the data removed is not necessarily the last one, to allow a recent data \n\t\t  buffer on the client\n\n\tIf a connection is not available, data is stored in the client buffer queue\n\t(or whatever acts as one).\n\n\tIn case of multiple data available to send, grouping and compression techniques\n\tmight be used.\n\n\tIn this proejct there are two transfer services that work in a chain, linked through \n\tthe smartphone: the first client is the device and the server is the smartphone \n\tapp (GATT connection background server); the second client is the smartphone app\n\t(DataManager) and the server is the remote repository\n\n\n## 1. When the app is installed\n\nA background service will start whenever the bluetooth is turned on\n\nThe purpose of the service is to discover bluetooth devices and, if they are managed by the current\nuser/shipment, to connect to them establishing bidirectional GATT interaction\n\n\tDevice                        Smartphone                         Server\n\t---*-------------------------------*--------------------------------*--\n\t   |\u003c----------\u003c\u003c[Discover devices]|                                |\n\t   |                               |                                |\n\t   |[Discovered]\u003e\u003e----------------\u003e|                                |\n\t   |                               | Updated info?                  |\n\t   |                               | |_NO_\u003e[Query managed]\u003e\u003e-------\u003e|\n\t   |                               |                                | Query DB\n\t   |                               |\u003c---------------\u003c\u003c[Managed info]|\n\t   |                               | Is Managed?                    |\n\t   |\u003c-------------------\u003c\u003c[Connect]|\u003c|_YES_                         |\n\t   |                               | |_NO__\u003e[no action]             |\n\t   |[Connected]\u003e\u003e-----------------\u003e|                                |\n\t   |                               | SEE §2                         |\n\t   |[Disconnected]\u003e\u003e--------------\u003e|                                |\n\t   |                               | SEE §3                         |\n\n\n## 2. When a device connection is established\n\n1. **a new GATT callback is created**\n\n\tThe GATT callback will register for notifications and manage interaction displaying the updated \n\tdata/reading from the device sensors. The data is sent to the DataManager with extra information\n\tgathered from the smartphone (like position from GPS, time, etc...)\n\n2. **a background service is started to extract data from the data logger**\n\n\tIt will begin from the pointer to the last data extracted and send it to the DataManager \n\t(without additioanl info) and update the pointer to last data. It will also attempt to remove\n\textracted data from the device. This service is very similar to the service present in the DataManager\n\t(*see __§0__*)\n\n          APP UI                         EXECUTOR                      GATT SERVICE             CALLBACK THREAD\n        ====*==============================*=================================*========================*===========\n            |                              .                                 .                        .\n            | disconnected                 .                                 .                        .\n            *\u003e\u003e--------[Connect]-------------------------------------------\u003e\u003e+                        .\n            .                              .                                 |                        .\n            .                              .                                 +\u003e\u003e---[OnConnection]---\u003e\u003e+\n            .                              .                                 .                        | connected\n            *\u003c\u003c-------------------------------------[FireConnected]---------------------------------\u003c\u003c+\n            .                              .                                 .                        |\n            .                              .                                 *\u003c\u003c----[Discover]------\u003c\u003c+\n            .                              .                                 |                        .\n            .                              .                                 *\u003e\u003e----[OnDiscover]----\u003e\u003e*\n            .                              .                                 .                        | services ok\n            .                              .                                 *\u003c\u003c---(Check PW)-------\u003c\u003c*\n            .                              .                                 |                        .\n        .....................................................................|......................................\n            .                              .                                 |                        .\n            . \u003cif discovered\u003e              .              .                  |                        .\n            *\u003e\u003e-------[Check password]-------------------------------------\u003e\u003e*                        .\n            .                              .                                 |                        .\n            .                              .                                 *\u003e\u003e----[OnWriteCh]-----\u003e\u003e*\n            .                              .                                 .                        | password set\n            .                              *\u003c\u003c-------------------------------------(ReadCfg)--------\u003c\u003c+\n            .                              |                                 .                        | wrong pw\n            *\u003c\u003c----------------------------+--------[FireError]-------------------------------------\u003c\u003c*\n            .                              |                                 .                        .\n        ...................................|........................................................................\n            .                              |                                 .                        .\n            . \u003cif password\u003e                |                                 .                        .\n            *\u003e\u003e----[ReadCfg]-------------\u003e\u003e*                                 .                        .\n            .                              |                                 .                        .\n            .                            +\u003e*\u003e\u003e-------[ReadCh]--------------\u003e\u003e*                        .\n            .\u003c\u003c-------[Progress]-------\u003c\u003c| .                                 |                        .\n            .                            |-next                              |                        .\n            *\u003e---------[Cancel]---------\u003e| .                                 *\u003e\u003e----[OnReadCh]------\u003e\u003e*\n            .\u003c----[ProcessCanceled]-----\u003c| .                                 .                        |\n            .                            +\u003c*\u003c\u003c-----------------------[Notify]-----------------------\u003c\u003c*\n            .                              |                                 .                        .\n            *\u003c\u003c-----[ProcessComplete]----\u003c\u003c*                                 .                        .\n            .                              .                                 .                        .\n        ............................................................................................................\n            .                              .                                 .                        .\n            *\u003e\u003e----[Weak disconnect]-----\u003e\u003e*                                 .                        .\n            .                              |                                 .                        .\n            *\u003e---------[Cancel]-----------\u003e|                                 .                        .\n            .\u003c------[ProcessCanceled]-----\u003c|                                 .                        .\n            .                              |                                 .                        .\n            *\u003c\u003c---[Condition not met]----\u003c\u003c*\u003e\u003e--------[Disconnect]---------\u003e\u003e*                        .\n            .                              .                                 |                        .\n            *\u003e\u003e-------[Disconnect]-----------------------------------------\u003e\u003e*                        .\n            .                              .                                 |                        .\n            .                              .                                 *\u003e\u003e--[OnDisconnection]-\u003e\u003e*\n            .                              .                                 .                        | disconnected\n            *\u003c\u003c-----------------------------------[FireDisconnected]--------------------------------\u003c\u003c*\n            .                              .                                 .                        .\n        ............................................................................................................\n\n\n## 3. When the device disconnects\n\n- Both the DataManager and the GATT data logger service are stopped istantaneously\n- Connection/Disconnection status is treated like other data and sent to the server\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrancescogabbrielli%2Fbeacons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrancescogabbrielli%2Fbeacons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrancescogabbrielli%2Fbeacons/lists"}