From: John Hodge Date: Sun, 16 Jan 2011 09:04:14 +0000 (+0800) Subject: Added database structure, moved planning to notes/ X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=6b194d420f1554ace61a251f2c416712d68ab633;p=tpg%2Fopendispense2.git Added database structure, moved planning to notes/ --- diff --git a/Coke machine log.txt b/Coke machine log.txt deleted file mode 100644 index e09a6a3..0000000 --- a/Coke machine log.txt +++ /dev/null @@ -1,446 +0,0 @@ -:Address ErroHello cruel world! - -UCC Coke Machine controller is alive! - - -door1 -:s -slot 0 b3M* - - - - -�� :full 03 sold -slot 1 :full 30 sold -slot 2 :full 21 sold -slot 3 :full 20 sold -slot 4 :full 20 sold -slot 5 :full 22 sold -slot 6 `ludme - 8 :full 28 sold - -:Min4 -: -: -:n6 foo -ok - -:s -slot 0 b3M* - - - - - -�� :full 03 sold -slot 1 :full 30 sold -slot 2 :full 21 sold -slot 3 :full 20 sold -slot 4 :full 20 sold -slot 5 :full 22 sold -slot 6 foo :full 28 sold - -:Min4n0 fg -:s -slot 0 b3M* - - - - - - - - - - - -�� :full 03 sold -slot 1 :full 30 sold -slot 2 :full 21 sold -slot 3 :full 20 sold -slot 4 :full 20 sold -slot 5 :full 22 sold -slot 6 foo :full 28 sold - -:Min4d7 -:s -slot 0 b3M* - - - - - - - - - - - -�� :full 03 sold -slot 1 :full 30 sold -slot 2 :full 21 sold -slot 3 :full 20 sold -slot 4 :full 20 sold -slot 5 :full 22 sold -slot 6 foo :full 28 sold - -:Min4d7 -:d7 -ok - -:s7 -ok - -:s -slot 0 b3M* - - - - - -�� :full 03 sold -slot 1 :full 30 sold -slot 2 :full 21 sold -slot 3 :full 20 sold -slot 4 :full 20 sold -slot 5 :full 22 sold -slot 6 foo :full 28 sold - -:Min4d7 -:d7 -ok - -:s -slot 0 b3M* - -s+--------------------[Modem and dialing parameter setup]---------------------+ -s| | -s| A - Init string ......... | -s| B - Reset string ........ ^M~ATZ^M~ | -s| C - Dialing prefix #1.... ATDT | -s| D - Dialing suffix #1.... ^M | - | E - Dialing prefix #2.... ATDP | -:| F - Dialing suffix #2.... ^M | -slot 1 :full 30 sold -slot 2 :full 21 sold -slot 3 :full 20 sold -slot 4 :full 20 sold -slot 5 :full 22 sold -slot 6 foo :full 28 sold - -:Min4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Hello cruel world! - -UCC Coke Machine controller is alive! - - -door1 -:p - - - - - - - - - - - - - - - CTRL-A Z for help | 9600 8N1 | NOR | Minicom 2.4 | VT102 | Offline -root@sonata:/home/tpg# picocom -No port given -root@sonata:/home/tpg# picocom /dev/ttyUSB0 -picocom v1.4 - -port is : /dev/ttyUSB0 -flowcontrol : none -baudrate is : 9600 -parity is : none -databits are : 8 -escape is : C-a -noinit is : no -noreset is : no -nolock is : no -send_cmd is : ascii_xfr -s -v -l10 -receive_cmd is : rz -vv - -Terminal ready - -: -:s -slot 0 b3M* - �� :full 03 sold -slot 1 :full 30 sold -slot 2 :full 21 sold -slot 3 :full 20 sold -slot 4 :full 20 sold -slot 5 :full 22 sold -slot 6 foo :full 28 sold - -:d7 -ok - -:s -slot 0 b3M* - �� :full 03 sold -slot 1 :full 30 sold -slot 2 :full 21 sold -slot 3 :full 20 sold -slot 4 :full 20 sold -slot 5 :full 22 sold -slot 6 foo :full 28 sold - -:Address Erro -Thanks for using picocom -root@sonata:/home/tpg# picocom /dev/ttyUSB0 -picocom v1.4 - -port is : /dev/ttyUSB0 -flowcontrol : none -baudrate is : 9600 -parity is : none -databits are : 8 -escape is : C-a -noinit is : no -noreset is : no -nolock is : no -send_cmd is : ascii_xfr -s -v -l10 -receive_cmd is : rz -vv - -Terminal ready - -:s -slot 0  :full 00 sold -slot 1 @�PY�" ' :full 10 sold -slot 2 :full 00 sold -slot 3 :full 00 sold -slot 4  :full 00 sold -slot 5 :full 02 sold -slot 6 `lU�lngK8 :full 08 sold - -:d7 -ok - -:s -slot 0  :full 00 sold -slot 1 @�PY�" ' :full 10 sold -slot 2 :full 00 sold -slot 3 :full 00 sold -slot 4  :full 00 sold -slot 5 :full 02 sold -slot 6 `lU�lngK8 :full 08 sold - -:d7 -ok - -:d7 -ok - -:d7 -ok - -:s -slot 0  :full 00 sold -slot 1 @�PY�" ' :full 10 sold -slot 2 :full 00 sold -slot 3 :full 00 sold -slot 4  :full 00 sold -slot 5 :full 02 sold -slot 6 `lU�lngK8 :full 08 sold - -:n6 coke -ok - -:s -slot 0  :full 00 sold -slot 1 @�PY�" ' :full 10 sold -slot 2 :full 00 sold -slot 3 :full 00 sold -slot 4  :full 00 sold -slot 5 :full 02 sold -slot 6 coke :full 08 sold - -:n0 screaming sofad -ok - -:s -slot 0 screaming sofad :full 00 sold -slot 1 d :full 7F sold -slot 2 :full 20 sold -slot 3 :full 20 sold -slot 4 :full 20 sold -slot 5 :full 20 sold -slot 6 :full 20 sold - -:n0 screaming soda -ok - -:s -slot 0 screaming soda :full 00 sold -slot 1 :full 20 sold -slot 2 :full 20 sold -slot 3 :full 20 sold -slot 4 :full 20 sold -slot 5 :full 20 sold -slot 6 :full 20 sold - -:n0 soda -ok - -:s -slot 0 soda :full 00 sold -slot 1 :full 20 sold -slot 2 :full 20 sold -slot 3 :full 20 sold -slot 4 :full 20 sold -slot 5 :full 20 sold -slot 6 :full 20 sold - -:[5~d7 -:d7 -ok - -:d7 -ok - -:s -slot 0 soda :full 00 sold -slot 1 " :full 20 sold -slot 2 " :full 20 sold -slot 3 " :full 20 sold -slot 4 " :full 20 sold -slot 5 " :full 20 sold -slot 6 " :full 20 sold - -:Address ErrHello cruel world! - -UCC Coke Machine controller is alive! - - -door1 -:s -slot 0 ��(�g�E :full 01 sold -slot 1 @�PY� $' :full 10 sold -slot 2 :full 00 sold -slot 3 :full 00 sold -slot 4  :full 20 sold -slot 5 @l�����A :full 02 sold -slot 6 `lU�l~gK8 :full 08 sold - -:n0 sod -ok - -:s -slot 0 sod :full 01 sold -slot 1 @�PY� $' :full 10 sold -slot 2 :full 00 sold -slot 3 :full 00 sold -slot 4  :full 20 sold -slot 5 @l�����A :full 02 sold -slot 6 `lU�l~gK8 :full 08 sold - -:n1 green -ok - -:s -slot 0 sod :full 01 sold -slot 1 green :full 10 sold -slot 2 :full 00 sold -slot 3 :full 00 sold -slot 4  :full 20 sold -slot 5 @l�����A :full 02 sold -slot 6 `lU�l~gK8 :full 08 sold - -:n6 coke -ok - -:s -slot 0 sod :full 01 sold -slot 1 green :full 10 sold -slot 2 :full 00 sold -slot 3 :full 00 sold -slot 4  :full 20 sold -slot 5 @l�����A :full 02 sold -slot 6 coke :full 08 sold - -:n5 null coke -ok - -:s -slot 0 sod :full 01 sold -slot 1 green :full 10 sold -slot 2 :full 00 sold -slot 3 :full 00 sold -slot 4  :full 20 sold -slot 5 null coke :full 02 sold -slot 6 coke :full 08 sold - -:n2 solo -ok - -: -:n3 orange -ok - -:n4 lemondae -ok - -:n4 lemondde -ok - -:n4 lemonade -ok - -:s -slot 0 sod :full 01 sold -slot 1 green :full 10 sold -slot 2 solo :full 00 sold -slot 3 orange :full 00 sold -slot 4 lemonade :full 20 sold -slot 5 null coke :full 02 sold -slot 6 coke :full 08 sold - -: -: -Thanks for using picocom -root@sonata:/home/tpg# man picocom -root@sonata:/home/tpg# diff --git a/notes/Coke machine log.txt b/notes/Coke machine log.txt new file mode 100644 index 0000000..e09a6a3 --- /dev/null +++ b/notes/Coke machine log.txt @@ -0,0 +1,446 @@ +:Address ErroHello cruel world! + +UCC Coke Machine controller is alive! + + +door1 +:s +slot 0 b3M* + + + + +�� :full 03 sold +slot 1 :full 30 sold +slot 2 :full 21 sold +slot 3 :full 20 sold +slot 4 :full 20 sold +slot 5 :full 22 sold +slot 6 `ludme + 8 :full 28 sold + +:Min4 +: +: +:n6 foo +ok + +:s +slot 0 b3M* + + + + + +�� :full 03 sold +slot 1 :full 30 sold +slot 2 :full 21 sold +slot 3 :full 20 sold +slot 4 :full 20 sold +slot 5 :full 22 sold +slot 6 foo :full 28 sold + +:Min4n0 fg +:s +slot 0 b3M* + + + + + + + + + + + +�� :full 03 sold +slot 1 :full 30 sold +slot 2 :full 21 sold +slot 3 :full 20 sold +slot 4 :full 20 sold +slot 5 :full 22 sold +slot 6 foo :full 28 sold + +:Min4d7 +:s +slot 0 b3M* + + + + + + + + + + + +�� :full 03 sold +slot 1 :full 30 sold +slot 2 :full 21 sold +slot 3 :full 20 sold +slot 4 :full 20 sold +slot 5 :full 22 sold +slot 6 foo :full 28 sold + +:Min4d7 +:d7 +ok + +:s7 +ok + +:s +slot 0 b3M* + + + + + +�� :full 03 sold +slot 1 :full 30 sold +slot 2 :full 21 sold +slot 3 :full 20 sold +slot 4 :full 20 sold +slot 5 :full 22 sold +slot 6 foo :full 28 sold + +:Min4d7 +:d7 +ok + +:s +slot 0 b3M* + +s+--------------------[Modem and dialing parameter setup]---------------------+ +s| | +s| A - Init string ......... | +s| B - Reset string ........ ^M~ATZ^M~ | +s| C - Dialing prefix #1.... ATDT | +s| D - Dialing suffix #1.... ^M | + | E - Dialing prefix #2.... ATDP | +:| F - Dialing suffix #2.... ^M | +slot 1 :full 30 sold +slot 2 :full 21 sold +slot 3 :full 20 sold +slot 4 :full 20 sold +slot 5 :full 22 sold +slot 6 foo :full 28 sold + +:Min4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Hello cruel world! + +UCC Coke Machine controller is alive! + + +door1 +:p + + + + + + + + + + + + + + + CTRL-A Z for help | 9600 8N1 | NOR | Minicom 2.4 | VT102 | Offline +root@sonata:/home/tpg# picocom +No port given +root@sonata:/home/tpg# picocom /dev/ttyUSB0 +picocom v1.4 + +port is : /dev/ttyUSB0 +flowcontrol : none +baudrate is : 9600 +parity is : none +databits are : 8 +escape is : C-a +noinit is : no +noreset is : no +nolock is : no +send_cmd is : ascii_xfr -s -v -l10 +receive_cmd is : rz -vv + +Terminal ready + +: +:s +slot 0 b3M* + �� :full 03 sold +slot 1 :full 30 sold +slot 2 :full 21 sold +slot 3 :full 20 sold +slot 4 :full 20 sold +slot 5 :full 22 sold +slot 6 foo :full 28 sold + +:d7 +ok + +:s +slot 0 b3M* + �� :full 03 sold +slot 1 :full 30 sold +slot 2 :full 21 sold +slot 3 :full 20 sold +slot 4 :full 20 sold +slot 5 :full 22 sold +slot 6 foo :full 28 sold + +:Address Erro +Thanks for using picocom +root@sonata:/home/tpg# picocom /dev/ttyUSB0 +picocom v1.4 + +port is : /dev/ttyUSB0 +flowcontrol : none +baudrate is : 9600 +parity is : none +databits are : 8 +escape is : C-a +noinit is : no +noreset is : no +nolock is : no +send_cmd is : ascii_xfr -s -v -l10 +receive_cmd is : rz -vv + +Terminal ready + +:s +slot 0  :full 00 sold +slot 1 @�PY�" ' :full 10 sold +slot 2 :full 00 sold +slot 3 :full 00 sold +slot 4  :full 00 sold +slot 5 :full 02 sold +slot 6 `lU�lngK8 :full 08 sold + +:d7 +ok + +:s +slot 0  :full 00 sold +slot 1 @�PY�" ' :full 10 sold +slot 2 :full 00 sold +slot 3 :full 00 sold +slot 4  :full 00 sold +slot 5 :full 02 sold +slot 6 `lU�lngK8 :full 08 sold + +:d7 +ok + +:d7 +ok + +:d7 +ok + +:s +slot 0  :full 00 sold +slot 1 @�PY�" ' :full 10 sold +slot 2 :full 00 sold +slot 3 :full 00 sold +slot 4  :full 00 sold +slot 5 :full 02 sold +slot 6 `lU�lngK8 :full 08 sold + +:n6 coke +ok + +:s +slot 0  :full 00 sold +slot 1 @�PY�" ' :full 10 sold +slot 2 :full 00 sold +slot 3 :full 00 sold +slot 4  :full 00 sold +slot 5 :full 02 sold +slot 6 coke :full 08 sold + +:n0 screaming sofad +ok + +:s +slot 0 screaming sofad :full 00 sold +slot 1 d :full 7F sold +slot 2 :full 20 sold +slot 3 :full 20 sold +slot 4 :full 20 sold +slot 5 :full 20 sold +slot 6 :full 20 sold + +:n0 screaming soda +ok + +:s +slot 0 screaming soda :full 00 sold +slot 1 :full 20 sold +slot 2 :full 20 sold +slot 3 :full 20 sold +slot 4 :full 20 sold +slot 5 :full 20 sold +slot 6 :full 20 sold + +:n0 soda +ok + +:s +slot 0 soda :full 00 sold +slot 1 :full 20 sold +slot 2 :full 20 sold +slot 3 :full 20 sold +slot 4 :full 20 sold +slot 5 :full 20 sold +slot 6 :full 20 sold + +:[5~d7 +:d7 +ok + +:d7 +ok + +:s +slot 0 soda :full 00 sold +slot 1 " :full 20 sold +slot 2 " :full 20 sold +slot 3 " :full 20 sold +slot 4 " :full 20 sold +slot 5 " :full 20 sold +slot 6 " :full 20 sold + +:Address ErrHello cruel world! + +UCC Coke Machine controller is alive! + + +door1 +:s +slot 0 ��(�g�E :full 01 sold +slot 1 @�PY� $' :full 10 sold +slot 2 :full 00 sold +slot 3 :full 00 sold +slot 4  :full 20 sold +slot 5 @l�����A :full 02 sold +slot 6 `lU�l~gK8 :full 08 sold + +:n0 sod +ok + +:s +slot 0 sod :full 01 sold +slot 1 @�PY� $' :full 10 sold +slot 2 :full 00 sold +slot 3 :full 00 sold +slot 4  :full 20 sold +slot 5 @l�����A :full 02 sold +slot 6 `lU�l~gK8 :full 08 sold + +:n1 green +ok + +:s +slot 0 sod :full 01 sold +slot 1 green :full 10 sold +slot 2 :full 00 sold +slot 3 :full 00 sold +slot 4  :full 20 sold +slot 5 @l�����A :full 02 sold +slot 6 `lU�l~gK8 :full 08 sold + +:n6 coke +ok + +:s +slot 0 sod :full 01 sold +slot 1 green :full 10 sold +slot 2 :full 00 sold +slot 3 :full 00 sold +slot 4  :full 20 sold +slot 5 @l�����A :full 02 sold +slot 6 coke :full 08 sold + +:n5 null coke +ok + +:s +slot 0 sod :full 01 sold +slot 1 green :full 10 sold +slot 2 :full 00 sold +slot 3 :full 00 sold +slot 4  :full 20 sold +slot 5 null coke :full 02 sold +slot 6 coke :full 08 sold + +:n2 solo +ok + +: +:n3 orange +ok + +:n4 lemondae +ok + +:n4 lemondde +ok + +:n4 lemonade +ok + +:s +slot 0 sod :full 01 sold +slot 1 green :full 10 sold +slot 2 solo :full 00 sold +slot 3 orange :full 00 sold +slot 4 lemonade :full 20 sold +slot 5 null coke :full 02 sold +slot 6 coke :full 08 sold + +: +: +Thanks for using picocom +root@sonata:/home/tpg# man picocom +root@sonata:/home/tpg# diff --git a/notes/Database Structure.txt b/notes/Database Structure.txt new file mode 100644 index 0000000..9365b45 --- /dev/null +++ b/notes/Database Structure.txt @@ -0,0 +1,19 @@ + +User + INTEGER UserID + STRING Username + + STRING PasswordHash ; < Hmm... needed? + INTEGER PinCode + + INTEGER Balance + DATETIME LastSeen + BOOL bEnabled + BOOL bCokeMember + BOOL bWheelMember + BOOL bInternal + + +Card -> User + STRING CardID + INTEGER UserID diff --git a/notes/plan.txt b/notes/plan.txt new file mode 100644 index 0000000..ec1d543 --- /dev/null +++ b/notes/plan.txt @@ -0,0 +1,17 @@ + +Central "dispense" server +- Accounting Section + > Linking to a static libary for the cokebank + + int AlterBalance(UID, int Delta) + + int GetBalance(UID) +- Device Control Section + > Snack - Controls Vending Machine and accepts logins + > Coke - Controls Coke Machine + > Misc Server + - int Dispense(int ID, int UID) +- Remote Control + > Accepts commands from dispense app. + - See `proto.txt` + + +Extra notes, see http://wiki.ucc.asn.au/OpenDispense2 diff --git a/notes/proto.txt b/notes/proto.txt new file mode 100644 index 0000000..c27ff06 --- /dev/null +++ b/notes/proto.txt @@ -0,0 +1,81 @@ +OpenDispense^2 +Client/Server Dispense Protocol + +The protocol is ASCII based, similar to the FTP protocol +All server responses are on one line and are prefixed by a three digit response code. + +== Response Codes == +100 Information +200 Command succeeded, no extra information +201 Command succeeded, multiple lines follow () +202 Command succeeded, per-command format +400 Unknown Command +401 Not Authenticated (or Authentication failure) +402 Balance insufficient +403 User not allowed to perform this action +404 Bad other username +406 Bad Item ID +407 Invalid arguments +500 Unknown Dispense Failure +501 Action Rejected + +== Item IDs == + represents the item ID +Item IDs are allowed to contain any non-whitespace character, but in +general they will be limited to the standard alpha-numeric set + +=== User Auth === +c USER \n +s 100 SALT \n or 100 User Set\n (If no salt used) +c PASS \n (Hex-Encoded SHA-1 Hash of ) +s 200 Auth OK\n or 401 Auth Failure\n +User is now authenticated +--- Alternate Method (Implicit Trust Authentication) --- +If the client is connecting from a trusted machine on a root port then +automatic authentication is allowed +c AUTOAUTH \n +s 200 Auth OK\n or 404 Bad Username\n or 401 Untrusted\n +--- Set effective user (User in `dispense -u`) --- +c SETEUSER \n +s 200 User set\n or 403 Not in coke\n or 404 User not found\n + +=== Commands === +--- Dispense an item --- +c DISPENSE \n +s 200 Dispense OK\n or 402 Poor You\n or 500 Dispense Error\n or 406 Bad Item\n +--- Give to another user --- +c GIVE \n +s 200 Give OK\n or 402 Poor You\n or 404 Bad User\n +--- Alter balance --- +c ADD \n +s 200 Add OK\n or 402 No balance\n or 403 Not Coke\n or 404 Bad User\n + +--- Get Item list --- +c ENUM_ITEMS\n +s 201 Items \n +s 202 Item \n + ... +s 200 List End\n +--- Get Item Information --- +c ITEM_INFO \n +s 202 Item \n + +--- Get Users' Balances --- + and can be '-' to indicate "none" +c ENUM_USERS[ []]\n +s 201 Users \n +s 202 User \n + ... +s 200 List End\n +--- Get a User's Balance --- +c USER_INFO\n +s 202 User \n + +--- Add a new user --- +c USER_ADD \n +s 200 User Added\n or 403 Not Wheel\n or 404 User Exists\n +--- Set user flags --- + is a comma-separated list of flag values (optionally preceded by + - to remove the flag) Valid values are: user,coke,wheel,meta,disabled,door +c USER_FLAGS \n +s 200 User Updated\n or 403 Not Wheel\n or 404 Bad User\n or 407 Unknown Flags\n diff --git a/notes/ui.txt b/notes/ui.txt new file mode 100644 index 0000000..44720d0 --- /dev/null +++ b/notes/ui.txt @@ -0,0 +1,48 @@ +Client UI Design + +Left/Right changes the item view (between Drink, Pseudo and Snack - and others if defined) + +Should the width of the display be fixed? +> Current width is 34 characters +Howabout the height? + + +Mockup: + Drink Display + + /----------- Dispense -----------\ + | 0 Lemon Foo 72 | + | 1 Orange Foo 71 | + | 2 Solo 73 | + | 3 Solo++ 75 | + | 4 V Black 75 | + | 5 null Coke 101 | + | 6 Coke 96 | + \--------------------------------/ + [drink] -pseudo- -snack- + + Pseudo Items + + /----------- Dispense -----------\ + | 0 Laserprint 10 | + | 1 Membership 2500 | + | 2 Clue 128 | + | 3 Phone 20 | + \--------------------------------/ + -drink- [pseudo] -snack- + + Snacks + + /----------- Dispense -----------\ + | 00 Smith's Salt+Vinegar 128 A + | 01 Unused 0 # + | 02 Something 0 | + | 03 Something 0 | + | 04 Something 0 | + | 05 Something 0 | + | 06 Something 0 | + | 07 Something 0 | + | --- --- V + \--------------------------------/ + [drink] -pseudo- -snack- + diff --git a/plan.txt b/plan.txt deleted file mode 100644 index cc67aba..0000000 --- a/plan.txt +++ /dev/null @@ -1,15 +0,0 @@ - -Central "dispense" server -- Accounting Section - > Linking to a static libary for the cokebank - + int AlterBalance(UID, int Delta) - + int GetBalance(UID) -- Device Control Section - > Snack - Controls Vending Machine and accepts logins - > Coke - Controls Coke Machine - > Misc Server - - int Dispense(int ID, int UID) -- Remote Control - > Accepts commands from dispense app. - - See `proto.txt` - diff --git a/proto.txt b/proto.txt deleted file mode 100644 index c27ff06..0000000 --- a/proto.txt +++ /dev/null @@ -1,81 +0,0 @@ -OpenDispense^2 -Client/Server Dispense Protocol - -The protocol is ASCII based, similar to the FTP protocol -All server responses are on one line and are prefixed by a three digit response code. - -== Response Codes == -100 Information -200 Command succeeded, no extra information -201 Command succeeded, multiple lines follow () -202 Command succeeded, per-command format -400 Unknown Command -401 Not Authenticated (or Authentication failure) -402 Balance insufficient -403 User not allowed to perform this action -404 Bad other username -406 Bad Item ID -407 Invalid arguments -500 Unknown Dispense Failure -501 Action Rejected - -== Item IDs == - represents the item ID -Item IDs are allowed to contain any non-whitespace character, but in -general they will be limited to the standard alpha-numeric set - -=== User Auth === -c USER \n -s 100 SALT \n or 100 User Set\n (If no salt used) -c PASS \n (Hex-Encoded SHA-1 Hash of ) -s 200 Auth OK\n or 401 Auth Failure\n -User is now authenticated ---- Alternate Method (Implicit Trust Authentication) --- -If the client is connecting from a trusted machine on a root port then -automatic authentication is allowed -c AUTOAUTH \n -s 200 Auth OK\n or 404 Bad Username\n or 401 Untrusted\n ---- Set effective user (User in `dispense -u`) --- -c SETEUSER \n -s 200 User set\n or 403 Not in coke\n or 404 User not found\n - -=== Commands === ---- Dispense an item --- -c DISPENSE \n -s 200 Dispense OK\n or 402 Poor You\n or 500 Dispense Error\n or 406 Bad Item\n ---- Give to another user --- -c GIVE \n -s 200 Give OK\n or 402 Poor You\n or 404 Bad User\n ---- Alter balance --- -c ADD \n -s 200 Add OK\n or 402 No balance\n or 403 Not Coke\n or 404 Bad User\n - ---- Get Item list --- -c ENUM_ITEMS\n -s 201 Items \n -s 202 Item \n - ... -s 200 List End\n ---- Get Item Information --- -c ITEM_INFO \n -s 202 Item \n - ---- Get Users' Balances --- - and can be '-' to indicate "none" -c ENUM_USERS[ []]\n -s 201 Users \n -s 202 User \n - ... -s 200 List End\n ---- Get a User's Balance --- -c USER_INFO\n -s 202 User \n - ---- Add a new user --- -c USER_ADD \n -s 200 User Added\n or 403 Not Wheel\n or 404 User Exists\n ---- Set user flags --- - is a comma-separated list of flag values (optionally preceded by - - to remove the flag) Valid values are: user,coke,wheel,meta,disabled,door -c USER_FLAGS \n -s 200 User Updated\n or 403 Not Wheel\n or 404 Bad User\n or 407 Unknown Flags\n diff --git a/ui.txt b/ui.txt deleted file mode 100644 index 44720d0..0000000 --- a/ui.txt +++ /dev/null @@ -1,48 +0,0 @@ -Client UI Design - -Left/Right changes the item view (between Drink, Pseudo and Snack - and others if defined) - -Should the width of the display be fixed? -> Current width is 34 characters -Howabout the height? - - -Mockup: - Drink Display - - /----------- Dispense -----------\ - | 0 Lemon Foo 72 | - | 1 Orange Foo 71 | - | 2 Solo 73 | - | 3 Solo++ 75 | - | 4 V Black 75 | - | 5 null Coke 101 | - | 6 Coke 96 | - \--------------------------------/ - [drink] -pseudo- -snack- - - Pseudo Items - - /----------- Dispense -----------\ - | 0 Laserprint 10 | - | 1 Membership 2500 | - | 2 Clue 128 | - | 3 Phone 20 | - \--------------------------------/ - -drink- [pseudo] -snack- - - Snacks - - /----------- Dispense -----------\ - | 00 Smith's Salt+Vinegar 128 A - | 01 Unused 0 # - | 02 Something 0 | - | 03 Something 0 | - | 04 Something 0 | - | 05 Something 0 | - | 06 Something 0 | - | 07 Something 0 | - | --- --- V - \--------------------------------/ - [drink] -pseudo- -snack- -