![]() |
Data Logger BLE Cellular Board
|
Command Line Interface (CLI) functions and commands. More...
#include "jfet_files/common.h"#include "jfet_files/w25q64jv_Driver.h"#include <zephyr/drivers/i2c.h>#include "HDC2080.h"#include "ncs_version.h"#include <bluetooth/services/nus.h>#include <zephyr/drivers/uart.h>#include <zephyr/pm/device.h>Go to the source code of this file.
Macros | |
| #define | __USE_MINGW_ANSI_STDIO 1 |
| #define | LINE_SIZE 90 |
| maximum number of characters on a CLI line | |
| #define | NUM_LINES 10 |
| maximum number of lines in saved history | |
Enumerations | |
| enum | COMMANDS { ADCX , BATMON , BME688 , BME688CS , DATETIME , DEVICEID , DEVICEINFO , CUSTOMER , DUTYCYCLE , FLASHERASE , FLASHERASESECTOR , FLASHFILLPAGE , FLASHID , FLASHNSS , FLASHREADPAGE , FLASHSTATUS , FLASHWRITEPAGE , FLASHPARAMETERS , GROUP , HELP , HUMIDITY , I2CREAD , I2CWRITE , IGNOREBME688 , LOCATION , MANUALTRIGGER , NOUART0 , PUBLISHNOW , RESCAN , RESETX , RESETCAUSE , SAVED , SENSORID , SENSORNAME , SILENT , SENSORS , TEMP , VERSIONX } |
| < vaild command indexes More... | |
Functions | |
| void | executeCmd (char *line) |
| executes the command in line array. | |
| int8_t | getCLICmd (char *line) |
| parses command line to find position of command in validCLICmds array. | |
| void | cliADC () |
| CLI command to sample and display the ADC voltage. | |
| void | cliBatMon () |
| CLI command to enable or disable the battery monitor hardware. | |
| void | cliBME688 () |
| CLI command to read and display data from the BME688 sensor. | |
| void | cliBME688CS () |
| CLI command to manually control the BME688 SPI Chip Select (CS) pin. | |
| void | cliDeviceID () |
| Display the unique device identifier string. | |
| void | cliDeviceInfo () |
| Transmit comprehensive device information over BLE NUS service. | |
| void | cliCustomer () |
| CLI command to set or display the customer name in flash parameters. | |
| void | cliDateTime () |
| CLI command to set or display the gateway epoch timestamp. | |
| void | cliDutyCycle () |
| CLI command to configure the sensor data sampling interval. | |
| void | cliFlashErase () |
| CLI command to erase the entire external flash memory. | |
| void | cliFlashEraseSector () |
| CLI command to erase a specific 4KB sector of the external flash. | |
| void | cliFlashFillPage () |
| CLI command to fill one or more flash pages with a specific 32-bit data pattern. | |
| void | cliFlashID () |
| CLI command to read and display the unique Flash memory ID. | |
| void | cliFlashNSS () |
| CLI command to manually toggle the SPI Chip Select (NSS) for the Flash memory. | |
| void | cliFlashReadPage () |
| CLI command to read and display the contents of external flash pages. | |
| void | cliFlashStatus () |
| CLI command to read and display the status registers of the external flash. | |
| void | cliFlashWritePage () |
| CLI command to write a single byte of data to a specific address within a flash page. | |
| void | cliGroup () |
| CLI command to set or display the sensor group name. | |
| void | cliHelp () |
| CLI command to display help information for available commands. | |
| void | cliHumidity () |
| CLI command to display humidity data from connected sensors. | |
| void | cliNouart0 (void) |
| void | cliI2CRead () |
| CLI command to read data from an I2C device. | |
| void | cliI2CWrite () |
| CLI command to write data to a specific I2C device register. | |
| void | cliIgnoreBME688 () |
| CLI command to set or display the ignore BME688 flag. | |
| void | cliLocation () |
| CLI command to set or display the sensor's physical location. | |
| void | cliManualTrigger (void) |
| CLI command to set or display the manual trigger mode flag. | |
| void | cliPublishNow () |
| CLI command to trigger an immediate sensor data publication. | |
| void | cliReset () |
| CLI command to reset the processor. | |
| void | cliResetCause () |
| CLI command to display the reason for the last processor reset. | |
| void | cliSaved () |
| CLI command to manage and display JSON packets saved in external flash. | |
| void | cliSensorID () |
| CLI command to set or display the unique sensor ID. | |
| void | cliSensorName () |
| CLI command to set or display the human-readable sensor name. | |
| void | cliSensors () |
| CLI command to list all supported sensors and their detection status. | |
| void | cliSilent () |
| CLI command to set or display the silent mode flag. | |
| void | cliTemperature () |
| CLI command to display temperature data from connected sensors. | |
| void | cliVersion () |
| CLI command to display firmware, hardware, and SDK version information. | |
| void | displayHelp (char c) |
| displays a list of all available CLI commands | |
| int | uart_init (void) |
| void | int64_to_string (int64_t num, char *str) |
| Converts a 64-bit signed integer to a null-terminated string. | |
Variables | |
| static char | lineTmp [LINE_SIZE] |
| tempory line saved | |
| char * | sensorTypeNames [] |
| sensor types and state (present = 1) | |
| char const * | validCLICmds [] |
| array of valid commands - case insensitive | |
| char const * | helpMessages [] |
| array of help messages | |
Command Line Interface (CLI) functions and commands.
Definition in file jfet_commandLine.c.
| #define __USE_MINGW_ANSI_STDIO 1 |
Definition at line 18 of file jfet_commandLine.c.
| #define LINE_SIZE 90 |
maximum number of characters on a CLI line
Definition at line 141 of file jfet_commandLine.c.
| #define NUM_LINES 10 |
maximum number of lines in saved history
Definition at line 142 of file jfet_commandLine.c.
| enum COMMANDS |
< vaild command indexes
Definition at line 97 of file jfet_commandLine.c.
| void cliADC | ( | void | ) |
CLI command to sample and display the ADC voltage.
This function triggers an ADC sampling process and prints the resulting voltage from the primary channel to the console.
Definition at line 536 of file jfet_commandLine.c.


