?? atcmd.h
字號(hào):
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Module Name:
atcmd.h
Abstract:
Notes:
--*/
#pragma once
//
// Forward declarations
//
class CRilHandle;
enum APIID;
//
// Globals
//
extern CPriorityQueue<CCommand, 40>* g_pCmdQ;
extern CQueue<CResponse, 10>* g_pRspQ;
extern DWORD g_dwUnlocked;
// theoretically, on boot we should see a max of two toolkit notifications.
// 1 for a setup menu and 1 for a pro-active cmd.
#define MAX_TOOLKITNOTIFS 3
extern CResponse* g_CachedToolKitNotifs[MAX_TOOLKITNOTIFS];
//
// Structures
//
struct REQUEUE_THREAD_DATA {
CCommand* pCmd;
DWORD dwDelay;
};
//
// Thread procedures
//
DWORD WINAPI CmdThreadProc(LPVOID lpParameter);
DWORD WINAPI ReadThreadProc(LPVOID lpParameter);
//
// Routines
//
BOOL QueueCmd(CRilInstanceHandle* const pHandle, const LPCSTR szCmd, const DWORD dwOptions, const APIID apiid,
const PFN_CMD_PARSE pfnParse, CNotificationData* const pnd, HRESULT& rhrCmdID);
BOOL QueueMultipartCmd(CRilInstanceHandle* const pHandle, const LPCSTR szCmd, const LPCSTR szCmdPart2, const DWORD dwOptions, const APIID apiid,
const PFN_CMD_PARSE pfnParse, CNotificationData* const pnd, HRESULT& rhrCmdID);
BOOL QueueCmdWithTimeout(CRilInstanceHandle* const pHandle, const LPCSTR szCmd, const LPCSTR szCmdPart2, const DWORD dwOptions, const APIID apiid,
const PFN_CMD_PARSE pfnParse, CNotificationData* const pnd, HRESULT& rhrCmdID, DWORD dwTimeout, DWORD dwRetries);
BOOL QueueCmdIgnoreRsp(const APIID apiid, const LPCSTR szCmd, const DWORD dwOptions, DWORD dwTimeout, const PFN_CMD_PARSE pfnParse, CNotificationData* const pnd, DWORD dwRetries, DWORD dwRetriesOnError, DWORD dwRetryOnErrorDelay);
BOOL QueueCmdIgnoreRspWithData(const APIID apiid, const LPCSTR szCmd, const DWORD dwOptions, DWORD dwTimeout, const PFN_CMD_PARSE pfnParse, CNotificationData* const pnd, DWORD dwRetries, DWORD dwRetriesOnError, DWORD dwRetryOnErrorDelay, const PFN_CMD_PARSE_DATA pfnParseWithData, const PVOID pParseData);
BOOL RequeueCmdWithDelay(CCommand* pCmd, DWORD dwDelay);
BOOL HandleRsp(CRilHandle* pDevice, CCommand* pCmd, CResponse* pRsp);
/*
* framework to support synchronous AT command execution
*/
class ATCmd
{
public:
ATCmd();
virtual ~ATCmd();
virtual void Dump() const;
protected:
HRESULT Execute( const char *cmd, DWORD dwOptions=0, DWORD dwTimeout=0);
virtual HRESULT Parse( LPCSTR szRsp ) =0;
private:
ATCmd( const ATCmd& ref );
ATCmd& operator=( const ATCmd& ref );
mutable CRITICAL_SECTION m_cs;
HANDLE m_hEvent;
HRESULT m_hr;
BOOL m_fInProgress;
HRESULT Initialize();
static HRESULT s_ParseFunc( LPCSTR szRsp, void*& pBlob, UINT& cbBlob, PVOID& pfnParseData );
HRESULT ParseFunc( LPCSTR szRsp );
};
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -