Chapter 4: Software
Omnii HDK API Functions
54
Psion Teklogix Omnii HDK User Manual
reads/writes is undefined. Since an application or driver may not know the EEPROM size in
advance, it should first call the Hdk7545_ReadEepromHeader function (see page 52) to read the
EEPROM contents, modify the EEPROM structure contents as required, and write the modified
structure back to the EEPROM.
All of the EEPROM header fields can be changed. However, if the EEPROM header data is not
formatted properly, unexpected behaviour may occur. For example, the peripherals driver may
not be able to properly detect the device type and as a result will not load the driver for the
attached device.
Returns
•
ERROR_SUCCESS – if successful.
•
ERROR_INVALID_HANDLE – the specified handle is invalid.
•
ERROR_INVALID_PARAMETER – one of the parameters is incorrect/invalid.
•
ERROR_INVALID_DATA - an exception was generated.
•
ERROR_REVISION_MISMATCH – the EEPROM structure size/format/version supplied by
the caller does not match what was expected by the HDK and/or the hand-held device.
•
Other errors are possible.
Sample Code
DWORD WriteEeprom()
{
Hdk7545_Connector expansionSlot = Hdk7545_Connector_Expansion1;
HANDLE hdkHandle = INVALID_HANDLE_VALUE;
DWORD result = Hdk7545_Open(&hdkHandle, expansionSlot);
if( result != ERROR_SUCCESS ) {
return ERROR_NOT_SUPPORTED;
}
Hdk7545_Eeprom eeprom = { 0 };
eeprom.m_Size = sizeof(eeprom);
eeprom.m_Version = HDK7545_EEPROM_VERSION;
result = Hdk7545_ReadEepromHeader(hdkHandle, &eeprom);
if( result != ERROR_SUCCESS ) {
Hdk7545_Close(&hdkHandle);
return result;
}
// the manufacturing data region has no defined format. Assume for this
// example that the manufacturer stores the test date in the first three bytes,
// and the test result in the fourth byte, with 0 indicating no errors occurred.
eeprom.m_MfgTestRegion[0] = 0x01; // January
eeprom.m_MfgTestRegion[1] = 0x1e; // 30
eeprom.m_MfgTestRegion[2] = 0x0a; // 2010
eeprom.m_MfgTestRegion[3] = 0x00; // test result (0 = okay)
result = Hdk7545_WriteEepromHeader(hdkHandle, &eeprom);
if( result != ERROR_SUCCESS ) {
Hdk7545_Close(&hdkHandle);
return result;
}
Hdk7545_Close(&hdkHandle);
return ERROR_SUCCESS;
}
Содержание OMNii HDK XT10
Страница 4: ......
Страница 10: ......
Страница 12: ......
Страница 18: ......
Страница 20: ......
Страница 24: ......
Страница 26: ......
Страница 32: ......
Страница 72: ......
Страница 90: ......
Страница 92: ......
Страница 116: ......
Страница 124: ......
Страница 126: ......
Страница 130: ......
Страница 132: ......
Страница 154: ......
Страница 168: ......
Страница 170: ......
Страница 182: ......
Страница 184: ......
Страница 188: ......