firmware merge requestshttps://git.flow3r.garden/card10/firmware/-/merge_requests2020-10-17T13:16:33Zhttps://git.flow3r.garden/card10/firmware/-/merge_requests/414SpO2 sensor improvements2020-10-17T13:16:33ZschneiderSpO2 sensor improvementsWhat is currently in master can only be viewed as broken. This branch is so much better that it should not be left out.
I've added a warning screen in the beginning to inform that it is for demonstration only and that the values are kno...What is currently in master can only be viewed as broken. This branch is so much better that it should not be left out.
I've added a warning screen in the beginning to inform that it is for demonstration only and that the values are known to be incorrect.v1.16rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/412change(exnostat): Don't try to differentiate between Google and Apple2020-10-13T22:52:37Zschneiderchange(exnostat): Don't try to differentiate between Google and AppleThis idea is assumed to be inaccurate at best. I've removed showing Google and Apple in the UI for now.This idea is assumed to be inaccurate at best. I've removed showing Google and Apple in the UI for now.v1.16https://git.flow3r.garden/card10/firmware/-/merge_requests/411fix(config): Clear config before reloading2020-10-14T16:50:46Zschneiderfix(config): Clear config before reloadingCloses #211Closes #211v1.16rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/410feat(main): Make g-watch the default watch face2020-10-14T15:45:15Zschneiderfeat(main): Make g-watch the default watch faceCloses https://git.card10.badge.events.ccc.de/card10/firmware/-/issues/209Closes https://git.card10.badge.events.ccc.de/card10/firmware/-/issues/209v1.16rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/409fix(bhi160): Allow to re-open the sensor from Python2020-10-14T15:34:41Zschneiderfix(bhi160): Allow to re-open the sensor from PythonCloses #210Closes #210v1.16rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/408fix(streams): Only print a single warning once a queue is full2020-10-14T15:36:50Zschneiderfix(streams): Only print a single warning once a queue is fullCloses #208Closes #208v1.16rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/407BLE: Show name of device which is connected / is trying to pair2020-10-15T05:44:58ZschneiderBLE: Show name of device which is connected / is trying to pairTries to read the device name of the central via the GAP Device Name characteristic. If there is a device name available, it will be shown on the screen. Even if it only becomes available at a later time during pairing.
This is how it l...Tries to read the device name of the central via the GAP Device Name characteristic. If there is a device name available, it will be shown on the screen. Even if it only becomes available at a later time during pairing.
This is how it looks now:
![IMG_20201013_201252](/uploads/4829d1c38dbdd69975f58996e7fd3062/IMG_20201013_201252.jpg)
![IMG_20201013_201316](/uploads/02e685de392a29c805097ba9dd76338d/IMG_20201013_201316.jpg)
![IMG_20201013_201440](/uploads/77eba1fcefcf682404378626072109f4/IMG_20201013_201440.jpg)
![IMG_20201013_201448](/uploads/5f386aa0b0a41d6f26652d7e0a582016/IMG_20201013_201448.jpg)
![IMG_20201013_201457](/uploads/168b639c9362c21381d1d04acb79002c/IMG_20201013_201457.jpg)
![IMG_20201013_201516](/uploads/53d4697e66b6e482aeb5723db4086a12/IMG_20201013_201516.jpg)v1.16rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/406Read date/time from iOS device2022-01-11T12:00:47ZschneiderRead date/time from iOS deviceThis implements reading date and time via the `Current Time Service` BLE service.
This service is offered by iOS devices and allows to read date, time, timezone and DST information from the central device. At the moment this is done whe...This implements reading date and time via the `Current Time Service` BLE service.
This service is offered by iOS devices and allows to read date, time, timezone and DST information from the central device. At the moment this is done when connecting the first time.
I've tested this with a very old iPad as I don't have access to an iPhone. The issue is that I had do disable almost all current security features to pair with the old iPad and I'm not convinced that the setting of `bleDiscCfg` is chosen correctly:
```c
/*! Configurable parameters for service and characteristic discovery */
static const appDiscCfg_t bleDiscCfg =
{
FALSE /*! TRUE to wait for a secure connection before initiating discovery */
};
```v1.16https://git.flow3r.garden/card10/firmware/-/merge_requests/405feat(ble): Always overwrite the oldest pairing2020-10-10T10:03:17Zschneiderfeat(ble): Always overwrite the oldest pairingGoal is to always overwrite the oldest pairing if there are no slots available anymore. Previously the device would always after power up start overwriting at the first pairing.Goal is to always overwrite the oldest pairing if there are no slots available anymore. Previously the device would always after power up start overwriting at the first pairing.v1.16rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/404feat(ble): Show the name of a successful pairing2020-10-08T17:18:48Zschneiderfeat(ble): Show the name of a successful pairingHelps to figure out what is happening and which file just got written to the file system. A later incarnation might try to read some more interesting information from the peer and present that.Helps to figure out what is happening and which file just got written to the file system. A later incarnation might try to read some more interesting information from the peer and present that.v1.16rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/403fix(ble): Use the term "pairing" in the UI2020-10-06T22:20:51Zschneiderfix(ble): Use the term "pairing" in the UIUser study: https://twitter.com/schne1der_/status/1310698476108476418User study: https://twitter.com/schne1der_/status/1310698476108476418v1.16rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/402New pairing database2020-10-06T08:34:40ZschneiderNew pairing databaseGoal is to write individual pairings (bonds) to separate file and have a more flexible file format. Currently all pairings (bonds) are stored in a single file (`pairings.bin`).
Goal is to store each pairing (bond) in a separate file in ...Goal is to write individual pairings (bonds) to separate file and have a more flexible file format. Currently all pairings (bonds) are stored in a single file (`pairings.bin`).
Goal is to store each pairing (bond) in a separate file in a `pairings/` directory, named `pairingN.bin` (with N being 1,2,3,...). Each file stores a list of TLVs and has the version of the file format as first byte.
What I still want to implement:
- [x] Remove `ble.txt` and `mac.txt` and use `card10.cfg` instead.
In the future I'd like to be able to read the other device's name after pairing and write that into the file so the user has an idea which device is represented by that pairing.v1.16rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/401Assorted fixes/cleanups2020-09-20T15:04:46Zrahixcard10@rahix.deAssorted fixes/cleanupsNothing controversial, just a few fixes to the build-system/docs-build.Nothing controversial, just a few fixes to the build-system/docs-build.v1.16schneiderschneiderhttps://git.flow3r.garden/card10/firmware/-/merge_requests/400Use CSPRNG for BTLE2020-09-20T14:57:55ZschneiderUse CSPRNG for BTLEA followup after merging https://git.card10.badge.events.ccc.de/card10/firmware/-/merge_requests/399:
This directs all calls from the BTLE stacks internal `BbBleDrvRand` to our `__wrap_BbBleDrvRand()` which forwards it to `epic_csprng_r...A followup after merging https://git.card10.badge.events.ccc.de/card10/firmware/-/merge_requests/399:
This directs all calls from the BTLE stacks internal `BbBleDrvRand` to our `__wrap_BbBleDrvRand()` which forwards it to `epic_csprng_read()`v1.16rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/399Add CSPRNG2020-09-20T10:49:08ZschneiderAdd CSPRNGTries to seed an AES-CTR based PRNG using the TRNG, RTC, SysTick and ADC.
It is not really a CSPRNG as revealing its state allows to compute all previous outputs (it has no forward secrecy). It also is only good up to a limited amount o...Tries to seed an AES-CTR based PRNG using the TRNG, RTC, SysTick and ADC.
It is not really a CSPRNG as revealing its state allows to compute all previous outputs (it has no forward secrecy). It also is only good up to a limited amount of randomness after seeding it. Fortuna for example does not use more than 1 MiB without reseeding such a construct. I guess that limit is set very conservative though.
I guess these two limitations (no forward secrecy and only a limited amount of strong randomness) is acceptable for us. Calls to the RNG seem to be very few and the device is usually power cycled often in comparison.
Seeding is done via a SHA256 over the following data:
- 256x 16 bytes from the TRNG. Amount of entropy is unknown.
- The current second and subsecond values from the RTC.
- Current value of the SysTick.
- 256x a 10 bit ADC reading. Maybe 1 bit of entropy per reading.
CSPRNG: https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator
FORTUNA: https://en.wikipedia.org/wiki/Fortuna_(PRNG)
Other potential options for a CSPRNG:
- https://github.com/smuellerDD/chacha20_drng
- https://www.silabs.com/documents/public/application-notes/AN0806.pdfv1.16rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/398fix(trng): Enable TRNG before every read2020-09-13T19:04:53Zschneiderfix(trng): Enable TRNG before every readThe BLE stack disables the TRNG every time it access it...The BLE stack disables the TRNG every time it access it...https://git.flow3r.garden/card10/firmware/-/merge_requests/397Update SDK to 0.2.1-122020-09-13T16:32:35ZschneiderUpdate SDK to 0.2.1-12Next try, superseding https://git.card10.badge.events.ccc.de/card10/firmware/-/merge_requests/372Next try, superseding https://git.card10.badge.events.ccc.de/card10/firmware/-/merge_requests/372https://git.flow3r.garden/card10/firmware/-/merge_requests/396Add G-Watch to preload2020-10-13T19:41:35ZschneiderAdd G-Watch to preloadThis adds [G-Watch](https://badge.team/projects/g_watch) with permission from royrobotiks to the preload.
I've added a small modification to drop the current consumption (with the display off) from 11.5 mA to 7.7 mA at 3.8 V.
As a comp...This adds [G-Watch](https://badge.team/projects/g_watch) with permission from royrobotiks to the preload.
I've added a small modification to drop the current consumption (with the display off) from 11.5 mA to 7.7 mA at 3.8 V.
As a comparison: The default analog clock consumes 14.3 mA at 3.8 V.rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/395fix(ble): Reduce scope of cricitcal section when initializing2020-09-04T17:13:04Zschneiderfix(ble): Reduce scope of cricitcal section when initializingCloses #203Closes #203schneiderschneiderhttps://git.flow3r.garden/card10/firmware/-/merge_requests/394Update CHANGELOG and Documentation2020-09-19T08:00:43Zrahixcard10@rahix.deUpdate CHANGELOG and DocumentationI've added all changes since 1.15 to the changelog, except all the BLE stuff. I'm not too sure what all the things were that have changed, so @schneider, if you can give me a rough list, I'll integrate them here as well.I've added all changes since 1.15 to the changelog, except all the BLE stuff. I'm not too sure what all the things were that have changed, so @schneider, if you can give me a rough list, I'll integrate them here as well.v1.16schneiderschneider