A series of utilities that used throughout tcMenu. More...
Go to the source code of this file.
Classes | |
struct | ConnectorLocalInfo |
Functions | |
uint32_t | getBoardSerialNumber () |
void | showVersionDialog (const ConnectorLocalInfo *localInfo) |
AnyMenuInfo * | newAnyMenuInfoP (const char *name, menuid_t id, uint16_t eeprom, MenuCallbackFn cb, uint16_t max=0) |
AnyMenuInfo * | newAnyMenuInfo (const char *name, menuid_t id, uint16_t eeprom, MenuCallbackFn cb, uint16_t max=0) |
AnalogMenuInfo * | newAnalogMenuInfoP (const char *name, menuid_t id, uint16_t eeprom, MenuCallbackFn cb, uint16_t max, uint16_t offset, uint16_t divisor, const char *unit) |
AnalogMenuInfo * | newAnalogMenuInfo (const char *name, menuid_t id, uint16_t eeprom, MenuCallbackFn cb, uint16_t max, uint16_t offset, uint16_t divisor, const char *unit) |
BooleanMenuInfo * | newBooleanMenuInfoP (const char *name, menuid_t id, uint16_t eeprom, MenuCallbackFn cb, BooleanNaming naming) |
BooleanMenuInfo * | newBooleanMenuInfo (const char *name, menuid_t id, uint16_t eeprom, MenuCallbackFn cb, BooleanNaming naming) |
FloatMenuInfo * | newFloatMenuInfoP (const char *name, menuid_t id, uint16_t eeprom, MenuCallbackFn cb, int decimalPlaces) |
FloatMenuInfo * | newFloatMenuInfo (const char *name, menuid_t id, uint16_t eeprom, MenuCallbackFn cb, int decimalPlaces) |
uint8_t | safeProgCpy (char *dst, const char *pgmSrc, uint8_t size) |
char * | potentialProgramMemory (const char *x) |
Variables | |
char | szGlobalBuffer [] |
A series of utilities that used throughout tcMenu.
struct ConnectorLocalInfo |
uint32_t getBoardSerialNumber | ( | ) |
Provides the serial number for the board, it can be displayed and also used in remote JOIN messages to identify the board uniquiely by UUID and serial number.
If you want to use the default implementation you can define flag TC_BOARD_SERIAL_NO to a long int value that will be stored as a constant in memory.
If you want to have a custom implementation, define TC_MANUAL_SERIAL_NO_IMPL and then you must implement this method yourself instead. This function should not take undue time if implemented by you as it could block networking.
void showVersionDialog | ( | const ConnectorLocalInfo * | localInfo | ) |
Show the TcMenu version in a dialog that can be dismissed
localInfo | the local app information |
AnyMenuInfo* newAnyMenuInfoP | ( | const char * | name, |
menuid_t | id, | ||
uint16_t | eeprom, | ||
MenuCallbackFn | cb, | ||
uint16_t | max = 0 |
||
) |
Create a menu info structure using the new operator for the given parameters, max value is optional
name | the name to copy from RAM not PGM |
id | the ID to give the info block |
eeprom | the eerprom position or -1 |
cb | the callback to apply or nullptr |
max | optional the max value |
AnyMenuInfo* newAnyMenuInfo | ( | const char * | name, |
menuid_t | id, | ||
uint16_t | eeprom, | ||
MenuCallbackFn | cb, | ||
uint16_t | max = 0 |
||
) |
Create a menu info structure using the new operator for the given parameters, max value is optional
name | the name to copy from RAM |
id | the ID to give the info block |
eeprom | the eerprom position or -1 |
cb | the callback to apply or nullptr |
max | optional the max value |
AnalogMenuInfo* newAnalogMenuInfoP | ( | const char * | name, |
menuid_t | id, | ||
uint16_t | eeprom, | ||
MenuCallbackFn | cb, | ||
uint16_t | max, | ||
uint16_t | offset, | ||
uint16_t | divisor, | ||
const char * | unit | ||
) |
Create a menu info structure using the new operator for the given parameters, it populates all the fields for an analog item dynamically
name | the name to copy from PGM |
id | the ID to give the info block |
eeprom | the eerprom position or -1 |
cb | the callback to apply or nullptr |
max | optional the max value |
offset | the offset to apply |
divisor | the divisor to apply |
unit | the unit to copy from PGM |
AnalogMenuInfo* newAnalogMenuInfo | ( | const char * | name, |
menuid_t | id, | ||
uint16_t | eeprom, | ||
MenuCallbackFn | cb, | ||
uint16_t | max, | ||
uint16_t | offset, | ||
uint16_t | divisor, | ||
const char * | unit | ||
) |
Create a menu info structure using the new operator for the given parameters, it populates all the fields for an analog item dynamically
name | the name to copy from RAM |
id | the ID to give the info block |
eeprom | the eerprom position or -1 |
cb | the callback to apply or nullptr |
max | optional the max value |
offset | the offset to apply |
divisor | the divisor to apply |
unit | the unit to copy from RAM |
BooleanMenuInfo* newBooleanMenuInfoP | ( | const char * | name, |
menuid_t | id, | ||
uint16_t | eeprom, | ||
MenuCallbackFn | cb, | ||
BooleanNaming | naming | ||
) |
Create a menu info structure using the new operator for the given parameters, it populates all the fields for a boolean item dynamically
name | the name to copy from PGM |
id | the ID to give the info block |
eeprom | the eerprom position or -1 |
cb | the callback to apply or nullptr |
naming | the naming type to use |
BooleanMenuInfo* newBooleanMenuInfo | ( | const char * | name, |
menuid_t | id, | ||
uint16_t | eeprom, | ||
MenuCallbackFn | cb, | ||
BooleanNaming | naming | ||
) |
Create a menu info structure using the new operator for the given parameters, it populates all the fields for a boolean item dynamically
name | the name to copy from RAM |
id | the ID to give the info block |
eeprom | the eerprom position or -1 |
cb | the callback to apply or nullptr |
naming | the naming type to use |
FloatMenuInfo* newFloatMenuInfoP | ( | const char * | name, |
menuid_t | id, | ||
uint16_t | eeprom, | ||
MenuCallbackFn | cb, | ||
int | decimalPlaces | ||
) |
Create a menu info structure using the new operator for the given parameters, it populates all the fields for a float item dynamically
name | the name to copy from PGM |
id | the ID to give the info block |
eeprom | the eerprom position or -1 |
cb | the callback to apply or nullptr |
decimalPlaces | the number of DP to display |
FloatMenuInfo* newFloatMenuInfo | ( | const char * | name, |
menuid_t | id, | ||
uint16_t | eeprom, | ||
MenuCallbackFn | cb, | ||
int | decimalPlaces | ||
) |
Create a menu info structure using the new operator for the given parameters, it populates all the fields for a float item dynamically
name | the name to copy from RAM |
id | the ID to give the info block |
eeprom | the eerprom position or -1 |
cb | the callback to apply or nullptr |
decimalPlaces | the number of DP to display |
uint8_t safeProgCpy | ( | char * | dst, |
const char * | pgmSrc, | ||
uint8_t | size | ||
) |
This is always safe to call, if there's a string that's in program mem on AVR but not on other boards, this always does the right thing.
dst | the destination buffer |
pgmSrc | the source to be copied (program mem on AVR) |
size | the size of dst. |