PES 4 - Smart Medication Dispenser / PES4_ProgrammeforDesignReview2

Dependencies:   SDFileSystem mbed

Fork of PES4_Programme by PES 4 - Smart Medication Dispenser

Committer:
itslinear
Date:
Sun Apr 08 10:43:33 2018 +0000
Revision:
80:6e3eb8246ced
Parent:
77:c2e22d1e5d44
Child:
81:a869abf56e85
tried to read files

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cittecla 51:a98ffbd41e76 1 #pragma once
cittecla 51:a98ffbd41e76 2 #include "SDFileSystem.h"
cittecla 51:a98ffbd41e76 3 #include "mbed.h"
cittecla 53:1c61cadbcb35 4 #include "variables.h"
cittecla 51:a98ffbd41e76 5
cittecla 53:1c61cadbcb35 6 #define STR_LEN 32
cittecla 53:1c61cadbcb35 7 #define TOKEN ";"
cittecla 51:a98ffbd41e76 8
cittecla 51:a98ffbd41e76 9 void writeTest();
cittecla 51:a98ffbd41e76 10 void readTest();
cittecla 51:a98ffbd41e76 11 void testSd();
itslinear 64:ca667234c845 12
cittecla 53:1c61cadbcb35 13 s_user readMedication(int user);
itslinear 64:ca667234c845 14 int writeMedication(int user,s_user userfile);
cittecla 51:a98ffbd41e76 15
itslinear 66:0d43bd7ed179 16
itslinear 66:0d43bd7ed179 17 /* Write medication protocol to sd card
itslinear 66:0d43bd7ed179 18 * @param: user -> 0 or 1
itslinear 66:0d43bd7ed179 19 * @param: s_time medicationTime -> planned time
itslinear 66:0d43bd7ed179 20 * @param: s_time outputTime -> current time
itslinear 66:0d43bd7ed179 21 * @param: s_medContainer -> number of each pill
itslinear 66:0d43bd7ed179 22 * @param: success -> output=1 / no-output=0
itslinear 66:0d43bd7ed179 23 */
itslinear 66:0d43bd7ed179 24 int write_medProtocol(s_time medicationTime, s_time outputTime, s_medContainer medication, int success, char user);
itslinear 66:0d43bd7ed179 25
itslinear 66:0d43bd7ed179 26 /* Delete medication protocol from sd card
itslinear 66:0d43bd7ed179 27 */
itslinear 77:c2e22d1e5d44 28 int erase_medProtocol();
itslinear 66:0d43bd7ed179 29
itslinear 66:0d43bd7ed179 30 /* Write inventory protocol to sd card / Note first read_medInventory then ajust the numbers (stock - output) and then write them back to the protocol
itslinear 66:0d43bd7ed179 31 * @param: s_medContainer -> number of each pill in stock
itslinear 66:0d43bd7ed179 32 * @param: s_time -> current time
itslinear 66:0d43bd7ed179 33 * @param: char med1-med6 -> name of each pill
itslinear 66:0d43bd7ed179 34 */
itslinear 80:6e3eb8246ced 35 //int write_medInventory(s_medContainer medInventory, s_time currentTime, char med1[], char med2[], char med3[], char med4[], char med5[], char med6[]);
itslinear 80:6e3eb8246ced 36 int write_medInventory(s_medInventory);
itslinear 66:0d43bd7ed179 37
itslinear 66:0d43bd7ed179 38 /* Write occuring error to sd card protocol
itslinear 73:7fd3701def5b 39 * @param: fail -> error string
itslinear 66:0d43bd7ed179 40 * @param: s_time -> current time
itslinear 66:0d43bd7ed179 41 */
itslinear 73:7fd3701def5b 42 int write_medError(char fail[], s_time time);
itslinear 66:0d43bd7ed179 43
itslinear 66:0d43bd7ed179 44 /* Delete error protocol from sd card
itslinear 66:0d43bd7ed179 45 */
itslinear 77:c2e22d1e5d44 46 int erase_medError();
itslinear 66:0d43bd7ed179 47
itslinear 80:6e3eb8246ced 48 /* Read medication protocol from sd card to buffer
itslinear 66:0d43bd7ed179 49 * @param: user -> 0 or 1
itslinear 66:0d43bd7ed179 50 */
itslinear 80:6e3eb8246ced 51 char *read_medProtocol(char user);
itslinear 65:49eb0934f772 52
itslinear 80:6e3eb8246ced 53 /* Read inventory protocol from sd card to struct s_medInventory
itslinear 66:0d43bd7ed179 54 */
itslinear 80:6e3eb8246ced 55 s_medInventory read_medInventory();
itslinear 65:49eb0934f772 56
itslinear 66:0d43bd7ed179 57 /* Read error protocol from sd card
itslinear 66:0d43bd7ed179 58 */
itslinear 64:ca667234c845 59 char read_medError();
itslinear 66:0d43bd7ed179 60