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;
}
Summary of Contents for OMNii HDK XT10
Page 4: ......
Page 10: ......
Page 12: ......
Page 18: ......
Page 20: ......
Page 24: ......
Page 26: ......
Page 32: ......
Page 72: ......
Page 90: ......
Page 92: ......
Page 116: ......
Page 124: ......
Page 126: ......
Page 130: ......
Page 132: ......
Page 154: ......
Page 168: ......
Page 170: ......
Page 182: ......
Page 184: ......
Page 188: ......