29 #define NFRAMES_ACDC 30
31 const char cmd_acdc_help[] =
"ACDC - Read";
35 bool cmd_acdc_exec(
int argc,
const char *args[])
43 if (argc < 1 || ((argc == 1) && (strcmp(args[0],
"help") == 0))) {
44 printf(
"usage: acdc read [n] -- read last n packets ; 1 if n is omitted; n < %d\n",NFRAMES_ACDC);
47 else if(argc >= 1 && strcmp(args[0],
"read") == 0){
48 if(argc > 2)
return false;
50 if (
cnvParseI(args[1], &ntot, _int) <= 0) {
53 if(ntot > NFRAMES_ACDC)
return false;
56 rcev = acdcGetNFrames(fvect , ntot);
59 printf(
"Received = %d frames\n\n",rcev);
61 printf(
"[%d] T=%d C degrees - V=%d V - I=%d mA\n",i+1,
62 fvect[i].temp * TSCALE + TOFF,
63 fvect[i].volt * VSCALE + VOFF,
64 fvect[i].current * ISCALE + IOFF);
int cnvParseI(const char *input, int32_t *output, CnvParams params)
Parse a signed integer.
void acdcEnable(bool ena)
enables the ACDC rx
#define CNV_DEFAULT
Default conversion/formatting parameters (base 10).
Manages the global system error.
This structure provides information about formatting and parsing.
This module is responsible for distributing error codes.
This module implements parsing and formating of strings and integers.