From 38dcfb2786b4ddfdeaca0d0ea14ae0fb56d0d5cd Mon Sep 17 00:00:00 2001 From: Marvin Johanning Date: Thu, 12 Jul 2018 11:37:08 +0200 Subject: [PATCH] Add license text --- .gitignore | 1 + src/gmail.rb | 25 ++++++++++++++++++++++++- src/gmail_login_information.rb | 23 ++++++++++++++++++++++- src/main.cpp | 18 ++++++++++++++++++ src/serial | 7 ++++--- start | 20 ++++++++++++++++++++ 6 files changed, 89 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 5dac9f5..43baf86 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .piolibdeps .clang_complete .gcc-flags.json +src/serial diff --git a/src/gmail.rb b/src/gmail.rb index 0665c3a..8d61cdb 100644 --- a/src/gmail.rb +++ b/src/gmail.rb @@ -1,5 +1,23 @@ #!/bin/env ruby +=begin +Copyright 2018 Marvin Johanning +This file is part of GmailNotifier. + +GmailNotifier is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +GmailNotifier is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GmailNotifier. If not, see . +=end + #Check if operating system being used it Linux-based unless /linux/ =~ RUBY_PLATFORM then puts "ERROR: Only Linux-based operating systems are currently supported" @@ -69,7 +87,12 @@ stop_bits = 1 parity = SerialPort::NONE #create a SerialPort object using each of the bits of information -port = SerialPort.new(port_file, baud_rate, data_bits, stop_bits, parity) +begin + port = SerialPort.new(port_file, baud_rate, data_bits, stop_bits, parity) +rescue Errno::EBUSY + puts "ERROR: ".colorize(:red) + "The Arduino seems to be busy at the moment. This happens frequently whenever the Arduino has been plugged into a computer. Please wait a while and try again" + exit +end wait_time = 4 diff --git a/src/gmail_login_information.rb b/src/gmail_login_information.rb index 052d761..f9a3dc5 100644 --- a/src/gmail_login_information.rb +++ b/src/gmail_login_information.rb @@ -1,2 +1,23 @@ +#!/bin/env ruby + +=begin +Copyright 2018 Marvin Johanning +This file is part of GmailNotifier. + +GmailNotifier is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +GmailNotifier is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GmailNotifier. If not, see . +=end + +#Please enter your Gmail username and password here $gmail_username = "your_username_here" -$gmail_password = "user_password_here" +$gmail_password = "your_password_here" diff --git a/src/main.cpp b/src/main.cpp index d82f8dc..b71b9de 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,3 +1,21 @@ +/* +Copyright 2018 Marvin Johanning +This file is part of GmailNotifier. + +GmailNotifier is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +GmailNotifier is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GmailNotifier. If not, see . +*/ + #include #include #include diff --git a/src/serial b/src/serial index 2eb4bec..6b098e2 100644 --- a/src/serial +++ b/src/serial @@ -1,7 +1,8 @@ /dev/video0 - Chicony_Electronics_Co._Ltd._TOSHIBA_Web_Camera_-_HD_0x0001 -/dev/input/event7 - Chicony_Electronics_Co._Ltd._TOSHIBA_Web_Camera_-_HD_0x0001 +/dev/input/event6 - Chicony_Electronics_Co._Ltd._TOSHIBA_Web_Camera_-_HD_0x0001 /dev/ttyACM2 - TOSHIBA_F5321gw_847A5C4419678500 /dev/ttyACM1 - TOSHIBA_F5321gw_847A5C4419678500 /dev/ttyACM0 - TOSHIBA_F5321gw_847A5C4419678500 -/dev/input/mouse2 - 1ea7_2.4G_Mouse -/dev/input/event15 - 1ea7_2.4G_Mouse +/dev/input/event5 - 1ea7_2.4G_Mouse +/dev/input/mouse0 - 1ea7_2.4G_Mouse +/dev/ttyACM3 - Arduino__www.arduino.cc__0043_75735323230351F09102 diff --git a/start b/start index ebfaa85..430e6d7 100755 --- a/start +++ b/start @@ -1,3 +1,23 @@ #!/bin/env ruby +=begin +Copyright 2018 Marvin Johanning +This file is part of GmailNotifier. + +GmailNotifier is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +GmailNotifier is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GmailNotifier. If not, see . +=end + +#The purpose of this file is to start the actual GmailNotifier located inside the src/ folder + load "#{File.dirname(__FILE__)}/src/gmail.rb"