Comments (7)
from xdripswift.
I think this comment is correct. The header is in front, which is the sensor serial number https://github.com/JohanDegraeve/xdripswift/blob/master/xdrip/Transmitter/CGMBluetoothTransmitter/Libre/Bubble/CGMBubbleTransmitter.swift#L170
the data is after the header : https://github.com/JohanDegraeve/xdripswift/blob/master/xdrip/Transmitter/CGMBluetoothTransmitter/Libre/Bubble/CGMBubbleTransmitter.swift#L193
ibreData: (rxBuffer.subdata(in: bubbleHeaderLength..<(344 + bubbleHeaderLength)))
from xdripswift.
The patchUID, the serial number is computed from, comes with the packet whose response type is 0xC0.
The patchInfo comes with the new packet whose response type is 0xC1.
Then comes the data packet, whose response type is 0x82 and whose length is 352 byte: 344 FRAM bytes plus 8 null footer bytes.
In the xDrip sources the constant 8 is called indeed BUBBLE_FOOTER:
https://github.com/NightscoutFoundation/xDrip/blob/b7bc355cea2128f72a4e09c82ce1d937e14c81e0/app/src/main/java/com/eveningoutpost/dexdrip/Models/Bubble.java#L52s
I tested all this thoroughly with https://gist.github.com/gui-dos/83fbd9b6f3a7dfe17b2dd77a59c8ddde
The comment says "added by Bubble in front of data that is received from Libre" but Bubble instead appends a trail at the end of the data that is received from Libre. The serial is sent separately in a packet 10 bytes long, the patchInfo is extracted from its 14 byte packet.
from xdripswift.
The packet which starts with 0xC0 is added to the rxBuffer, at that moment the rxBuffer is still empty
Then come several packets 0x82, these are being appended to the rxBuffer, which means after the first packet
https://github.com/JohanDegraeve/xdripswift/blob/master/xdrip/Transmitter/CGMBluetoothTransmitter/Libre/Bubble/CGMBubbleTransmitter.swift#L164
Once all packets are received, the full data is processed, starting by reading the serialnumber
https://github.com/JohanDegraeve/xdripswift/blob/master/xdrip/Transmitter/CGMBluetoothTransmitter/Libre/Bubble/CGMBubbleTransmitter.swift#L170 which is the first 8 bytes.
So i think the name and comment are correct
from xdripswift.
The newer firmwares are sending the 0xC0 patchUid packet, the 0xC1 patchInfo packet and the 0x82 data packets, in this sequence.
If you are going to accumulate also the patchInfo in the unified rxBuffer, you will have to change the bubbleHeaderLength constant. But are the patchUid and the PatchInfo really a "header"?
from xdripswift.
I haven't started yet with support of new firmware versions.
It's just the way it's coded. I could have processed packet 0xC0 immediately when receiving (ie decoding the sensor serial number). In that case the header length definition wouldn't be needed at all.
After all it's not a header indeed, as it's a seperate packet.
But I don't believe right now this comment or property name needs to be changed.
from xdripswift.
Unfortunately https://github.com/jizhongwen/xdripswift hasn't been updated since August even if on TestFlight there have been published more updated betas (https://testflight.apple.com/join/5DrayRKU). Curious to have a look to their implementation :).
from xdripswift.
Related Issues (20)
- Ss
- iOS 17 support HOT 8
- xDripswift
- Feature request - ability to toggle, or automatically switch to a 10 day sensor countdown for Dexcom Sensors.
- Loop integration / Spying on LibreTransmitter HOT 10
- there should a timeout period after stopping a sensor session in order for the command to be properly registered by the transmitter HOT 2
- Enhancement request: alarm/BG level reminder HOT 2
- Implement a “Contact Trick” to update BG as watchOS complication HOT 2
- Notifications Intervals not respected HOT 6
- Immediate Crash after setting to LibreLinkUp follower HOT 4
- Alarms don't work HOT 1
- Missing Readings Until xDrip is Closed and Re-Opened HOT 3
- LibreLink Up EU2 connection error HOT 3
- Build script HOT 1
- Dexcom connection loops and potential cause for battery drains HOT 68
- CarPlay - Application takes over audio source of the car in follower mode HOT 39
- Request for improvement: displaying IOB/COB from Nightscout on Apple watch HOT 1
- App sometimes hangs at fast rise HOT 7
- Libre readings jump from 0 to 20000
- watchkit storyboards in watchos 7.0 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xdripswift.