fix(app-image): remove customDescRawBytes re-added by merge
The customDescRawBytes field was intentionally removed (replaced by the HexDump visual viewer). The merge accidentally re-introduced it from the standalone branch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8d5d05dff0
commit
107e67bea4
|
|
@ -16,12 +16,6 @@ export const APP_DESC_MAGIC = 0xABCD5432;
|
|||
/** Size of esp_app_desc_t structure */
|
||||
export const APP_DESC_SIZE = 256;
|
||||
|
||||
/** Offset of custom app desc within first segment data (immediately after esp_app_desc_t) */
|
||||
export const CUSTOM_DESC_OFFSET_IN_SEGMENT = APP_DESC_SIZE; // 256
|
||||
|
||||
/** How many raw bytes to extract for the custom app desc dump */
|
||||
export const CUSTOM_DESC_DUMP_SIZE = 64;
|
||||
|
||||
/** Chip ID to human-readable name */
|
||||
export const CHIP_ID_NAMES: Record<number, string> = {
|
||||
0x0000: 'ESP32',
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import type {
|
|||
import {
|
||||
IMAGE_MAGIC, IMAGE_HEADER_SIZE, EXTENDED_HEADER_SIZE,
|
||||
SEGMENT_HEADER_SIZE, APP_DESC_MAGIC, APP_DESC_SIZE, CHIP_ID_NAMES,
|
||||
CUSTOM_DESC_OFFSET_IN_SEGMENT, CUSTOM_DESC_DUMP_SIZE,
|
||||
} from './constants';
|
||||
|
||||
/**
|
||||
|
|
@ -94,21 +93,11 @@ export function parseAppImage(data: Uint8Array): AppImageInfo {
|
|||
}
|
||||
}
|
||||
|
||||
// ── Custom App Description — fixed offset in first segment ──
|
||||
let customDescRawBytes: Uint8Array | null = null;
|
||||
if (segDataOffsets.length > 0) {
|
||||
const customOff = segDataOffsets[0] + CUSTOM_DESC_OFFSET_IN_SEGMENT;
|
||||
if (customOff + CUSTOM_DESC_DUMP_SIZE <= data.length) {
|
||||
customDescRawBytes = new Uint8Array(data.subarray(customOff, customOff + CUSTOM_DESC_DUMP_SIZE));
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
header,
|
||||
extendedHeader,
|
||||
segments,
|
||||
appDescription,
|
||||
customDescRawBytes,
|
||||
valid: segments.length === segmentCount, // false if image was truncated mid-segment
|
||||
chipName: CHIP_ID_NAMES[chipId] ?? `Unknown (0x${chipId.toString(16)})`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -63,8 +63,6 @@ export interface AppImageInfo {
|
|||
extendedHeader: ExtendedHeader;
|
||||
segments: SegmentHeader[];
|
||||
appDescription: AppDescription | null;
|
||||
/** Raw bytes at the custom app desc location (null if first segment too short) */
|
||||
customDescRawBytes: Uint8Array | null;
|
||||
valid: boolean;
|
||||
chipName: string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue