Timex M851 Watch User Manual


 
M851 WristApp Design Guide Rev 1.2
Timex Corporation 79
DB_READ_RECORD_WITHOFFSET_RANDOMVAR
For double linked list record manipulation:
DB_LOCATE_INSERTION_BYSIZE_LINKLIST
DB_REMOVE_RECORD_LINKLIST
DB_INSERT_RECORD_LINKLIST
To determine the absolute address in EEPROM where a record is located:
DB_GET_ABSOLUTE_ADDRESS_OF_RECORD_RANDOMVAR
DB_GET_ABSOLUTE_ADDRESS_OF_RECORD_RANDOMFIX
4.26.3 Opening and Closing a Database
Executing the macro DB_OPEN_FILE opens a database file for read or write access. It also powers up
the EEPROM. The macro also sets up database specific variables so it can properly execute the macros
provided to access the different type of database structures.
It is required that when the database access has been completed during state execution, it should call the
macro DB_CLOSE_FILE to power down the EEPROM.
4.26.4 Upload and Download of Database
When a database is downloaded by the PC to the watch, the database is contains all the information
required by an application using the database in the Application Specific Header Block.
When a download is complete, the kernel will execute the applications Resource Handler with the event
COREEVENT_INIT. This gives the application the opportunity to check the database being downloaded.
Since the information in the Application Specific Header Block is the information that the application
requires in the ASD, it can copy the information from the database into the ASD through the macro:
DB_READ_APPLICATION_INFOHEADER
The application will use the data now present in the ASD for database manipulation and access.
When a database upload is required by the PC, the kernel will execute the Resource Handler of the database
owner with the event COREEVENT_UPDATEDATABASEHEADER. This will copy ASD data specific to
the database. This allows the PC to interpret the database. The application can use the macro to upload
ASD data to the database header.
DB_WRITE_APPLICATION_INFOHEADER
4.26.5 PC Synchronization of Watch Data
The PC software requires status flags of the database and the record for synchronization purposes.
The kernel provides a status flag is stored in the Application Configuration Data to indicate that a database
record has been modified. Only database that has been marked modified will be uploaded to the PC. When
the application modifies an entry in the record, it should call the macro below to mark the database as
modified.
CORE_DATABASE_MODIFIED_BY_USER