├── ConsoleApplication ├── pom.xml └── src │ └── main │ └── java │ ├── CommandDispatcher.java │ ├── CommandMap.java │ ├── ConsoleReader.java │ ├── HelpCommand.java │ ├── ICommandRepository.java │ ├── IInputHandler.java │ └── Program.java ├── LICENSE ├── README.md ├── facades ├── pom.xml └── src │ └── main │ └── java │ └── eu │ └── chargetime │ └── simulator │ ├── ChargeBox.java │ ├── ChargeBoxFirmware.java │ └── commands │ ├── LockCommand.java │ ├── PluginCommand.java │ ├── PullPlugCommand.java │ ├── StatusCommand.java │ └── UnlockCommand.java ├── hardware ├── pom.xml └── src │ └── main │ └── java │ └── eu │ └── chargetime │ └── simulator │ └── hardware │ ├── Events │ ├── ILockEventHandler.java │ └── IOutletEventHandler.java │ ├── ILock.java │ ├── IOutlet.java │ ├── OutletLockDecorator.java │ ├── SimpleLock.java │ └── SimpleOutlet.java ├── pom.xml ├── software.ocpp ├── pom.xml └── src │ └── main │ └── java │ └── eu │ └── chargetime │ └── simulator │ └── software │ └── ocpp │ ├── CoreEventHandler.java │ └── OCPPClient.java └── software ├── pom.xml └── src └── main └── java └── eu └── chargetime └── simulator └── software ├── ICommand.java └── IFirmware.java /ConsoleApplication/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | eu.chargetime.simulator 7 | chargepointsimulator 8 | 0.1-SNAPSHOT 9 | ../pom.xml 10 | 11 | 4.0.0 12 | eu.chargetime.simulator 13 | consoleapplication 14 | 0.1-SNAPSHOT 15 | jar 16 | 17 | Console Application 18 | Console application for charge point simulator. 19 | https://github.com/ChargeTimeEU/ChargePointSimulator 20 | 21 | 22 | 23 | MIT License 24 | http://www.opensource.org/licenses/mit-license.php 25 | 26 | 27 | 28 | 29 | 30 | Thomas Volden 31 | tv@chargetime.eu 32 | chargetime.eu 33 | http://www.chargetime.eu 34 | 35 | 36 | 37 | 38 | scm:git:git://github.com/ChargeTimeEU/ChargePointSimulator.git 39 | scm:git:ssh://github.com:ChargeTimeEU/ChargePointSimulator.git 40 | https://github.com/ChargeTimeEU/ChargePointSimulator.git 41 | 42 | 43 | 44 | 45 | ossrh 46 | https://oss.sonatype.org/content/repositories/snapshots 47 | 48 | 49 | ossrh 50 | https://oss.sonatype.org/service/local/staging/deploy/maven2 51 | 52 | 53 | 54 | 55 | 56 | eu.chargetime.simulator 57 | software 58 | 0.1-SNAPSHOT 59 | 60 | 61 | eu.chargetime.simulator 62 | hardware 63 | 0.1-SNAPSHOT 64 | 65 | 66 | eu.chargetime.simulator 67 | facades 68 | 0.1-SNAPSHOT 69 | 70 | 71 | junit 72 | junit 73 | 4.13.1 74 | test 75 | 76 | 77 | org.mockito 78 | mockito-core 79 | 1.10.19 80 | test 81 | 82 | 83 | org.hamcrest 84 | hamcrest-core 85 | 1.3 86 | test 87 | 88 | 89 | 90 | 91 | 92 | 93 | org.apache.maven.plugins 94 | maven-compiler-plugin 95 | 96 | 1.8 97 | 1.8 98 | 99 | 3.5.1 100 | 101 | 102 | org.apache.maven.plugins 103 | maven-source-plugin 104 | 2.2.1 105 | 106 | 107 | attach-sources 108 | verify 109 | 110 | jar-no-fork 111 | 112 | 113 | 114 | 115 | 116 | org.apache.maven.plugins 117 | maven-jar-plugin 118 | 119 | 120 | 121 | true 122 | lib/ 123 | Program 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /ConsoleApplication/src/main/java/CommandDispatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | ChargeTime.eu - Charge Point Simulator 3 | 4 | MIT License 5 | 6 | Copyright (C) 2016 Thomas Volden 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | import eu.chargetime.simulator.software.ICommand; 28 | 29 | public class CommandDispatcher implements IInputHandler { 30 | 31 | private final ICommandRepository repository; 32 | private final ICommand defaultCommand; 33 | 34 | public CommandDispatcher(ICommandRepository repository, ICommand defaultCommand) { 35 | this.repository = repository; 36 | this.defaultCommand = defaultCommand; 37 | } 38 | 39 | @Override 40 | public void handle(String input) { 41 | String[] splittedInput = input.split(" "); 42 | ICommand command = repository.createCommand(splittedInput[0]); 43 | 44 | if (command == null) 45 | command = defaultCommand; 46 | 47 | command.execute(); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /ConsoleApplication/src/main/java/CommandMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | ChargeTime.eu - Charge Point Simulator 3 | 4 | MIT License 5 | 6 | Copyright (C) 2016 Thomas Volden 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | import eu.chargetime.simulator.software.ICommand; 28 | 29 | import java.util.HashMap; 30 | 31 | public class CommandMap implements ICommandRepository { 32 | 33 | private HashMap repository; 34 | 35 | public CommandMap() { 36 | repository = new HashMap<>(); 37 | } 38 | 39 | public void addCommand(String name, ICommand command) { 40 | repository.put(name, command); 41 | } 42 | 43 | @Override 44 | public ICommand createCommand(String name) { 45 | ICommand command = null; 46 | if (repository.containsKey(name)) 47 | command = repository.get(name); 48 | return command; 49 | } 50 | 51 | @Override 52 | public String[] availableCommands() { 53 | return repository.keySet().toArray(new String[0]); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /ConsoleApplication/src/main/java/ConsoleReader.java: -------------------------------------------------------------------------------- 1 | /* 2 | ChargeTime.eu - Charge Point Simulator 3 | 4 | MIT License 5 | 6 | Copyright (C) 2016 Thomas Volden 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | import java.util.Scanner; 28 | 29 | public class ConsoleReader implements Runnable { 30 | 31 | private final IInputHandler handler; 32 | private String prompt; 33 | 34 | public ConsoleReader(IInputHandler handler) { 35 | this.handler = handler; 36 | prompt = "> "; 37 | } 38 | 39 | @Override 40 | public void run() { 41 | final Scanner in = new Scanner(System.in); 42 | System.out.print(prompt); 43 | while (in.hasNext()) { 44 | final String line = in.nextLine(); 45 | handler.handle(line); 46 | if (line.startsWith("quit")) 47 | break; 48 | System.out.print(prompt); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /ConsoleApplication/src/main/java/HelpCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | ChargeTime.eu - Charge Point Simulator 3 | 4 | MIT License 5 | 6 | Copyright (C) 2016 Thomas Volden 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | import eu.chargetime.simulator.software.ICommand; 28 | 29 | public class HelpCommand implements ICommand { 30 | 31 | private final ICommandRepository commands; 32 | 33 | public HelpCommand(ICommandRepository commands) { 34 | this.commands = commands; 35 | } 36 | 37 | @Override 38 | public void execute() { 39 | System.out.println("Available commands:"); 40 | 41 | for (String command: commands.availableCommands()) { 42 | System.out.println(" " + command); 43 | } 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ConsoleApplication/src/main/java/ICommandRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | ChargeTime.eu - Charge Point Simulator 3 | 4 | MIT License 5 | 6 | Copyright (C) 2016 Thomas Volden 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | import eu.chargetime.simulator.software.ICommand; 28 | 29 | public interface ICommandRepository { 30 | ICommand createCommand(String name); 31 | String[] availableCommands(); 32 | } 33 | -------------------------------------------------------------------------------- /ConsoleApplication/src/main/java/IInputHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | ChargeTime.eu - Charge Point Simulator 3 | 4 | MIT License 5 | 6 | Copyright (C) 2016 Thomas Volden 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | public interface IInputHandler { 28 | void handle(String input); 29 | } 30 | -------------------------------------------------------------------------------- /ConsoleApplication/src/main/java/Program.java: -------------------------------------------------------------------------------- 1 | /* 2 | ChargeTime.eu - Charge Point Simulator 3 | 4 | MIT License 5 | 6 | Copyright (C) 2016 Thomas Volden 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | import eu.chargetime.simulator.ChargeBox; 28 | 29 | public class Program { 30 | 31 | private ConsoleReader consoleReader; 32 | 33 | public static void main(String[] args) { 34 | new Program().run(); 35 | } 36 | 37 | public Program() { 38 | composeRoot(); 39 | } 40 | 41 | private void composeRoot() { 42 | ChargeBox chargeBox = new ChargeBox(); 43 | CommandMap commandMap = new CommandMap(); 44 | 45 | commandMap.addCommand("lock", chargeBox.lockCommand); 46 | commandMap.addCommand("unlock", chargeBox.unlockCommand); 47 | commandMap.addCommand("status", chargeBox.isLockedCommand); 48 | commandMap.addCommand("plugin", chargeBox.pluginCommand); 49 | commandMap.addCommand("plugout", chargeBox.pullPluginCommand); 50 | 51 | commandMap.addCommand("help", new HelpCommand(commandMap)); 52 | commandMap.addCommand("quit", () -> System.out.println("Goodbye!")); 53 | 54 | IInputHandler commandDispatcher = new CommandDispatcher(commandMap, () -> System.out.println("Unknown command! Try with help")); 55 | consoleReader = new ConsoleReader(commandDispatcher); 56 | } 57 | 58 | public void run() { 59 | System.out.println("Simulator started."); 60 | new Thread(consoleReader).start(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Charge Time 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ChargePointSimulator -------------------------------------------------------------------------------- /facades/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | eu.chargetime.simulator 7 | chargepointsimulator 8 | 0.1-SNAPSHOT 9 | ../pom.xml 10 | 11 | 4.0.0 12 | eu.chargetime.simulator 13 | facades 14 | 0.1-SNAPSHOT 15 | jar 16 | 17 | Facades 18 | Facades for charge point simulator. 19 | https://github.com/ChargeTimeEU/ChargePointSimulator 20 | 21 | 22 | 23 | MIT License 24 | http://www.opensource.org/licenses/mit-license.php 25 | 26 | 27 | 28 | 29 | 30 | Thomas Volden 31 | tv@chargetime.eu 32 | chargetime.eu 33 | http://www.chargetime.eu 34 | 35 | 36 | 37 | 38 | scm:git:git://github.com/ChargeTimeEU/ChargePointSimulator.git 39 | scm:git:ssh://github.com:ChargeTimeEU/ChargePointSimulator.git 40 | https://github.com/ChargeTimeEU/ChargePointSimulator.git 41 | 42 | 43 | 44 | 45 | ossrh 46 | https://oss.sonatype.org/content/repositories/snapshots 47 | 48 | 49 | ossrh 50 | https://oss.sonatype.org/service/local/staging/deploy/maven2 51 | 52 | 53 | 54 | 55 | 56 | eu.chargetime.simulator 57 | hardware 58 | 0.1-SNAPSHOT 59 | 60 | 61 | eu.chargetime.simulator 62 | software 63 | 0.1-SNAPSHOT 64 | 65 | 66 | eu.chargetime.simulator 67 | software_ocpp 68 | 0.1-SNAPSHOT 69 | 70 | 71 | junit 72 | junit 73 | 4.13.1 74 | test 75 | 76 | 77 | org.mockito 78 | mockito-core 79 | 1.10.19 80 | test 81 | 82 | 83 | org.hamcrest 84 | hamcrest-core 85 | 1.3 86 | test 87 | 88 | 89 | 90 | 91 | 92 | 93 | org.apache.maven.plugins 94 | maven-compiler-plugin 95 | 96 | 1.8 97 | 1.8 98 | 99 | 3.5.1 100 | 101 | 102 | org.apache.maven.plugins 103 | maven-source-plugin 104 | 2.2.1 105 | 106 | 107 | attach-sources 108 | verify 109 | 110 | jar-no-fork 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /facades/src/main/java/eu/chargetime/simulator/ChargeBox.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | import eu.chargetime.simulator.commands.*; 29 | import eu.chargetime.simulator.hardware.*; 30 | import eu.chargetime.simulator.software.ocpp.CoreEventHandler; 31 | import eu.chargetime.simulator.software.ocpp.OCPPClient; 32 | 33 | public class ChargeBox { 34 | 35 | private ILock lock; 36 | private IOutlet outlet; 37 | 38 | public final LockCommand lockCommand; 39 | public final UnlockCommand unlockCommand; 40 | public final StatusCommand isLockedCommand; 41 | public final PluginCommand pluginCommand; 42 | public final PullPlugCommand pullPluginCommand; 43 | 44 | public ChargeBox() { 45 | ChargeBoxFirmware firmware = new ChargeBoxFirmware(); 46 | lock = new SimpleLock(firmware,true); 47 | outlet = new OutletLockDecorator(new SimpleOutlet(firmware), lock); 48 | 49 | lockCommand = new LockCommand(lock); 50 | unlockCommand = new UnlockCommand(lock); 51 | isLockedCommand = new StatusCommand(lock, outlet); 52 | pluginCommand = new PluginCommand(outlet); 53 | pullPluginCommand = new PullPlugCommand(outlet); 54 | 55 | new OCPPClient("http://localhost:8890", new CoreEventHandler(unlockCommand)); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /facades/src/main/java/eu/chargetime/simulator/ChargeBoxFirmware.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | import eu.chargetime.simulator.hardware.Events.ILockEventHandler; 29 | import eu.chargetime.simulator.hardware.Events.IOutletEventHandler; 30 | 31 | public class ChargeBoxFirmware implements ILockEventHandler, IOutletEventHandler { 32 | 33 | @Override 34 | public void onLocked() { 35 | System.out.println("Locked"); 36 | } 37 | 38 | @Override 39 | public void onUnlocked() { 40 | System.out.println("Unlocked"); 41 | } 42 | 43 | @Override 44 | public void connected() { 45 | System.out.println("Connected"); 46 | } 47 | 48 | @Override 49 | public void disconnected() { 50 | System.out.println("Disconnected"); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /facades/src/main/java/eu/chargetime/simulator/commands/LockCommand.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator.commands; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | import eu.chargetime.simulator.hardware.ILock; 29 | import eu.chargetime.simulator.software.ICommand; 30 | 31 | public class LockCommand implements ICommand { 32 | 33 | private final ILock lock; 34 | 35 | public LockCommand(ILock lock) { 36 | 37 | this.lock = lock; 38 | } 39 | 40 | @Override 41 | public void execute() { 42 | lock.lock(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /facades/src/main/java/eu/chargetime/simulator/commands/PluginCommand.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator.commands; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | import eu.chargetime.simulator.hardware.IOutlet; 29 | import eu.chargetime.simulator.software.ICommand; 30 | 31 | public class PluginCommand implements ICommand { 32 | 33 | private final IOutlet outlet; 34 | 35 | public PluginCommand(IOutlet outlet) { 36 | this.outlet = outlet; 37 | } 38 | 39 | @Override 40 | public void execute() { 41 | outlet.plugin(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /facades/src/main/java/eu/chargetime/simulator/commands/PullPlugCommand.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator.commands; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | import eu.chargetime.simulator.hardware.IOutlet; 29 | import eu.chargetime.simulator.software.ICommand; 30 | 31 | public class PullPlugCommand implements ICommand { 32 | 33 | 34 | private final IOutlet outlet; 35 | 36 | public PullPlugCommand(IOutlet outlet) { 37 | this.outlet = outlet; 38 | } 39 | 40 | @Override 41 | public void execute() { 42 | outlet.pullplug(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /facades/src/main/java/eu/chargetime/simulator/commands/StatusCommand.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator.commands; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | import eu.chargetime.simulator.hardware.ILock; 29 | import eu.chargetime.simulator.hardware.IOutlet; 30 | import eu.chargetime.simulator.software.ICommand; 31 | 32 | public class StatusCommand implements ICommand { 33 | 34 | private final ILock lock; 35 | private final IOutlet outlet; 36 | 37 | public StatusCommand(ILock lock, IOutlet outlet) { 38 | this.lock = lock; 39 | this.outlet = outlet; 40 | } 41 | 42 | @Override 43 | public void execute() { 44 | System.out.println(String.format("isLocked: %s", lock.isLocked())); 45 | System.out.println(String.format("isPluggedIn: %s", outlet.isPluggedIn())); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /facades/src/main/java/eu/chargetime/simulator/commands/UnlockCommand.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator.commands; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | import eu.chargetime.simulator.hardware.ILock; 29 | import eu.chargetime.simulator.software.ICommand; 30 | 31 | public class UnlockCommand implements ICommand { 32 | 33 | private final ILock lock; 34 | 35 | public UnlockCommand(ILock lock) { 36 | this.lock = lock; 37 | } 38 | 39 | @Override 40 | public void execute() { 41 | lock.unlock(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /hardware/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | eu.chargetime.simulator 7 | chargepointsimulator 8 | 0.1-SNAPSHOT 9 | ../pom.xml 10 | 11 | 4.0.0 12 | eu.chargetime.simulator 13 | hardware 14 | 0.1-SNAPSHOT 15 | jar 16 | 17 | Hardware simulator 18 | Hardware simulators for charge point simulator. 19 | https://github.com/ChargeTimeEU/ChargePointSimulator 20 | 21 | 22 | 23 | MIT License 24 | http://www.opensource.org/licenses/mit-license.php 25 | 26 | 27 | 28 | 29 | 30 | Thomas Volden 31 | tv@chargetime.eu 32 | chargetime.eu 33 | http://www.chargetime.eu 34 | 35 | 36 | 37 | 38 | scm:git:git://github.com/ChargeTimeEU/ChargePointSimulator.git 39 | scm:git:ssh://github.com:ChargeTimeEU/ChargePointSimulator.git 40 | https://github.com/ChargeTimeEU/ChargePointSimulator.git 41 | 42 | 43 | 44 | 45 | ossrh 46 | https://oss.sonatype.org/content/repositories/snapshots 47 | 48 | 49 | ossrh 50 | https://oss.sonatype.org/service/local/staging/deploy/maven2 51 | 52 | 53 | 54 | 55 | 56 | junit 57 | junit 58 | 4.13.1 59 | test 60 | 61 | 62 | org.mockito 63 | mockito-core 64 | 1.10.19 65 | test 66 | 67 | 68 | org.hamcrest 69 | hamcrest-core 70 | 1.3 71 | test 72 | 73 | 74 | 75 | 76 | 77 | 78 | org.apache.maven.plugins 79 | maven-compiler-plugin 80 | 81 | 1.8 82 | 1.8 83 | 84 | 3.5.1 85 | 86 | 87 | org.apache.maven.plugins 88 | maven-source-plugin 89 | 2.2.1 90 | 91 | 92 | attach-sources 93 | verify 94 | 95 | jar-no-fork 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /hardware/src/main/java/eu/chargetime/simulator/hardware/Events/ILockEventHandler.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator.hardware.Events; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | public interface ILockEventHandler { 29 | void onLocked(); 30 | void onUnlocked(); 31 | } 32 | -------------------------------------------------------------------------------- /hardware/src/main/java/eu/chargetime/simulator/hardware/Events/IOutletEventHandler.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator.hardware.Events; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | public interface IOutletEventHandler { 29 | void connected(); 30 | void disconnected(); 31 | } 32 | -------------------------------------------------------------------------------- /hardware/src/main/java/eu/chargetime/simulator/hardware/ILock.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator.hardware; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | public interface ILock { 29 | void lock(); 30 | void unlock(); 31 | boolean isLocked(); 32 | } 33 | -------------------------------------------------------------------------------- /hardware/src/main/java/eu/chargetime/simulator/hardware/IOutlet.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator.hardware; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | public interface IOutlet { 29 | void plugin(); 30 | void pullplug(); 31 | boolean isPluggedIn(); 32 | } 33 | -------------------------------------------------------------------------------- /hardware/src/main/java/eu/chargetime/simulator/hardware/OutletLockDecorator.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator.hardware; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | public class OutletLockDecorator implements IOutlet { 29 | 30 | private final IOutlet outlet; 31 | private final ILock lock; 32 | 33 | public OutletLockDecorator(IOutlet outlet, ILock lock) { 34 | this.outlet = outlet; 35 | this.lock = lock; 36 | } 37 | 38 | @Override 39 | public void plugin() { 40 | if (!lock.isLocked()) 41 | outlet.plugin(); 42 | } 43 | 44 | @Override 45 | public void pullplug() { 46 | if (!lock.isLocked()) 47 | outlet.pullplug(); 48 | } 49 | 50 | @Override 51 | public boolean isPluggedIn() { 52 | return outlet.isPluggedIn(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /hardware/src/main/java/eu/chargetime/simulator/hardware/SimpleLock.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator.hardware; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | import eu.chargetime.simulator.hardware.Events.ILockEventHandler; 29 | 30 | public class SimpleLock implements ILock { 31 | private final ILockEventHandler events; 32 | private boolean locked; 33 | 34 | public SimpleLock(ILockEventHandler handler, boolean initialState) { 35 | this.events = handler; 36 | locked = initialState; 37 | } 38 | 39 | @Override 40 | public void lock() { 41 | if (!locked) { 42 | locked = true; 43 | events.onLocked(); 44 | } 45 | } 46 | 47 | @Override 48 | public void unlock() { 49 | if (locked) { 50 | locked=false; 51 | events.onUnlocked(); 52 | } 53 | } 54 | 55 | @Override 56 | public boolean isLocked() { 57 | return locked; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /hardware/src/main/java/eu/chargetime/simulator/hardware/SimpleOutlet.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator.hardware; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | import eu.chargetime.simulator.hardware.Events.IOutletEventHandler; 29 | 30 | public class SimpleOutlet implements IOutlet { 31 | 32 | private final IOutletEventHandler handler; 33 | private boolean pluggedIn; 34 | 35 | public SimpleOutlet(IOutletEventHandler handler) { 36 | this.handler = handler; 37 | pluggedIn = false; 38 | } 39 | 40 | @Override 41 | public void plugin() { 42 | if (!pluggedIn) { 43 | pluggedIn = true; 44 | handler.connected(); 45 | } 46 | } 47 | 48 | @Override 49 | public void pullplug() { 50 | if (pluggedIn) { 51 | pluggedIn = false; 52 | handler.disconnected(); 53 | } 54 | } 55 | 56 | @Override 57 | public boolean isPluggedIn() { 58 | return pluggedIn; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | eu.chargetime.simulator 8 | chargepointsimulator 9 | 0.1-SNAPSHOT 10 | pom 11 | 12 | Charge Point Simulator 13 | Simulator to simulate a charge point. 14 | https://github.com/ChargeTimeEU/ChargePointSimulator 15 | 16 | 17 | 18 | MIT License 19 | http://www.opensource.org/licenses/mit-license.php 20 | 21 | 22 | 23 | 24 | 25 | Thomas Volden 26 | tv@chargetime.eu 27 | chargetime.eu 28 | http://www.chargetime.eu 29 | 30 | 31 | 32 | 33 | scm:git:git://github.com/ChargeTimeEU/ChargePointSimulator.git 34 | scm:git:ssh://github.com:ChargeTimeEU/ChargePointSimulator.git 35 | https://github.com/ChargeTimeEU/ChargePointSimulator.git 36 | 37 | 38 | 39 | hardware 40 | software 41 | software.ocpp 42 | facades 43 | ConsoleApplication 44 | 45 | 46 | 47 | 48 | ossrh 49 | https://oss.sonatype.org/content/repositories/snapshots 50 | 51 | 52 | ossrh 53 | https://oss.sonatype.org/service/local/staging/deploy/maven2 54 | 55 | 56 | 57 | 58 | 59 | 60 | org.apache.maven.plugins 61 | maven-compiler-plugin 62 | 63 | 1.8 64 | 1.8 65 | 66 | 3.5.1 67 | 68 | 69 | maven-assembly-plugin 70 | 71 | 72 | 73 | Program 74 | 75 | 76 | 77 | jar-with-dependencies 78 | 79 | 80 | 81 | 82 | make-assembly 83 | package 84 | 85 | single 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /software.ocpp/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | eu.chargetime.simulator 7 | chargepointsimulator 8 | 0.1-SNAPSHOT 9 | ../pom.xml 10 | 11 | 4.0.0 12 | eu.chargetime.simulator 13 | software_ocpp 14 | 0.1-SNAPSHOT 15 | jar 16 | 17 | OCPP communication 18 | OCPP communication for charge point simulator. 19 | https://github.com/ChargeTimeEU/ChargePointSimulator 20 | 21 | 22 | 23 | MIT License 24 | http://www.opensource.org/licenses/mit-license.php 25 | 26 | 27 | 28 | 29 | 30 | Thomas Volden 31 | tv@chargetime.eu 32 | chargetime.eu 33 | http://www.chargetime.eu 34 | 35 | 36 | 37 | 38 | scm:git:git://github.com/ChargeTimeEU/ChargePointSimulator.git 39 | scm:git:ssh://github.com:ChargeTimeEU/ChargePointSimulator.git 40 | https://github.com/ChargeTimeEU/ChargePointSimulator.git 41 | 42 | 43 | 44 | 45 | ossrh 46 | https://oss.sonatype.org/content/repositories/snapshots 47 | 48 | 49 | ossrh 50 | https://oss.sonatype.org/service/local/staging/deploy/maven2 51 | 52 | 53 | 54 | 55 | 56 | eu.chargetime.ocpp 57 | common 58 | 0.5-SNAPSHOT 59 | 60 | 61 | eu.chargetime.ocpp 62 | v1_6 63 | 0.5-SNAPSHOT 64 | 65 | 66 | eu.chargetime.simulator 67 | software 68 | 0.1-SNAPSHOT 69 | 70 | 71 | junit 72 | junit 73 | 4.13.1 74 | test 75 | 76 | 77 | org.mockito 78 | mockito-core 79 | 1.10.19 80 | test 81 | 82 | 83 | org.hamcrest 84 | hamcrest-core 85 | 1.3 86 | test 87 | 88 | 89 | 90 | 91 | 92 | 93 | org.apache.maven.plugins 94 | maven-compiler-plugin 95 | 96 | 1.8 97 | 1.8 98 | 99 | 3.5.1 100 | 101 | 102 | org.apache.maven.plugins 103 | maven-source-plugin 104 | 2.2.1 105 | 106 | 107 | attach-sources 108 | verify 109 | 110 | jar-no-fork 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /software.ocpp/src/main/java/eu/chargetime/simulator/software/ocpp/CoreEventHandler.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator.software.ocpp; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | import eu.chargetime.ocpp.feature.profile.ClientCoreEventHandler; 29 | import eu.chargetime.ocpp.model.core.*; 30 | import eu.chargetime.simulator.software.ICommand; 31 | 32 | public class CoreEventHandler implements ClientCoreEventHandler { 33 | 34 | private final ICommand command; 35 | 36 | public CoreEventHandler(ICommand command) { 37 | 38 | this.command = command; 39 | } 40 | 41 | @Override 42 | public ChangeAvailabilityConfirmation handleChangeAvailabilityRequest(ChangeAvailabilityRequest changeAvailabilityRequest) { 43 | return null; 44 | } 45 | 46 | @Override 47 | public GetConfigurationConfirmation handleGetConfigurationRequest(GetConfigurationRequest getConfigurationRequest) { 48 | return null; 49 | } 50 | 51 | @Override 52 | public ChangeConfigurationConfirmation handleChangeConfigurationRequest(ChangeConfigurationRequest changeConfigurationRequest) { 53 | return null; 54 | } 55 | 56 | @Override 57 | public ClearCacheConfirmation handleClearCacheRequest(ClearCacheRequest clearCacheRequest) { 58 | return null; 59 | } 60 | 61 | @Override 62 | public DataTransferConfirmation handleDataTransferRequest(DataTransferRequest dataTransferRequest) { 63 | return null; 64 | } 65 | 66 | @Override 67 | public RemoteStartTransactionConfirmation handleRemoteStartTransactionRequest(RemoteStartTransactionRequest remoteStartTransactionRequest) { 68 | return null; 69 | } 70 | 71 | @Override 72 | public RemoteStopTransactionConfirmation handleRemoteStopTransactionRequest(RemoteStopTransactionRequest remoteStopTransactionRequest) { 73 | return null; 74 | } 75 | 76 | @Override 77 | public ResetConfirmation handleResetRequest(ResetRequest resetRequest) { 78 | return null; 79 | } 80 | 81 | @Override 82 | public UnlockConnectorConfirmation handleUnlockConnectorRequest(UnlockConnectorRequest unlockConnectorRequest) { 83 | command.execute(); 84 | UnlockConnectorConfirmation confirmation = new UnlockConnectorConfirmation(); 85 | confirmation.setStatus(UnlockStatus.Unlocked); 86 | return confirmation; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /software.ocpp/src/main/java/eu/chargetime/simulator/software/ocpp/OCPPClient.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator.software.ocpp; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | import eu.chargetime.ocpp.ClientEvents; 29 | import eu.chargetime.ocpp.JSONClient; 30 | import eu.chargetime.ocpp.OccurenceConstraintException; 31 | import eu.chargetime.ocpp.UnsupportedFeatureException; 32 | import eu.chargetime.ocpp.feature.profile.ClientCoreProfile; 33 | import eu.chargetime.ocpp.model.Confirmation; 34 | 35 | import java.util.concurrent.CompletionStage; 36 | 37 | public class OCPPClient { 38 | 39 | public OCPPClient(String uri, CoreEventHandler handler) { 40 | 41 | ClientCoreProfile coreProfile = new ClientCoreProfile(handler); 42 | JSONClient client = new JSONClient(coreProfile, "OCPPSimulator"); 43 | 44 | client.connect(uri, new ClientEvents() { 45 | @Override 46 | public void connectionOpened() { 47 | System.out.println("Connected!"); 48 | try { 49 | CompletionStage confirmation = client.send(coreProfile.createBootNotificationRequest("ChargeTimeEU", "Simulator")); 50 | confirmation.whenComplete((confirmation1, throwable) -> System.out.println("Booted")); 51 | } catch (UnsupportedFeatureException e) { 52 | e.printStackTrace(); 53 | } catch (OccurenceConstraintException e) { 54 | e.printStackTrace(); 55 | } 56 | } 57 | 58 | @Override 59 | public void connectionClosed() { 60 | System.out.println("Connection lost!"); 61 | } 62 | }); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /software/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | eu.chargetime.simulator 7 | chargepointsimulator 8 | 0.1-SNAPSHOT 9 | ../pom.xml 10 | 11 | 4.0.0 12 | eu.chargetime.simulator 13 | software 14 | 0.1-SNAPSHOT 15 | jar 16 | 17 | Software simulator 18 | Software simulators for charge point simulator. 19 | https://github.com/ChargeTimeEU/ChargePointSimulator 20 | 21 | 22 | 23 | MIT License 24 | http://www.opensource.org/licenses/mit-license.php 25 | 26 | 27 | 28 | 29 | 30 | Thomas Volden 31 | tv@chargetime.eu 32 | chargetime.eu 33 | http://www.chargetime.eu 34 | 35 | 36 | 37 | 38 | scm:git:git://github.com/ChargeTimeEU/ChargePointSimulator.git 39 | scm:git:ssh://github.com:ChargeTimeEU/ChargePointSimulator.git 40 | https://github.com/ChargeTimeEU/ChargePointSimulator.git 41 | 42 | 43 | 44 | 45 | ossrh 46 | https://oss.sonatype.org/content/repositories/snapshots 47 | 48 | 49 | ossrh 50 | https://oss.sonatype.org/service/local/staging/deploy/maven2 51 | 52 | 53 | 54 | 55 | 56 | junit 57 | junit 58 | 4.13.1 59 | test 60 | 61 | 62 | org.mockito 63 | mockito-core 64 | 1.10.19 65 | test 66 | 67 | 68 | org.hamcrest 69 | hamcrest-core 70 | 1.3 71 | test 72 | 73 | 74 | 75 | 76 | 77 | 78 | org.apache.maven.plugins 79 | maven-compiler-plugin 80 | 81 | 1.8 82 | 1.8 83 | 84 | 3.5.1 85 | 86 | 87 | org.apache.maven.plugins 88 | maven-source-plugin 89 | 2.2.1 90 | 91 | 92 | attach-sources 93 | verify 94 | 95 | jar-no-fork 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /software/src/main/java/eu/chargetime/simulator/software/ICommand.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator.software;/* 2 | ChargeTime.eu - Charge Point Simulator 3 | 4 | MIT License 5 | 6 | Copyright (C) 2016 Thomas Volden 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | public interface ICommand { 28 | void execute(); 29 | } 30 | -------------------------------------------------------------------------------- /software/src/main/java/eu/chargetime/simulator/software/IFirmware.java: -------------------------------------------------------------------------------- 1 | package eu.chargetime.simulator.software; 2 | /* 3 | ChargeTime.eu - Charge Point Simulator 4 | 5 | MIT License 6 | 7 | Copyright (C) 2016 Thomas Volden 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | public interface IFirmware { 29 | void stop(); 30 | void start(); 31 | } 32 | --------------------------------------------------------------------------------