For the KIT module "Mobile Computing and Internet of Things" (https://teco.edu/education-mociot/), we got the exercises to build a creative mobile app for Cosinuss° One sensors based on https://github.com/teco-kit/cosinuss-flutter. I got the idea to build an app that detects when you fall asleep and wakes you up so that you stay awake in early lectures.
My Bluetooth LE part for comminucating with the sensor can be found here: https://github.com/cadivus/cosinuss-flutter-lib-with-emulator/ and is used for this project. The other repository contains an emulator for Cosinuss° One.
For using the emulator, you have to start your application with
flutter run --dart-define=COSINUSS_EMULATOR_MODE=true
or
flutter run --dart-define=COSINUSS_EMULATOR_MODE=true --dart-define=COSINUSS_EMULATOR_HOST=your-host
The emulator UI can be found here: https://github.com/cadivus/cosinuss-flutter-lib-with-emulator/tree/main/cosinuss_emulator
Your phone will begin to vibrate and show a pulsating alarm clock you have to press.
The thresholds for sleep detections can be changed and the new settings will be saved to your phone.