Chapter 4: Software
API Structures
Psion Teklogix Omnii HDK User Manual
57
Sample Code
4.7.5
API Structures
The following C Structures are declared in the file hdk7545Structs.h:
4.7.5.1 Hdk7545_Eeprom
The Hdk7545_Eeprom structure is defined as follows:
DWORD WriteExtended()
{
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;
}
const BYTE data[24] =
{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23};
DWORD dataSize = sizeof(data);
DWORD offset = 0;
if( eeprom.m_ExtendedSize < dataSize ) {
Hdk7545_Close(&hdkHandle);
return ERROR_INVALID_DATA;
}
result = Hdk7545_WriteEepromExtendedData(hdkHandle, offset, dataSize, Data);
if( result != ERROR_SUCCESS ) {
// handle error here...
Hdk7545_Close(&hdkHandle);
return result;
}
Hdk7545_Close(&hdkHandle);
return ERROR_SUCCESS;
}
struct Hdk7545_Eeprom
{
DWORD m_Size;
DWORD m_Version;
DWORD m_EepromId;
BYTE m_MfgTestRegion[HDK7545_EEPROM_MFGTESTREGION_SIZE];
char m_PartNumber[HDK7545_EEPROM_PART_NUMB1];
char m_SerialNumber[HDK7545_EEPROM_SERIAL_NUMB1];
char m_Manufacturer[HDK7545_EEPROM_MANUFACTUR1];
char m_Model[HDK7545_EEPROM_MOD1];
char m_HardwareRevision[HDK7545_EEPROM_HWREVISI1];
DWORD m_EepromSize;
DWORD m_ExtendedSize;
}
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: ......