| void cliBatMon | ( | void | ) |
CLI command to enable or disable the battery monitor hardware.
This function parses the command line parameter to set the state of the battery enable (BATEN) GPIO pin.
Definition at line 558 of file jfet_commandLine.c.


| void cliBME688 | ( | void | ) |
CLI command to read and display data from the BME688 sensor.
Definition at line 580 of file jfet_commandLine.c.


| void cliBME688CS | ( | void | ) |
CLI command to manually control the BME688 SPI Chip Select (CS) pin.
Definition at line 611 of file jfet_commandLine.c.


| void cliCustomer | ( | void | ) |
CLI command to set or display the customer name in flash parameters.
Definition at line 641 of file jfet_commandLine.c.


| void cliDateTime | ( | ) |
CLI command to set or display the gateway epoch timestamp.
Definition at line 689 of file jfet_commandLine.c.


| void cliDeviceID | ( | void | ) |
Display the unique device identifier string.
Definition at line 717 of file jfet_commandLine.c.


| void cliDeviceInfo | ( | void | ) |
Transmit comprehensive device information over BLE NUS service.
This function iterates through various device parameters (ID, Name, Customer, etc.) and sends them both to the local console and over the Bluetooth NUS service.
Definition at line 727 of file jfet_commandLine.c.


| void cliDutyCycle | ( | void | ) |
CLI command to configure the sensor data sampling interval.
< HDC2080 specific rate code
< Pointer for strtoul parsing
< String representation of the duty cycle
Definition at line 817 of file jfet_commandLine.c.


| void cliFlashErase | ( | void | ) |
CLI command to erase the entire external flash memory.
Definition at line 892 of file jfet_commandLine.c.


| void cliFlashEraseSector | ( | void | ) |
CLI command to erase a specific 4KB sector of the external flash.
If no parameter is provided, it defaults to erasing the parameter storage sector. Erasing the parameter sector also triggers a reset of the local parameter structure.
Definition at line 914 of file jfet_commandLine.c.


| void cliFlashFillPage | ( | void | ) |
CLI command to fill one or more flash pages with a specific 32-bit data pattern.
Definition at line 946 of file jfet_commandLine.c.


| void cliFlashID | ( | void | ) |
CLI command to read and display the unique Flash memory ID.
This function retrieves the manufacturer and device identification from the external SPI flash and prints it to the console.
Definition at line 993 of file jfet_commandLine.c.


| void cliFlashNSS | ( | void | ) |
CLI command to manually toggle the SPI Chip Select (NSS) for the Flash memory.
This is used for hardware debugging to verify the SPI CS1 line state.
Definition at line 1007 of file jfet_commandLine.c.


| void cliFlashReadPage | ( | void | ) |
CLI command to read and display the contents of external flash pages.
This function reads 256-byte pages from the SPI flash and displays them in a hex-dump format with corresponding ASCII representation.
Definition at line 1038 of file jfet_commandLine.c.


| void cliFlashStatus | ( | void | ) |
CLI command to read and display the status registers of the external flash.
This function reads the three status registers from the SPI flash and decodes individual bits such as Busy, Write Enable, and Protection settings.
Definition at line 1099 of file jfet_commandLine.c.


| void cliFlashWritePage | ( | void | ) |
CLI command to write a single byte of data to a specific address within a flash page.
This function parses the page index, the byte offset within that page, and the data byte to be written. It validates the ranges before calling the flash driver.
Definition at line 1130 of file jfet_commandLine.c.


| void cliGroup | ( | void | ) |
CLI command to set or display the sensor group name.
If a parameter is provided, it updates the group name in the flash parameters.
Definition at line 1174 of file jfet_commandLine.c.


