Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readRaw() and writeRaw() not supported by the Libre 2 #3

Closed
gui-dos opened this issue Oct 3, 2021 · 7 comments
Closed

readRaw() and writeRaw() not supported by the Libre 2 #3

gui-dos opened this issue Oct 3, 2021 · 7 comments

Comments

@gui-dos
Copy link
Contributor

gui-dos commented Oct 3, 2021

The custom NFC commands A3 and A4 to read from any 16-bit address and to gain write access to the FRAM are not supported by the Libre 2.

The overhead introduced by the nested handlers at https://github.com/creepymonster/LibreDirectApp/blob/d1a94370ed8465234d967729fea277df121cc665/LibreDirectLibrary/Modules/Libre2/Libre2PairingService.swift#L95-L97 can be therefore avoided.

@creepymonster
Copy link
Owner

Hi gui-dos, thanks for your message. I will look at your tip tomorrow and adjust and test the code. The customization sounds fine and would make the code more readable. I would like to make the code more readable again for the Libre2 in the near future and this would be a first step.

Many greetings

@creepymonster
Copy link
Owner

Hi gui-dos, thanks for your message. I will look at your tip tomorrow and adjust and test the code. The customization sounds fine and would make the code more readable. I would like to make the code more readable again for the Libre2 in the near future and this would be a first step.

Many greetings

Hi gui-dos, I implemented your recommendation and it works wonderfully. Thanks a lot :)

@creepymonster
Copy link
Owner

creepymonster commented Oct 4, 2021

I rewrote my NFC.swift class by using async / await and gathered the Libre 1 “hacks” in the separate NFCTools. The code is still messy and I still have to solve all the warnings caused by the new Actors isolations...

May I ask you whether you already tried to support scanning the sensor to retrieve manually the last 8-hour data and to integrate the new Swift 5.5 Tasks in your Redux custom implementation?

I'm eagerly following your adjustments in the NFC class. I think async/await will improve the readability by a lot - I will look the next few evenings.

I had already thought about the 8 hours of data, but I didn't tackle the issue to avoid the problem of duplicate data (with small differences, maybe not exactly the same data) being uploaded to Nightscout.

@creepymonster
Copy link
Owner

I rewrote my NFC.swift class by using async / await and gathered the Libre 1 “hacks” in the separate NFCTools. The code is still messy and I still have to solve all the warnings caused by the new Actors isolations...

May I ask you whether you already tried to support scanning the sensor to retrieve manually the last 8-hour data and to integrate the new Swift 5.5 Tasks in your Redux custom implementation?

I must say that the 8-hour values have often bothered me in the past with Diabox. For example, when switching from xdripswift to Diabox, I had two curves over the last few hours in my Nightscout.

@creepymonster
Copy link
Owner

I had also seen your hint at xdripswift where it was about rawValue == 0. I have logged that at least. I had fortunately exactly at the time the problem that I got only 0 values from my sensor (connected but no more values through the 0 filter).

WORK_VOLTAGE, SENSOR_SIGNAL_LOW

@creepymonster
Copy link
Owner

creepymonster commented Oct 5, 2021

You are absolutely right - grrr, only the first lines in the eye had and the last lines carelessly numbered through.

INVALID_DATA = 32768 is not 1 << 12 but 1 << 15

Thanks gui-dos - I will correct the error.

@creepymonster
Copy link
Owner

I rewrote my NFC.swift class by using async / await and gathered the Libre 1 “hacks” in the separate NFCTools. The code is still messy and I still have to solve all the warnings caused by the new Actors isolations...

May I ask you whether you already tried to support scanning the sensor to retrieve manually the last 8-hour data and to integrate the new Swift 5.5 Tasks in your Redux custom implementation?

I tried the NFC scan once with async/await. Actually looks quite good and works quite well in my tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants