User defined Diagnostics and Configuration fields.
More...
|
#define | FLEX_DIAG_CONF_TABLE_BEGIN() |
|
#define | FLEX_DIAG_CONF_TABLE_END() |
| Ends recording the diagnostic and configuration table.
|
|
#define | FLEX_DIAG_CONF_TABLE_BOOL_ADD(id, name, default_value, type) |
|
#define | FLEX_DIAG_CONF_TABLE_FLOAT_ADD(id, name, default_value, type) |
|
#define | FLEX_DIAG_CONF_TABLE_I32_ADD(id, name, default_value, type) |
|
#define | FLEX_DIAG_CONF_TABLE_STR_ADD(id, name, default_value, max_len, type) |
|
#define | FLEX_DIAG_CONF_TABLE_TIME_ADD(id, name, default_value, type) |
|
#define | FLEX_DIAG_CONF_TABLE_U32_ADD(id, name, default_value, type) |
|
|
enum | FLEX_DiagConfID {
FLEX_DIAG_CONF_ID_USER_0
, FLEX_DIAG_CONF_ID_USER_1
, FLEX_DIAG_CONF_ID_USER_2
, FLEX_DIAG_CONF_ID_USER_3
,
FLEX_DIAG_CONF_ID_USER_4
, FLEX_DIAG_CONF_ID_USER_5
, FLEX_DIAG_CONF_ID_USER_6
, FLEX_DIAG_CONF_ID_USER_7
,
FLEX_DIAG_CONF_ID_USER_8
, FLEX_DIAG_CONF_ID_USER_9
, FLEX_DIAG_CONF_ID_USER_10
, FLEX_DIAG_CONF_ID_USER_11
,
FLEX_DIAG_CONF_ID_USER_12
, FLEX_DIAG_CONF_ID_USER_13
, FLEX_DIAG_CONF_ID_USER_14
, FLEX_DIAG_CONF_ID_USER_15
,
FLEX_DIAG_CONF_ID_USER_MAX
} |
| Diagnostics and Configurations IDs. More...
|
|
enum | FLEX_DiagConfType { FLEX_DIAG_CONF_TYPE_CONF
, FLEX_DIAG_CONF_TYPE_DIAG
, FLEX_DIAG_CONF_TYPE_PERSIST_DIAG
} |
| The type of diagnostic or configuration item. More...
|
|
User defined Diagnostics and Configuration fields.
◆ FLEX_DIAG_CONF_TABLE_BEGIN
#define FLEX_DIAG_CONF_TABLE_BEGIN |
( |
| ) |
|
Value: FLEX_DiagConfTableItem *diag_conf_table_get_(void) { \
static FLEX_DiagConfTableItem table[] = {
Begins recording the diagnostic and configuration table
- Note
- The collective length of all item names, and string values including terminators is 512 bytes and 256 bytes respectively.
◆ FLEX_DIAG_CONF_TABLE_END
#define FLEX_DIAG_CONF_TABLE_END |
( |
| ) |
|
Value: {0}}; \
return table; \
}
Ends recording the diagnostic and configuration table.
◆ FLEX_DIAG_CONF_TABLE_BOOL_ADD
#define FLEX_DIAG_CONF_TABLE_BOOL_ADD |
( |
| id, |
|
|
| name, |
|
|
| default_value, |
|
|
| type ) |
Value: { id, FLEX_DIAG_CONF_VALUE_TAG_B8, type, 0, name, (void *)default_value }
Adds a boolean to the diagnostic and configuration table
- Parameters
-
id | The id of diagnostic or configuration of type FLEX_DiagConfID. |
name | The name of diagnostic or configuration. |
default_value | The default_value of the diagnostic or configuration. |
type | If the table item is a configuration, diagnostic, or presistent diagnostic. See FLEX_DiagConfType. |
◆ FLEX_DIAG_CONF_TABLE_FLOAT_ADD
#define FLEX_DIAG_CONF_TABLE_FLOAT_ADD |
( |
| id, |
|
|
| name, |
|
|
| default_value, |
|
|
| type ) |
Value: { id, FLEX_DIAG_CONF_VALUE_TAG_F32, type, 0, name, (void *)default_value }
Adds a float to the diagnostic and configuration table
- Parameters
-
id | The id of diagnostic or configuration of type FLEX_DiagConfID. |
name | The name of diagnostic or configuration. |
default_value | The default_value of the diagnostic or configuration. |
type | If the table item is a configuration, diagnostic, or presistent diagnostic. See FLEX_DiagConfType. |
◆ FLEX_DIAG_CONF_TABLE_I32_ADD
#define FLEX_DIAG_CONF_TABLE_I32_ADD |
( |
| id, |
|
|
| name, |
|
|
| default_value, |
|
|
| type ) |
Value: { id, FLEX_DIAG_CONF_VALUE_TAG_I32, type, 0, name, (void *)default_value }
Adds a signed integer to the diagnostic and configuration table
- Parameters
-
id | The id of diagnostic or configuration of type FLEX_DiagConfID. |
name | The name of diagnostic or configuration. |
default_value | The default_value of the diagnostic or configuration. |
type | If the table item is a configuration, diagnostic, or presistent diagnostic. See FLEX_DiagConfType. |
◆ FLEX_DIAG_CONF_TABLE_STR_ADD
#define FLEX_DIAG_CONF_TABLE_STR_ADD |
( |
| id, |
|
|
| name, |
|
|
| default_value, |
|
|
| max_len, |
|
|
| type ) |
Value: { id, FLEX_DIAG_CONF_VALUE_TAG_STR, type, max_len, name, (void *)default_value }
Adds a string to the diagnostic and configuration table
- Parameters
-
id | The id of diagnostic or configuration of type FLEX_DiagConfID. |
name | The name of diagnostic or configuration. |
default_value | The default_value of the diagnostic or configuration. |
max_len | If the maximum length of the string that can be stored. |
type | If the table item is a configuration, diagnostic, or presistent diagnostic. See FLEX_DiagConfType. |
◆ FLEX_DIAG_CONF_TABLE_TIME_ADD
#define FLEX_DIAG_CONF_TABLE_TIME_ADD |
( |
| id, |
|
|
| name, |
|
|
| default_value, |
|
|
| type ) |
Value: { id, FLEX_DIAG_CONF_VALUE_TAG_T32, type, 0, name, (void *)default_value }
Adds a timestamp to the diagnostic and configuration table
- Parameters
-
id | The id of diagnostic or configuration of type FLEX_DiagConfID. |
name | The name of diagnostic or configuration. |
default_value | The default_value of the diagnostic or configuration. |
type | If the table item is a configuration, diagnostic, or presistent diagnostic. See FLEX_DiagConfType. |
◆ FLEX_DIAG_CONF_TABLE_U32_ADD
#define FLEX_DIAG_CONF_TABLE_U32_ADD |
( |
| id, |
|
|
| name, |
|
|
| default_value, |
|
|
| type ) |
Value: { id, FLEX_DIAG_CONF_VALUE_TAG_U32, type, 0, name, (void *)default_value }
Adds a unsigned integer to the diagnostic and configuration table
- Parameters
-
id | The id of diagnostic or configuration of type FLEX_DiagConfID. |
name | The name of diagnostic or configuration. |
default_value | The default_value of the diagnostic or configuration. |
type | If the table item is a configuration, diagnostic, or presistent diagnostic. See FLEX_DiagConfType. |
◆ FLEX_DiagConfValueNotifyHandler
typedef void(* FLEX_DiagConfValueNotifyHandler) (const void *const value) |
Diagnostics or Configuration Notify Function Pointer Declaration.
- Parameters
-
value | The new value of the diagnostic or configuration. |
◆ FLEX_DiagConfID
Diagnostics and Configurations IDs.
Enumerator |
---|
FLEX_DIAG_CONF_ID_USER_0 | Diagnostics or Configuration ID 0.
|
FLEX_DIAG_CONF_ID_USER_1 | Diagnostics or Configuration ID 1.
|
FLEX_DIAG_CONF_ID_USER_2 | Diagnostics or Configuration ID 2.
|
FLEX_DIAG_CONF_ID_USER_3 | Diagnostics or Configuration ID 3.
|
FLEX_DIAG_CONF_ID_USER_4 | Diagnostics or Configuration ID 4.
|
FLEX_DIAG_CONF_ID_USER_5 | Diagnostics or Configuration ID 5.
|
FLEX_DIAG_CONF_ID_USER_6 | Diagnostics or Configuration ID 6.
|
FLEX_DIAG_CONF_ID_USER_7 | Diagnostics or Configuration ID 7.
|
FLEX_DIAG_CONF_ID_USER_8 | Diagnostics or Configuration ID 8.
|
FLEX_DIAG_CONF_ID_USER_9 | Diagnostics or Configuration ID 9.
|
FLEX_DIAG_CONF_ID_USER_10 | Diagnostics or Configuration ID 10.
|
FLEX_DIAG_CONF_ID_USER_11 | Diagnostics or Configuration ID 11.
|
FLEX_DIAG_CONF_ID_USER_12 | Diagnostics or Configuration ID 12.
|
FLEX_DIAG_CONF_ID_USER_13 | Diagnostics or Configuration ID 13.
|
FLEX_DIAG_CONF_ID_USER_14 | Diagnostics or Configuration ID 14.
|
FLEX_DIAG_CONF_ID_USER_15 | Diagnostics or Configuration ID 15.
|
FLEX_DIAG_CONF_ID_USER_MAX | Diagnostics or Configuration MAX ID.
|
◆ FLEX_DiagConfType
The type of diagnostic or configuration item.
Enumerator |
---|
FLEX_DIAG_CONF_TYPE_CONF | Configuration Type - Read/Write value while the application is running
|
FLEX_DIAG_CONF_TYPE_DIAG | Diagnostic Type - Read only value that is cleared on reset.
|
FLEX_DIAG_CONF_TYPE_PERSIST_DIAG | Persistent Diagnostic Type - Read only value that is not cleared on reset.
|
◆ FLEX_DiagConfValueWrite()
int FLEX_DiagConfValueWrite |
( |
const FLEX_DiagConfID | id, |
|
|
const void *const | value ) |
Writes the diagnostic or configuration value.
- Parameters
-
id | The id of the diagnostic or configuration. |
value | The diagnostic or configuration value to write. |
- Returns
- FLEX_SUCCESS (0) if succeeded and < 0 if failed.
- Return values
-
-FLEX_ERROR_ENOTRECOVERABLE | BLE module comms in a unrecoverable state. |
-FLEX_ERROR_EPROTO | BLE module comms protocol error most likely a version miss match. |
-FLEX_ERROR_ECOMM | Failed to communicate with the BLE module. |
-FLEX_ERROR_EINVAL | Supplied a id that is out of range. |
-FLEX_ERROR_ENXIO | Supplied a id with no corresponding table entry. |
◆ FLEX_DiagConfValueRead()
Reads the diagnostic or configuration value.
- Parameters
-
id | The id of the diagnostic or configuration. |
value | The diagnostic or configuration value to read. |
- Returns
- FLEX_SUCCESS (0) if succeeded and < 0 if failed.
- Return values
-
-FLEX_ERROR_ENOTRECOVERABLE | BLE module comms in a unrecoverable state. |
-FLEX_ERROR_EPROTO | BLE module comms protocol error most likely a version miss match. |
-FLEX_ERROR_ECOMM | Failed to communicate with the BLE module. |
-FLEX_ERROR_EINVAL | Supplied a id that is out of range. |
-FLEX_ERROR_ENXIO | Supplied a id with no corresponding table entry. |
◆ FLEX_DiagConfValueNotifyHandlerSet()
Adds an event handler for when the given diagnostic or configuration value changes.
- Note
- There can only be one handler subscribed to the event at a time, so passing in a new handler will remove current one.
- Parameters
-
id | The id of the diagnostic or configuration. |
handler | the event handler to be called on diagnostic or configuration change. |
- Returns
- FLEX_SUCCESS (0) if succeeded and < 0 if failed.
- Return values
-
-FLEX_ERROR_EINVAL | Supplied a id that is out of range. |
-FLEX_ERROR_ENXIO | Supplied a id with no corresponding table entry. |