void GetSatData( LPSATSTAT Data ) { io_params.region = 1; io_params.offset = 0xb0; io_params.count = 5; ReadHopfDevice(); Data->wVisible = HIBYTE(HIWORD(iobuffer[0])); Data->wMode = LOBYTE(LOWORD(iobuffer[0])); Data->wSat0 = HIBYTE(HIWORD(iobuffer[1])); Data->wRat0 = LOBYTE(HIWORD(iobuffer[1])); Data->wSat1 = HIBYTE(LOWORD(iobuffer[1])); Data->wRat1 = LOBYTE(LOWORD(iobuffer[1])); Data->wSat2 = HIBYTE(HIWORD(iobuffer[2])); Data->wRat2 = LOBYTE(HIWORD(iobuffer[2])); Data->wSat3 = HIBYTE(LOWORD(iobuffer[2])); Data->wRat3 = LOBYTE(LOWORD(iobuffer[2])); Data->wSat4 = HIBYTE(HIWORD(iobuffer[3])); Data->wRat4 = LOBYTE(HIWORD(iobuffer[3])); Data->wSat5 = HIBYTE(LOWORD(iobuffer[3])); Data->wRat5 = LOBYTE(LOWORD(iobuffer[3])); Data->wSat6 = HIBYTE(HIWORD(iobuffer[4])); Data->wRat6 = LOBYTE(HIWORD(iobuffer[4])); Data->wSat7 = HIBYTE(LOWORD(iobuffer[4])); Data->wRat7 = LOBYTE(LOWORD(iobuffer[4])); }
void GetPosition(LPGPSPOS Data){ io_params.region = 1; io_params.offset = 0x90; // Positionsdaten Länge io_params.count = 1; ReadHopfDevice(); Data->wLongitude = iobuffer[0]; //in Millisekunden io_params.region = 1; io_params.offset = 0xa0; // Positionsdaten Breite io_params.count = 1; ReadHopfDevice(); Data->wLatitude = iobuffer[0]; Data->wAltitude = 0; return; }
void GetHardwareData(LPDWORD Data32,WORD Ofs) { io_params.region = 1; io_params.offset = Ofs; io_params.count =1; ReadHopfDevice(); *Data32 = iobuffer[0]; return; }
void GetHopfTime( LPHOPFTIME Data, DWORD Offset ) { io_params.region = 1; io_params.offset = Offset; io_params.count = 4; ReadHopfDevice(); Data->wHour = 0; Data->wMinute = 0; Data->wSecond = 0; while (iobuffer[0] >= 60 * 60 * 1000) { iobuffer[0] = iobuffer[0] - 60 * 60 * 1000; Data->wHour++; } while (iobuffer[0] >= 60 * 1000) { iobuffer[0] = iobuffer[0] - 60 * 1000; Data->wMinute++; } while (iobuffer[0] >= 1000) { iobuffer[0] = iobuffer[0] - 1000; Data->wSecond++; } Data->wMilliseconds = LOWORD(iobuffer[0]); Data->wDay = HIBYTE(HIWORD(iobuffer[1])); Data->wMonth = LOBYTE(HIWORD(iobuffer[1])); Data->wYear = LOWORD(iobuffer[1]); Data->wDayOfWeek = HIBYTE(HIWORD(iobuffer[2])); if (Data->wDayOfWeek == 7) // Dow Korrektur Data->wDayOfWeek = 0; io_params.region = 1; io_params.offset += 0x08; io_params.count = 1; ReadHopfDevice(); Data->wStatus = LOBYTE(HIWORD(iobuffer[0])); }
void GetDCFAntenne(LPDCFANTENNE Data){ io_params.region = 1; io_params.offset = 0xcc; // io_params.count = 1; ReadHopfDevice(); Data->bStatus1 = HIBYTE(HIWORD(iobuffer[0])); // Data->bStatus = LOBYTE(HIWORD(iobuffer[0])); // Data->wAntValue = LOWORD(iobuffer[0]); return; }
void GetDiffTime(LPLONG Data) { io_params.region = 1; io_params.offset = 0x0c; io_params.count =1; ReadHopfDevice(); *Data = iobuffer[0]; return; }
void GetHardwareVersion(LPCLOCKVER Data){ int i; io_params.region = 1; io_params.offset = 0x50; io_params.count =12; ReadHopfDevice(); strcpy(Data->cVersion,""); iobuffer[13] =0; for (i=0; i < 13; i++){ Data->cVersion[i * 4 ] = HIBYTE(HIWORD(iobuffer[i])); Data->cVersion[i * 4 + 1] = LOBYTE(HIWORD(iobuffer[i])); Data->cVersion[i * 4 + 2] = HIBYTE(LOWORD(iobuffer[i])); Data->cVersion[i * 4 + 3] = LOBYTE(LOWORD(iobuffer[i])); } }