class TIFlashHeader(TIComponent): (source)
Known subclasses: tivars.types.flash.TIApp, tivars.types.flash.TICertificate, tivars.types.flash.TILicense, tivars.types.flash.TIOperatingSystem
Constructor: TIFlashHeader(init, magic, revision, binary_format, ...)
Parser for flash headers
A flash file can contain up to three headers, though usually only one.
| Class | |
No class docstring; 3/3 properties, 0/1 class variable, 1/1 method documented |
| Class Method | get |
Determines the header's file extension given a targeted model |
| Class Method | get |
Gets the subclass corresponding to a type ID, type name, or file extension if one is registered |
| Class Method | open |
Creates a new header from a file given a filename |
| Static Method | next |
Helper function to determine the length of the next flash header in a bytestream |
| Method | __init__ |
Creates an empty flash header with specified meta and data values |
| Method | __len__ |
No summary |
| Method | binary |
Whether this flash header's data is in binary (0x00) or Intel (0x01) format |
| Method | bytes |
No summary |
| Method | calc |
The data stored in the flash header |
| Method | data |
The data stored in the flash header as either raw binary or Intel blocks |
| Method | date |
The date attached to the flash header as a 3-tuple |
| Method | device |
The (first) device targeted by the flash header |
| Method | devices |
The devices targeted by the flash header |
| Method | export |
Exports this header to a TIFlashFile with a specified name |
| Method | load |
Loads a byte string or bytestream into this header |
| Method | load |
Loads this header from a file given a file pointer and offset |
| Method | magic |
The file magic for the flash header |
| Method | name |
The name or basecode attached to the flash header |
| Method | object |
The object type of the flash header |
| Method | product |
The product ID for the header |
| Method | revision |
The revision of the flash header |
| Method | save |
Saves this header to the current directory given a filename and targeted model |
| Method | summary |
No summary |
| Method | type |
The (first) type ID of the flash header |
| Class Variable | extensions |
The file extension used for this header per-model |
| Instance Variable | raw |
Undocumented |
| Property | calc |
The length of the data stored in the flash header, measured in chars |
| Property | checksum |
The checksum for the flash header |
| Property | name |
The length of the name or basecode attached to the flash header |
| Method | __init |
Undocumented |
| Class Variable | _type |
Undocumented |
| Instance Variable | _has |
Undocumented |
Inherited from TIComponent:
| Class Method | get |
Converts bytes -> TIComponent |
| Class Method | register |
Registers a subtype with this class for coercion |
| Class Method | set |
Converts TIComponent -> bytes |
| Method | __bool__ |
No summary |
| Method | __bytes__ |
No summary |
| Method | __copy__ |
No summary |
| Method | __eq__ |
Determines if two components are the same type and have the same bytes |
| Method | __format__ |
Undocumented |
| Method | __str__ |
No summary |
| Method | clear |
Clears this component's data |
| Method | coerce |
Coerces this component to a subclass if possible using the component's type ID |
| Method | dict |
No summary |
| Method | json |
No summary |
| Method | load |
Loads this component from a JSON dictionary representation |
| Method | load |
Loads this component from a JSON dictionary representation |
| Method | load |
Loads this component from a string representation |
| Method | string |
No summary |
| Method | update |
Updates this component's metadata |
| Property | is |
Whether this component's data is empty |
| Class Variable | _type |
Undocumented |
Inherited from Dock (via TIComponent):
| Method | load |
Loads data into an instance by delegating to Loader methods based on the input's type |
| Class Variable | loaders |
Undocumented |
int = None, name: str = None, extension: str = None) -> type[ Self] | None:
(source)
¶
tivars.file.TIComponent.get_typeGets the subclass corresponding to a type ID, type name, or file extension if one is registered
| Parameters | |
typeint | The type ID to search by, or |
name:str | The type name to search by, or |
extension:str | The file extension to search by |
| Returns | |
type[ | A subclass of this component with corresponding type ID or extension, or None |
tivars.file.TIComponent.openCreates a new header from a file given a filename
| Parameters | |
filename:str | A filename to open |
| Returns | |
Self | The (first) header stored in the file |
str = '**TIFL**', revision: str = '0.0', binary_format: bool = False, object_type: int = 136, date: tuple[ int, int, int] = (str = 'UNNAMED', device_type: int | DeviceType = DeviceType.TI_83P, product_id: int = 0, data: bytes = b':00000001FF'):
(source)
¶
tivars.file.TIComponent.__init__Creates an empty flash header with specified meta and data values
| Parameters | |
| init | Values to initialize the header's data (defaults to None) |
magic:str | File magic at the start of the header (defaults to **TIFL**) |
revision:str | The header's revision number (defaults to 0.0) |
binarybool | Whether the header's data is stored in binary format (defaults to False) |
objectint | The header's object type (defaults to $88) |
date:tuple[ | The header's stored date as a tuple (dd, mm, yyyy) (defaults to null) |
name:str | The name of the headers (defaults to UNNAMED) |
deviceint | DeviceType | The device type of the header (defaults to $73, the 83+ series) |
productint | The targeted model's product ID (defaults to $00) |
data:bytes | The header's data (defaults to empty) |
tivars.file.TIComponent.calc_datativars.types.flash.TILicenseThe data stored in the flash header
tivars.file.TIComponent.dataThe data stored in the flash header as either raw binary or Intel blocks
If binary_flag == $01, the data is returned as list[TIFlashBlock]. Otherwise, the data is returned as bytes.
The devices targeted by the flash header
Each device is a (device_type, type_id) tuple. The type_id should be constant throughout. Only licenses may be expected to have more than one device.
Exports this header to a TIFlashFile with a specified name
| Parameters | |
name:str | The name of the flash file (defaults to this header's name) |
| Returns | |
TIFlashFile | A TIFlashFile containing this header |
tivars.file.TIComponent.load_bytesThe product ID for the header
While used to identify the model the var was created on, it has no actual functional ramifications. Furthermore, it does not constitute a 1-to-1 mapping to distinct models.
tivars.file.TIComponent.summarytivars.types.flash.TILicense| Returns | |
str | A text summary of this component |
tivars.types.flash.TIApp, tivars.types.flash.TICertificate, tivars.types.flash.TIOperatingSystemThe file extension used for this header per-model
The checksum for the flash header
This is equal to the lower 2 bytes of the sum of all bytes in the header.