-
Notifications
You must be signed in to change notification settings - Fork 2
/
cmdInfo.cpp
81 lines (58 loc) · 1.62 KB
/
cmdInfo.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
Module: cmdInterval.cpp
Function:
Process the "info" command
Copyright and License:
This file copyright (C) 2022 by
MCCI Corporation
3520 Krums Corners Road
Ithaca, NY 14850
See accompanying LICENSE file for copyright and license information.
Author:
Dhinesh Kumar Pitchai, MCCI Corporation September 2022
*/
#include "Catena4430_cmd.h"
#include <Catena4430_Sensor.h>
using namespace McciCatena;
using namespace McciCatena4430;
extern cMeasurementLoop *gpMeasurementLoopConcrete;
/*
Name: ::cmdLog()
Function:
Command dispatcher for "info" command.
Definition:
McciCatena::cCommandStream::CommandFn cmdInfo;
McciCatena::cCommandStream::CommandStatus cmdInfo(
cCommandStream *pThis,
void *pContext,
int argc,
char **argv
);
Description:
The "info" command has the following syntax:
info
Displays the config information of SCD30.
Returns:
cCommandStream::CommandStatus::kSuccess if successful.
Some other value for failure.
*/
/* process "info" -- args are ignored */
// argv[0] is the matched command name.
cCommandStream::CommandStatus cmdInfo(
cCommandStream *pThis,
void *pContext,
int argc,
char **argv
)
{
bool fResult;
fResult = false;
if (argc == 1)
{
gpMeasurementLoopConcrete->printSCDinfo();
fResult = true;
}
return fResult ? cCommandStream::CommandStatus::kSuccess
: cCommandStream::CommandStatus::kInvalidParameter
;
}