| void cliHelp | ( | void | ) |
CLI command to display help information for available commands.
Definition at line 1191 of file jfet_commandLine.c.


| void cliHumidity | ( | void | ) |
CLI command to display humidity data from connected sensors.
Definition at line 1207 of file jfet_commandLine.c.


| void cliI2CRead | ( | void | ) |
CLI command to read data from an I2C device.
Parses the command line for I2C address, register, and length, then performs the read operation and prints the results in hex.
Definition at line 1237 of file jfet_commandLine.c.


| void cliI2CWrite | ( | void | ) |
CLI command to write data to a specific I2C device register.
This function parses the I2C slave address, the target register, and the data byte from the command line, then executes the I2C write transaction.
Definition at line 1278 of file jfet_commandLine.c.


| void cliIgnoreBME688 | ( | void | ) |
CLI command to set or display the ignore BME688 flag.
Definition at line 1376 of file jfet_commandLine.c.


| void cliLocation | ( | void | ) |
CLI command to set or display the sensor's physical location.
If a location string is provided, it updates the flash parameters.
Definition at line 1407 of file jfet_commandLine.c.


| void cliManualTrigger | ( | void | ) |
CLI command to set or display the manual trigger mode flag.
Definition at line 1424 of file jfet_commandLine.c.


| void cliNouart0 | ( | void | ) |
Definition at line 1313 of file jfet_commandLine.c.


| void cliPublishNow | ( | void | ) |
CLI command to trigger an immediate sensor data publication.
This function releases the hdc_rdy_seen semaphore to bypass the normal duty cycle timer and force a sensor read/BLE transmission.
Definition at line 1456 of file jfet_commandLine.c.


| void cliReset | ( | void | ) |
CLI command to reset the processor.
If called without parameters, it performs a clean system reset. If called with any parameter, it stops the watchdog feeder to force a WDT reset.
Definition at line 1471 of file jfet_commandLine.c.


| void cliResetCause | ( | void | ) |
CLI command to display the reason for the last processor reset.
Definition at line 1490 of file jfet_commandLine.c.


| void cliSaved | ( | void | ) |
CLI command to manage and display JSON packets saved in external flash.
This function allows the user to clear all saved packets, read a specific packet, or display a range of packets stored in the flash memory.
Definition at line 1503 of file jfet_commandLine.c.


| void cliSensorID | ( | void | ) |
CLI command to set or display the unique sensor ID.
If a parameter is provided, it updates the sensorID in flash memory.
Definition at line 1571 of file jfet_commandLine.c.


| void cliSensorName | ( | void | ) |
CLI command to set or display the human-readable sensor name.
Updates the sensorName in flash parameters if a new name is provided.
Definition at line 1590 of file jfet_commandLine.c.


| void cliSensors | ( | void | ) |
CLI command to list all supported sensors and their detection status.
Checks the sensorTypePresentAll bitmask against the known sensor list.
Definition at line 1609 of file jfet_commandLine.c.


| void cliSilent | ( | void | ) |
CLI command to set or display the silent mode flag.
Definition at line 1634 of file jfet_commandLine.c.


| void cliTemperature | ( | void | ) |
CLI command to display temperature data from connected sensors.
Reads the current temperature from the HDC2080 and displays it alongside the configured low and high alarm thresholds.
Definition at line 1666 of file jfet_commandLine.c.


| void cliVersion | ( | void | ) |
CLI command to display firmware, hardware, and SDK version information.
Definition at line 1689 of file jfet_commandLine.c.


| void displayHelp | ( | char | c | ) |
displays a list of all available CLI commands
| c | check for only help messages beginning with c |
Definition at line 489 of file jfet_commandLine.c.


| void executeCmd | ( | char * | line | ) |
executes the command in line array.
Definition at line 270 of file jfet_commandLine.c.


| int8_t getCLICmd | ( | char * | line | ) |
parses command line to find position of command in validCLICmds array.
goes through line array separated by spaces. cmdLineParameter[numParameters]
is an array of pointers to the various parameters in the line until the end of line then
searches cmd array for a match in validCLICmds array.
Definition at line 444 of file jfet_commandLine.c.


| void int64_to_string | ( | int64_t | num, |
| char * | str ) |
Converts a 64-bit signed integer to a null-terminated string.
| num | The 64-bit integer to convert. |
| str | Pointer to the destination buffer (must be large enough to hold the result). |
Definition at line 663 of file jfet_commandLine.c.

| int uart_init | ( | void | ) |

| char const* helpMessages[] |
array of help messages
Definition at line 216 of file jfet_commandLine.c.
|
static |
tempory line saved
Definition at line 153 of file jfet_commandLine.c.
| char* sensorTypeNames[] |
sensor types and state (present = 1)
Definition at line 164 of file jfet_commandLine.c.
| char const* validCLICmds[] |
array of valid commands - case insensitive
Definition at line 172 of file jfet_commandLine.c.