?? agconmemtest.cpp
字號:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//包含相應頭文件
#include "AgConnect.h"
//主要參數定義
char AgEAppName[]="Connect";
static char *initFileName = NULL;
static char *connection1 = NULL;
static char connectName[256] = "localhost:5001";
AgTConReturnInfo returnInfo;
//發送函數聲明
//CB向STK發送命令函數的原型
int sendCommandToStk(char *command){
return (AgConProcessSTKCmd(connection1,command,&returnInfo));
}
int main()
{
//要執行的命令
static char cmdString[256] = "GetReport */Satellite/Sat \"LLA Position\"";
int i;
//初始化連接
AgConInit(initFileName);
//建立CB與STK之間的連接
AgConOpenSTK(&connection1, AgCTcpType, connectName);
//發送命令
sendCommandToStk(cmdString);
//關閉CB與STK之間的當前連接
AgConCloseSTK(&connection1);
//輸出STK返回的結果
for (i=0; i < returnInfo.numEntries; i++)
{
AgUtMsg( AgCMsgForceInfo, AgCMsgNoWait, AgCMsgDispDefault,
AgCMsgNoErrorCode, AgCMSourceLine,
"Return entry %d:\n%s\n", i+1, returnInfo.returnList[i]);
}
//清除所有相關緩沖區
AgConShutdownConnect();
return (0);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -