EF resolver: resolve by (DF, FID); split EF.ECC and EF.AD per DF

The decoder/encoder lookup now takes an optional DF context and resolves
DF-first, then name, then FID (the spec keys files by FID within their
DF; the name is a display label).  efDfFromPath derives the parent DF
segment of a canonical path.

EF.ECC is split into its two DF-specific decoders: DF.GSM (7F20)
transparent 3n (existing) and ADF.USIM linear-fixed X+4 - the new
efDecEccUsim reads the 3-byte Emergency Call Code, the Annex A alpha and
the Emergency Service Category (decoded per TS 24.008 Table 10.5.135d).
EF.AD is registered as DF-keyed entries (7F20 / ADF.USIM / ADF.ISIM),
reusing the existing encoder.

The df is threaded through the file-manager decoded-view/edit/save and
the snapshot/compare decode.  No ECC editor yet (read-only).

Frontend 1081 + Python 1090 tests green.
This commit is contained in:
catarrh committed 2026-10-25 12:40:51 +03:00
1 parent 6d762b9d9c
commit 8e0a97f025
5 files changed
+247 -36

No files matched your search

+14 -1
View File
@@ -52,7 +52,7 @@ const FNS = [
'efDecRecordsHtml', 'efDecEditHtml',
'efDecCollectValues', 'efDecCollectRows', 'efDecCollectItems',
'efBitsSelected', 'pysimFsDecBitsFilter', 'pysimFsDecRowCheck', 'pysimFsDecItemTag', 'pysimFsDecAddItem',
'pysimFsDecRemoveItem', 'pysimFsFindNode',
'pysimFsDecRemoveItem', 'pysimFsFindNode', 'pysimFsNodePath', 'efDfFromPath',
'pysimFsHasDecoder', 'pysimFsHasEncoder', 'pysimFsDecSave', 'pysimFsDecEdit',
'pysimFsPillsEnabled', 'pysimFsSyncContentVisibility', 'gsm7Decode',
'gsm7TextToSeptets', 'gsm7Encode',
@@ -271,6 +271,19 @@ test('pysimFsHasEncoder resolves the selected file by name or FID', () => {
assert.strictEqual(pysimFsHasEncoder(), false);
});
test('the file-manager resolver call sites pass the node\'s parent DF', () => {
// the DF context comes from the node's canonical path; these five sites
// gate/read/edit a selected file and must resolve the same entry
assert.ok(html.includes('return !!efFindDecoder(node && node.name, fid, df);'));
assert.ok(html.includes('return !!efFindEncoder(node && node.name, fid, df);'));
assert.ok(html.includes("const df = node ? efDfFromPath(pysimFsNodePath(node)) : '';"));
assert.ok(html.includes('const model = efDecEditModel(node && node.name, fid, content,'));
for (const fn of ['pysimFsDecSave', 'pysimFsDecAddRow', 'pysimFsDecAddItem']) {
assert.ok(/efFindEncoder\([^;]*efDfFromPath\(pysimFsNodePath\(node\)\)/s.test(extractFunc(html, fn)),
fn + ' resolves the entry with the node DF');
}
});
test('the Edit decoded button is encoder-gated next to Edit raw', () => {
const btn = /<button[^>]*id="pysim-fs-edit-dec-btn"[^>]*>/.exec(html);
assert.ok(btn, 'Edit decoded button');