From 2a4a5e71ff115d67929e99965261cb49e7daa7ba Mon Sep 17 00:00:00 2001 From: Doi Yusuke Date: Fri, 4 Nov 2016 02:29:50 +0900 Subject: [PATCH 1/3] Register update v1.2.2 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e107882..675e6a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ project(ics3 CXX) SET(PROJECT_VER_MAJOR 1) SET(PROJECT_VER_MINOR 2) -SET(PROJECT_VER_PATCH 1) +SET(PROJECT_VER_PATCH 2) SET(PROJECT_VER "${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}.${PROJECT_VER_PATCH}") SET(PROJECT_APIVER "${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}") From 55624f7bab173935f6680b317476305b5f4d56a0 Mon Sep 17 00:00:00 2001 From: Doi Yusuke Date: Fri, 4 Nov 2016 02:30:15 +0900 Subject: [PATCH 2/3] Update format of literal writing on communication --- src/ics3.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ics3.cpp b/src/ics3.cpp index 3ad01e5..312322d 100644 --- a/src/ics3.cpp +++ b/src/ics3.cpp @@ -50,7 +50,7 @@ void ics::ICS3::set(const ID& id, const Parameter& param) { } ics::EepRom ics::ICS3::getRom(const ID& id) { - const Core::Container tx {getCmd(0xA0, id), 0}; + const Core::Container tx {getCmd(0xA0, id), 0x00}; Core::Container rx(68); core->communicate(tx, rx); // throw std::runtime_error EepRom::Container romData; @@ -73,7 +73,7 @@ ics::ID ics::ICS3::getID() { } void ics::ICS3::setID(const ID& id) { - const Core::IDContainerTx tx {getCmd(0xE0, id), 1, 1, 1}; + const Core::IDContainerTx tx {getCmd(0xE0, id), 0x01, 0x01, 0x01}; Core::IDContainerRx rx; core->communicateID(tx, rx); } From c2dcd58ec46b39987ae89cb43c2e0d8050245d25 Mon Sep 17 00:00:00 2001 From: Doi Yusuke Date: Fri, 4 Nov 2016 02:45:44 +0900 Subject: [PATCH 3/3] Add argument task to setup.sh --- script/setup.sh | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/script/setup.sh b/script/setup.sh index 17db39f..916fe9a 100755 --- a/script/setup.sh +++ b/script/setup.sh @@ -5,20 +5,29 @@ invalidPID(){ [ $1 -lt 9 ] && return 1 return 0 } - -echo "Please select your device" -echo "1. ICS USB ADAPTER" -echo "2. SERIAL USB ADAPTER" -echo "3~5: nothing" -echo "6. ICS USB ADAPTER HS" -echo "7. SERIAL USB ADAPTER HS" -echo "8. DUAl USB ADAPTER HS" -read onePID -expr $onePID + 1 > /dev/null 2>&1 -INTCHECK=$? -if [ $INTCHECK -gt 1 ]; then - echo "Invalid argument" - return 1 +if [ $# -gt 0 ]; then + expr $1 + 1 > /dev/null 2>&1 + inputCheck=$? +else + inputCheck=5 +fi +if [ $inputCheck -gt 1 ]; then + echo "Please select your device" + echo "1. ICS USB ADAPTER" + echo "2. SERIAL USB ADAPTER" + echo "3~5: nothing" + echo "6. ICS USB ADAPTER HS" + echo "7. SERIAL USB ADAPTER HS" + echo "8. DUAl USB ADAPTER HS" + read onePID + expr $onePID + 1 > /dev/null 2>&1 + INTCHECK=$? + if [ $INTCHECK -gt 1 ]; then + echo "Invalid argument" + return 1 +fi +else + onePID=$1 fi if invalidPID $onePID; then echo "Out of range"