diff options
| author | Adonais Romero González <[email protected]> | 2018-11-28 11:43:42 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-11-28 11:43:42 -0800 |
| commit | 7695b30331c53cfd119c8ffae81b2e049341d301 (patch) | |
| tree | e0e5d38b88c84b72caad4e8a849421dd803f451c /gnss/gnssUmdf/FixHandler.cpp | |
| parent | 70876614eb9138f66399deb6a6f06e42645d9cd3 (diff) | |
Revert "Initial version of GNSS UMDF Sample Driver"
Diffstat (limited to 'gnss/gnssUmdf/FixHandler.cpp')
| -rw-r--r-- | gnss/gnssUmdf/FixHandler.cpp | 168 |
1 files changed, 0 insertions, 168 deletions
diff --git a/gnss/gnssUmdf/FixHandler.cpp b/gnss/gnssUmdf/FixHandler.cpp deleted file mode 100644 index 0336dc89..00000000 --- a/gnss/gnssUmdf/FixHandler.cpp +++ /dev/null @@ -1,168 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - fixhandler.cpp - -Abstract: - - This file contains the Fix handler and contains logic to provide position. - -Environment: - - Windows User-Mode Driver Framework - ---*/ - -#include "precomp.h" -#include "Trace.h" -#include "Defaults.h" -#include "NmeaProcessor.h" -#include "FixSession.h" -#include "FixHandler.h" - -#include "FixHandler.tmh" - - -NTSTATUS -CFixHandler::Initialize( - _In_ WDFQUEUE Queue -) -{ - NTSTATUS status = STATUS_SUCCESS; - - status = _SingleShotSession.Initialize(Queue); - - return status; -} - -NTSTATUS -CFixHandler::StartFix( - _In_ WDFREQUEST Request -) -{ - NTSTATUS status = STATUS_SUCCESS; - PGNSS_FIXSESSION_PARAM fixSessionParameters = nullptr; - - status = WdfRequestRetrieveInputBuffer(Request, sizeof(GNSS_FIXSESSION_PARAM), (void**)&fixSessionParameters, nullptr); - if (!NT_SUCCESS(status)) - { - TraceEvents(TRACE_LEVEL_ERROR, TRACE_FIX, "WdfRequestRetrieveInputBuffer failed with %!STATUS!", status); - goto Exit; - } - - if (fixSessionParameters->SessionType != GNSS_FixSession_SingleShot) - { - status = STATUS_UNSUCCESSFUL; - TraceEvents(TRACE_LEVEL_ERROR, TRACE_FIX, "Session type is not GNSS_FixSession_SingleShot"); - goto Exit; - } - - _CurrentSinglsShotSessionId = fixSessionParameters->FixSessionID; - - status = _SingleShotSession.StartAcquiringFix(fixSessionParameters); - if (!NT_SUCCESS(status)) - { - TraceEvents(TRACE_LEVEL_ERROR, TRACE_FIX, "StartFix failed with %!STATUS!", status); - goto Exit; - } - -Exit: - return status; -} - -NTSTATUS -CFixHandler::StopFix( - _In_ WDFREQUEST Request -) -{ - NTSTATUS status = STATUS_SUCCESS; - PGNSS_STOPFIXSESSION_PARAM StopFixSessionParam = nullptr; - - status = WdfRequestRetrieveInputBuffer(Request, sizeof(GNSS_STOPFIXSESSION_PARAM), (void**)&StopFixSessionParam, nullptr); - if (!NT_SUCCESS(status)) - { - TraceEvents(TRACE_LEVEL_ERROR, TRACE_FIX, "WdfRequestRetrieveInputBuffer failed with %!STATUS!", status); - goto Exit; - } - - // Send the session parameters to the right session based on the ID - if (StopFixSessionParam->FixSessionID != _CurrentSinglsShotSessionId) - { - status = STATUS_UNSUCCESSFUL; - TraceEvents(TRACE_LEVEL_ERROR, TRACE_FIX, "Session type is not GNSS_FixSession_SingleShot"); - goto Exit; - } - - _CurrentSinglsShotSessionId = INVALID_SESSION_ID; - - status = _SingleShotSession.StopAcquiringFix(StopFixSessionParam); - if (!NT_SUCCESS(status)) - { - TraceEvents(TRACE_LEVEL_ERROR, TRACE_FIX, "StopFix failed with %!STATUS!", status); - goto Exit; - } - -Exit: - return status; -} - -NTSTATUS -CFixHandler::ModifyFix( - _In_ WDFREQUEST /*Request*/ -) -{ - NTSTATUS status = STATUS_SUCCESS; - - // - // TODO: Currently not doing anything yet - // - - return status; -} - -NTSTATUS -CFixHandler::GetFixRequest( - _In_ WDFREQUEST Request -) -{ - NTSTATUS status = STATUS_SUCCESS; - ULONG sessionId = INVALID_SESSION_ID; - ULONG *pSessionId = nullptr; - - // Get the session ID this get fix is for - status = WdfRequestRetrieveInputBuffer(Request, sizeof(sessionId), (void**)&pSessionId, nullptr); - if (!NT_SUCCESS(status)) - { - TraceEvents(TRACE_LEVEL_ERROR, TRACE_FIX, "Could not retrieve input sessionID for request"); - goto Exit; - } - - // Should do this check at the FixHandler Level. - sessionId = *pSessionId; - - status = _SingleShotSession.GetFix(Request); - if (!NT_SUCCESS(status)) - { - TraceEvents(TRACE_LEVEL_ERROR, TRACE_FIX, "SinglShotSession.GetFix failed with %!STATUS!", status); - goto Exit; - } - -Exit: - return status; -} - -NTSTATUS -CFixHandler::SetCurrentPosition( - _In_ PGNSS_FIXDATA GnssFixData -) -{ - NTSTATUS status = STATUS_SUCCESS; - - // Update the current sessions. - status = _SingleShotSession.UpdateCurrentPosition(GnssFixData); - - return status; -} |
