CoffeeLink Network Protocol - Version 1.1.3 7/11/2001 1. Overview --------------------------------------------------------------- CoffeeLink is a protocol for remotely controlling automated coffeepots. The protocol is a simple, ASCII-based, request-reply protocol similar to SMTP. It is intended to be layered over a reliable TCP/IP connection. 2. Assumptions --------------------------------------------------------------- We make the following assumptions about a coffee pot (also called "device") controlled by the CoffeeLink protocol: 2.1 The coffee pot has a single pot. 2.2 The coffee pot can only brew one pot of coffee at a time. 2.3 Brewing does not happen instantaneously. The exact amount of time required depends on the model of coffee pot. 2.4 The coffee pot has a maximum capacity (expressed in units of SMALL cups, with cup sizes defined in Section 6.10 below), which may vary by model. It can brew a specified amount of coffee up to its maximum capacity. 2.5 The coffee pot can make either caffeinated or decaffeinated coffee. 2.6 The coffee pot can adjust the strength of the brew. 2.7 The coffee pot has the ability to dump a partially filled pot of coffee down the drain and automatically prepare itself to brew another pot. This operation happens instantaneously. 2.8 The coffee pot has the ability to pour the brewed contents into a waiting coffee cup. This operation happens instantaneously. 2.9 The coffee pot can also add additions to a coffee cup that it has filled with coffee. This operation happens instantaneously. The available additions are described in Section 6 below. The coffee additions can be customized. 2.10 After coffee is brewed, the temperature of the warming plate can be adjusted. 3. Device States --------------------------------------------------------------- Coffee pots supporting the CoffeeLink protocol must conform to the behavior of a simple state machine. CoffeeLink requires a coffee pot to implement 3 distinct states: 3.1 CANBREW - the coffee pot is in a state where it is able to brew a new pot of coffee. 3.2 BREWING - the coffee pot is currently brewing a new pot of coffee. This operation can take some time. 3.3 COFFEEREADY - coffee has been brewed and is available to be poured. 3.4. State transitions occur as follows: StartState Event EndState ---------- ----- -------- CANBREW BREW NOW command BREWING CANBREW BREWING BREWING COFFEEREADY COFFEEREADY RSET CANBREW 4. General protocol information --------------------- 4.1 CoffeeLink messages consist of ASCII strings terminated by newline characters. 4.2 Clients issue commands to the server. 4.3 Commands are 4-character alphabetic identifiers. 4.4 Some commands have additional arguments. In these cases, the command is followed by a space followed by additional arguments. Each argument is separated by a space. 4.4.1 Client alphabetic commands must be in uppercase letters. 4.4.2 Any extra characters at the end of a valid client command are ignored. 4.4.3 A client request that cannot be understood results in the distinguished error code 450 INVALIDCMD Sorry I didn't understand your request 4.5 A command is terminated with a newline. 4.6 A client command always results in a server response. 4.7 Server responses consists of a 3-digit numeric code followed in some cases by additional information. 4.7.1 Response codes starting with 2 indicate success. 4.7.2 Response codes starting with 4 indicate a command error. 4.7.3 Response codes starting with 5 indicate a hardware/device error. 4.8 Following the code may be additional information. 4.8.1 Capitalized information in the response must be returned verbatim as shown in this document. 4.8.2 Mixed case information in the response may vary among models of coffee pots. 5. Connection initiation sequence --------------------------------------------------------------- 5.1 CoffeeLink connections are initiated by a client over a TCP/IP connection. 5.2 The standard port number for CoffeeLink is port 4000. 5.3 Upon receiving a connection, the CoffeeLink server device returns a response as follows: 200 COFFEEPOT