Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
Merge pull request #13 from forno/update-v1.2.2
Browse files Browse the repository at this point in the history
Update v1.2.2 with setup.sh upgrade
  • Loading branch information
forno committed Nov 3, 2016
2 parents e013a02 + c2dcd58 commit 9444e65
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down
37 changes: 23 additions & 14 deletions script/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/ics3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

0 comments on commit 9444e65

Please sign in to comment.