Only the settings reply says the glasses are charging. Outside charging
mode it is polled every five minutes, and not at all while the display
is suspended, which it is once the glasses come off the face. So after
docking, the phone kept showing the glasses as "Not charging", and
charging mode (which pauses display traffic) didn't start until the
display woke or the link reconnected.
The case push that reports the glasses going from out of the case to
docked arrives within a second. It now schedules a battery read about
three seconds later. The drive loop queues it as a pending message,
which still goes out while the display is suspended.
Review fixes for the charging-case battery:
- The case reports whether the glasses are docked. An empty caseInfo
(the reply out of the case) now parses as "not docked, no level"
instead of nothing, and undocking is reported even when the level and
charge state are unchanged. TS keeps the last level but clears
caseCharging while the glasses are out of the case.
- The phone line shows the charging mark only while it is live: G2 and
Case only with a link to the glasses (connected or charging), and Case
only while docked. Levels stay as the last known ones.
- The session-start case read waits until the layout is up, so a
firmware that ignored it could no longer hold up the first frame. When
the glasses are already charging at connect, the charging-mode read is
the only one; the old duplicate read and its "late ACK" log are gone.
- Case dedup state resets on every connect, as wearState does, so each
session's read reaches TS.
- caseCharging uses > 0 like the headset, and is normalized to 0/1.
- iOS now feeds the reading into the shell battery state, and the
assistant's describeState includes the case level.
- The batteryLine accessors move above connectionStatusLabel's doc
comment.
A line under the mirror lists each device whose level is known, e.g.
"G2 100% · Case 98% ⚡ · R1 72%" (⚡ = charging), in portrait and
landscape. The case level joins the shell's battery state beside the
glasses and R1 (it is not drawn in the glasses' top bar) and reaches the
page through the dashboard snapshot. Like the glasses level it is kept
across disconnects: the case only reports while the glasses are docked
and only drains while charging them.
The glasses relay the charging case's state on UX_GLASSES_CASE_APP_ID
(sid 0x81): GlassesCaseDataPackage{commandId=CASE_INFO, magicRandom,
caseInfo{soc, chargeStatus, lidStatus, inCaseStatus, errorCode}}, the
schema in g2-kit-unofficial's glasses_case.proto. The Even app reads it
with an empty caseInfo (ProtoBaseSettings.getGlassesCaseInfo).
Observed on G2 2.3.0.24 / Faceclaw/38: while docked the right temple
pushes a GlassesCaseInfo (flag 0x01, its own magic) on every change --
docking, lid, USB, each 1% -- and answers a read with full data; out of
the case a read comes back with an empty caseInfo. Docking pushes
{inCaseStatus=1} before the level, and proto3 drops zero fields, so a
missing soc means no level rather than 0%.
So read it once at session start (docked glasses may be fully charged
and never enter charging mode) and again on entering charging mode,
which clears the queue; pushes carry every later change. Every 0x81
frame is taken as state in onNotification (pushes skip the ack path by
flag). New readings reach TypeScript through
FaceclawBleCommunicatorListener.onCaseState (level, case-charging), on
Android and iOS. Captured frames are tests.