Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: USBDevice max32630fthr
Fork of MAXREFDES220# by
SensorComm Class Reference
SensorComm is Maxim Sensor Studio GUI command handler base class. More...
#include <SensorComm.h>
Inherited by SSBootloaderComm, and SSMAX30101Comm.
Public Member Functions | |
SensorComm (const char *type, bool visible) | |
SensorComm constructor. | |
virtual | ~SensorComm () |
SensorComm destructor. | |
void | comm_init (MaximSensor *s) |
Initializer for SensorComm. | |
const char * | get_type () |
Get the type of the sensor. | |
virtual const char * | get_part_name () |
Get the maxim part name of the sensor. | |
int | get_part_info (uint8_t *part_id, uint8_t *part_rev) |
Get the id and revision of the part. | |
bool | is_visible () |
Returns whether the sensor should be visible to users in DeviceStudio. | |
bool | is_enabled () |
Get whether or not the sensor is enabled. | |
virtual void | stop () |
Stop collecting data and disable sensor. | |
virtual bool | parse_command (const char *cmd) |
Parses DeviceStudio commands. | |
virtual int | data_report_execute (char *buf, int size) |
Fill in buffer with sensor data. |
Detailed Description
SensorComm is Maxim Sensor Studio GUI command handler base class.
SensorComm includes base functions and data structures for to create new command handler classes. All command handler classes should implement this class.
Definition at line 47 of file SensorComm.h.
Constructor & Destructor Documentation
SensorComm | ( | const char * | type, |
bool | visible | ||
) |
SensorComm constructor.
- Parameters:
-
[in] sensorType Name of sensor (ie "ppg") [in] visible Whether this sensor should be visible to users in DeviceStudio
Definition at line 38 of file SensorComm.cpp.
~SensorComm | ( | ) | [virtual] |
SensorComm destructor.
Definition at line 45 of file SensorComm.cpp.
Member Function Documentation
void comm_init | ( | MaximSensor * | s ) |
Initializer for SensorComm.
- Parameters:
-
[in] s MaximSensor instance to handle sensor commands.
Definition at line 49 of file SensorComm.cpp.
int data_report_execute | ( | char * | buf, |
int | size | ||
) | [virtual] |
Fill in buffer with sensor data.
- Parameters:
-
[in] buf Buffer to fill data into [in] size Maximum size of buffer [out] Number of bytes written to buffer
Reimplemented in SSMAX30101Comm.
Definition at line 135 of file SensorComm.cpp.
int get_part_info | ( | uint8_t * | part_id, |
uint8_t * | part_rev | ||
) |
Get the id and revision of the part.
Definition at line 71 of file SensorComm.cpp.
const char * get_part_name | ( | ) | [virtual] |
Get the maxim part name of the sensor.
- Parameters:
-
[out] char* to name (ie "max86140")
Reimplemented in SSMAX30101Comm.
Definition at line 59 of file SensorComm.cpp.
const char * get_type | ( | ) |
Get the type of the sensor.
- Parameters:
-
[out] char* to name of type (ie "ppg")
Definition at line 54 of file SensorComm.cpp.
bool is_enabled | ( | ) |
Get whether or not the sensor is enabled.
- Parameters:
-
[out] true if the sensor is enabled
Definition at line 82 of file SensorComm.cpp.
bool is_visible | ( | ) |
Returns whether the sensor should be visible to users in DeviceStudio.
Definition at line 98 of file SensorComm.h.
bool parse_command | ( | const char * | cmd ) | [virtual] |
Parses DeviceStudio commands.
Parses and executes commands. Prints return code to i/o device.
- Parameters:
-
[in] cmd - Command to parse
- Returns:
- true if sensor acted upon the command, false if command was unknown
Reimplemented in SSBootloaderComm, and SSMAX30101Comm.
Definition at line 133 of file SensorComm.cpp.
void stop | ( | ) | [virtual] |
Stop collecting data and disable sensor.
Reimplemented in SSMAX30101Comm.
Definition at line 131 of file SensorComm.cpp.
Generated on Mon Jul 18 2022 23:37:28 by
