ui: the Data Connection event gains the date-time object; the "more" flag is precise

- The 0x1D event form now offers the Date-Time and Time zone object
  (TS 102 223 8.39): an optional select that includes the host clock's
  date-time, built by eventDateTimeTlv() as seven semi-octet BCD bytes in the
  TS 23.040 9.2.3.11 order (units high, tens low) with the time zone in
  quarters of an hour and its sign in bit 3 of the first semi-octet.
- The Cards list's empty-state colspan is 8 now (the table has had 8 columns
  since the keyset refactor, not 10).
- The expanded-registry "(first page only)" note marks only an unfulfilled
  6310: ramExpandedMore() keeps the promise set when the follow-up page was
  refused/failed or the page cap stopped the paging, and clears it when an
  accepted page ended the listing (a completed multi-page listing was
  annotated wrongly before).

Tests: eventDateTimeTlv (fixed dates, both timezone signs), the 0x1D build
with and without the date-time, and ramExpandedMore's cases.  Help EN/RU and
both AGENTS files; sw cache simple-v347.
This commit is contained in:
2026-10-01 22:07:24 +03:00
parent 0cccd62230
commit 994ee6d2a3
6 changed files with 76 additions and 7 deletions
+25
View File
@@ -124,3 +124,28 @@ test('the access technology options follow the pinned 8.61 coding', () => {
assert.strictEqual(opts[10].l, 'NG-RAN');
assert.strictEqual(opts[12].l, 'Satellite E-UTRAN');
});
test('eventDateTimeTlv builds the 8.39 date-time object', () => {
const d = o => ({
getFullYear: () => o.year, getMonth: () => o.month - 1, getDate: () => o.day,
getHours: () => o.hour, getMinutes: () => o.min, getSeconds: () => o.sec,
getTimezoneOffset: () => o.tzMin,
});
// UTC+3, 2026-09-30 21:55:00 -> swapped BCD + 12 quarters
assert.strictEqual(
eventDateTimeTlv(d({ year: 2026, month: 9, day: 30, hour: 21, min: 55, sec: 0, tzMin: -180 })),
'260762900312550021');
// UTC-2:30 -> 10 quarters with the sign bit (bit 3 of the first semi-octet)
assert.strictEqual(
eventDateTimeTlv(d({ year: 2026, month: 1, day: 5, hour: 8, min: 7, sec: 9, tzMin: 150 })),
'260762105080709009');
});
test('the data connection event can carry the current date-time', () => {
const build = EVENT_FORMS[0x1D].build;
assert.match(build({ status: '0', type: '0', ti: '00', loc_status: '0', datetime: 'now' }),
/^9D0100AA01001C01002607[0-9A-F]{14}9B0100$/);
// left out by default
assert.strictEqual(build({ status: '0', type: '0', ti: '00', loc_status: '0' }),
'9D0100AA01001C01009B0100');
});
+14 -1
View File
@@ -25,7 +25,7 @@ function extractFunc(src, name) {
const FNS = ['berLenStr', 'buildApdu', 'escHtml', 'esc', 'chainInit', 'chainRamBuildRowHex', 'ramFmtLifecycle', 'ramFmtVersion', 'ramMenuState', 'ramEntryKind', 'ramMenuHtml', 'ramRawTlvsHtml', 'ramNvLine', 'ramFmtPrivileges', 'ramRenderExploreHtml', 'ramMergeExpanded', 'ramStepLine', 'ramStepComponents', 'ramInstallFailHint', 'ramProbeParse', 'ramCompatVerdict', 'ramCompatProbeNote', 'ramCompatImportRows', 'ramCompatRowsHtml', 'ramCompatFailureHtml', 'ramCompatDetailHtml', 'lookupSw', 'ramExpandedDetailsInit', 'ramExpandedDetailsChanged', 'ramGetStatusApdu', 'ramDeleteApdu',
'stkParamsBuild', 'ramRemoteSwOk', 'spPorAccepted', 'ramIncrementCntr', 'ramDeleteFromExplorer', 'ramListingSpi2', 'ramRemoveFromExplorer', 'ramHasInstance', 'ramExpandedQueryApdu',
'_parseRawElfEntry', '_parseRawAppEntry', 'ramParseElfStatus', 'ramParseAppStatus', 'ramParseModuleAids', 'parseTLV', '_parseE3Entry', '_parseMenuEntries',
'ramExpandedReport', 'ramExpandedTags', 'ramExpandedGroups', 'ramExpandedElfForm', 'ramElfVersionHint', 'ramChainGetResponse', 'ramDeriveElfVersions', 'ramElfAppletCandidate',
'ramExpandedReport', 'ramExpandedMore', 'ramExpandedTags', 'ramExpandedGroups', 'ramExpandedElfForm', 'ramElfVersionHint', 'ramChainGetResponse', 'ramDeriveElfVersions', 'ramElfAppletCandidate',
'spCntrLow', 'ramCntrLowHtml', 'ramCntrLowPresetIdx', 'ramShowCntrLow',
'spKeysetKvnOf', 'spKeysetList', 'spKeysetFor', 'spKeysetCheck',
'spKeysetOptionsHtml', 'spPresetIdx', 'tarPresetIdx',
@@ -1489,3 +1489,16 @@ test('SIM toolkit mode hides the UICC file-access row', () => {
assert.ok(src.includes('rc-tk-access-row'),
'the access row must follow the CA/EA visibility');
});
test('ramExpandedMore marks only an unfulfilled 6310', () => {
// no promise -> nothing to report
assert.strictEqual(ramExpandedMore(false, '9000', 1), false);
// the follow-up page was accepted and ended the listing
assert.strictEqual(ramExpandedMore(true, '9000', 2), false);
// the follow-up page was refused
assert.strictEqual(ramExpandedMore(true, '6A86', 2), true);
// the page cap stopped the paging
assert.strictEqual(ramExpandedMore(true, '6310', 8), true);
// a transport failure (no remote status word) leaves it unfulfilled
assert.strictEqual(ramExpandedMore(true, 'index out of range', 2), true);
});