This component serves as a helper to generate the text content of the first NDEF message.
It facilitates generation of:
- Status string: presenting the Therapy status.
- Intake string: presenting the data about a pill removal.
◆ TEXT_STATUS_LENGTH
#define TEXT_STATUS_LENGTH (94) |
The maximum length of the status string
◆ TEXT_POS_INTAKE_LENGTH
#define TEXT_POS_INTAKE_LENGTH (24) |
The length of a single intake string
◆ TEXT_NPOS_INTAKE_LENGTH
#define TEXT_NPOS_INTAKE_LENGTH (31) |
The length of a single intake string
◆ Text_StatusNotStarted()
char* Text_StatusNotStarted |
( |
void |
| ) |
|
Generate the status string for a therapy which is not yet started.
- Returns
- a pointer to memory address where the status string can be read. The memory contents remain valid until a next call to any text API call.
◆ Text_StatusStopped()
char* Text_StatusStopped |
( |
uint32_t |
startTime, |
|
|
uint32_t |
lastIntakeTime |
|
) |
| |
Generate the status string for a therapy which is stopped (all pills taken).
- Parameters
-
startTime | : epoch time at which the therapy was started. |
lastIntakeTime | : epoch time at which the last pill removal was sensed. |
- Returns
- pointer to memory address where the status string can be read. The memory contents remain valid until a next call to any text API call.
◆ Text_StatusOngoing()
char* Text_StatusOngoing |
( |
uint32_t |
startTime, |
|
|
uint32_t |
now, |
|
|
int |
pillsRemaining |
|
) |
| |
Generate the status string for a therapy which is ongoing.
- Parameters
-
startTime | : epoch time at which the therapy was started. |
now | : current epoch time. |
pillsRemaining | : The current remaining pills. |
- Returns
- a pointer to memory address where the status string can be read. The memory contents remain valid until a next call to any text API call.
◆ Text_IntakePositional()
char* Text_IntakePositional |
( |
uint32_t |
startTime, |
|
|
uint32_t |
intakeTime, |
|
|
int |
group, |
|
|
int |
position |
|
) |
| |
Prepares a string describing a positional pill removal moment.
- Parameters
-
startTime | : The time at which the therapy started. |
intakeTime | : The time at which the pill was taken. |
group | : Group containing the pill. |
position | : The position of the taken pill in the group . |
- Returns
- A pointer to the start of the prepared string. The memory contents remain valid until a next call to this API call.
◆ Text_IntakeNonPositional()
char* Text_IntakeNonPositional |
( |
uint32_t |
startTime, |
|
|
uint32_t |
intakeTime, |
|
|
int |
group, |
|
|
int |
removal |
|
) |
| |
Prepares a string describing a non positional pill removal moment.
- Parameters
-
startTime | : The time at which the therapy started. |
intakeTime | : The time at which the pill was taken. |
group | : Group containing the pill. |
removal | : The removal number. |
- Returns
- A pointer to the start of the prepared string. The memory contents remain valid until a next call to this API call.