update
This commit is contained in:
parent
ffaa497d0b
commit
98c09f5587
@ -682,14 +682,14 @@ BOOLEAN CZJD3100Process::OnSyntaxDBYK(char *pData, int ord)
|
|||||||
|
|
||||||
BOOLEAN CZJD3100Process::OnSyntanProcessInfo(char *pData, int ord)
|
BOOLEAN CZJD3100Process::OnSyntanProcessInfo(char *pData, int ord)
|
||||||
{
|
{
|
||||||
int pid;
|
//int pid;
|
||||||
char *pCmd;
|
//char *pCmd;
|
||||||
char buffer[2048];
|
char buffer[2048];
|
||||||
|
|
||||||
CZJD3100ProcessItem* pItem = (CZJD3100ProcessItem *)GetItem(ord);
|
CZJD3100ProcessItem* pItem = (CZJD3100ProcessItem *)GetItem(ord);
|
||||||
if (pItem == NULL) return FALSE;
|
if (pItem == NULL) return FALSE;
|
||||||
if (pData == NULL) return FALSE;
|
if (pData == NULL) return FALSE;
|
||||||
|
/*
|
||||||
pCmd = strchr(pData, ' ');
|
pCmd = strchr(pData, ' ');
|
||||||
if (NULL == pCmd) return FALSE;
|
if (NULL == pCmd) return FALSE;
|
||||||
*pCmd = '\0';
|
*pCmd = '\0';
|
||||||
@ -699,10 +699,15 @@ BOOLEAN CZJD3100Process::OnSyntanProcessInfo(char *pData, int ord)
|
|||||||
{
|
{
|
||||||
pid = 0;
|
pid = 0;
|
||||||
}
|
}
|
||||||
if (strcmp(pCmd, "get") == 0)
|
*/
|
||||||
|
if (strcmp(pData, "get") == 0)
|
||||||
{
|
{
|
||||||
pItem->WriteData((BYTE *)"ZJD3100# \r\n", strlen("ZJD3100# \r\n"), ord);
|
pItem->WriteData((BYTE *)"ZJD3100# \r\n", strlen("ZJD3100# \r\n"), ord);
|
||||||
snprintf(buffer, sizeof(buffer), "Name: %s", config.processes[pid].name);
|
for (int k = 0; k < PROCESSES_NUM; k++)
|
||||||
|
{
|
||||||
|
int pid = k;
|
||||||
|
if ((config.processes[pid].state & 0x01) != TRUE) continue;
|
||||||
|
snprintf(buffer, sizeof(buffer), "Pid: %d, Name: %s", pid, config.processes[pid].name);
|
||||||
pItem->WriteData((BYTE *)buffer, strlen(buffer), ord);
|
pItem->WriteData((BYTE *)buffer, strlen(buffer), ord);
|
||||||
if (m_proto2name_map.find(config.processes[pid].proto) != m_proto2name_map.end())
|
if (m_proto2name_map.find(config.processes[pid].proto) != m_proto2name_map.end())
|
||||||
{
|
{
|
||||||
@ -719,10 +724,12 @@ BOOLEAN CZJD3100Process::OnSyntanProcessInfo(char *pData, int ord)
|
|||||||
for (int i = 0; i < PROCESS_UNIT_NUM; i++)
|
for (int i = 0; i < PROCESS_UNIT_NUM; i++)
|
||||||
{
|
{
|
||||||
if (config.processes[pid].units[i] < 0) continue;
|
if (config.processes[pid].units[i] < 0) continue;
|
||||||
snprintf(buffer, sizeof(buffer), ", %d", config.processes[pid].units[i]);
|
if (i == 0) snprintf(buffer, sizeof(buffer), "%d", config.processes[pid].units[i]);
|
||||||
|
else snprintf(buffer, sizeof(buffer), ", %d", config.processes[pid].units[i]);
|
||||||
pItem->WriteData((BYTE *)buffer, strlen(buffer), ord);
|
pItem->WriteData((BYTE *)buffer, strlen(buffer), ord);
|
||||||
}
|
}
|
||||||
pItem->WriteData((BYTE *)"\r\n", strlen("\r\n"), ord);
|
pItem->WriteData((BYTE *)"\r\n", strlen("\r\n"), ord);
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user