khoitd1997 / hypnos

Module embedded inside user's laptop to "remind" them to take break and sleep
0 stars 0 forks source link

hypnos

Module embedded inside users' laptop to "remind" them to take break and sleep

Background

I used to have a script that runs every couple hours to turn the computer off to remind me to take a break. However, that script can be easily bypassed and it's not cross-platform. Embedding hypnos into the motherboard of my laptop and enabling tamperproof protection in the BIOS for the case make it much harder to bypass.

Features

Custom GATT

The custom service is called the Timetable Service. Base and other UUIDs are taken here:

// base is f364adc9-b000-4042-ba50-05ca45bf8abc
#define UUID_SERVICE 0x1400

To store an hour:minute info, needs 11 bits(5 for hour, 6(least significant) for minute) for 24-hour format. All timing is stored that way except for the current time service.

All times are in GMT.

All would require authentication to read/write

UUID Type Data Type Range
0x1401 MORNING_CURFEW_END time type 24-hour format
0x1402 NIGHT_CURFEW_START time type 24-hour format
0x1403 WORK_DURATION_MINUTE uint8 30-120
0x1404 BREAK_DURATION_MINUTE uint8 5-15
0x1405 ACTIVE_EXCEPTIONS list of pair unix time 0-4 exceptions
0x1406 TOKENS_LEFT uint8 depend on policy implementation
0x1407 CURRENT_UNIX_TIME uint32 until saturation

Max of 4 exceptions can be active at one time

References

BLE Chips Power Consumption Picking Advertising Interval

Current Time Service