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;
}
Содержание 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: ......