Skip to content

Commit 99f9ff2

Browse files
author
Clarke Stevens
committed
Updated scripts for esp32
1 parent be00376 commit 99f9ff2

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

reset.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,17 @@ OCFBASEPATH=`jq --raw-output '.ocf_base_path' ${CURPWD}/${PROJNAME}-config.json`
66
# TODO Go through DeviceBuilder for each of the implementations and platforms (just doing the first array element for this example)
77
OCFSUBPATH=`jq --raw-output '.implementation_paths[0]' ${CURPWD}/${PROJNAME}-config.json`
88
OCFPATH="${OCFBASEPATH}${OCFSUBPATH}"
9+
PLATFORM=`jq --raw-output '.platforms[0]' ${CURPWD}/${PROJNAME}-config.json`
910

10-
if [ "$OCFSUBPATH" == "/iot" ]; then
11+
if [ "$PLATFORM" == "esp32" ]; then
12+
MY_COMMAND="cd ${OCFPATH}/iotivity-lite/port/${PLATFORM}/"
13+
eval ${MY_COMMAND}
14+
MY_COMMAND="idf.py erase_flash"
15+
eval ${MY_COMMAND}
16+
cd $CURPWD
17+
elif [ "$PLATFORM" == "arduino" ]; then
18+
echo "Arduino reset"
19+
elif [ "$OCFSUBPATH" == "/iot" ]; then
1120
rm -f ./bin/server_security.dat
1221
MY_COMMAND="cp ${OCFPATH}/iotivity/resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.dat ./bin/server_security.dat"
1322
eval ${MY_COMMAND}

run.sh

+11-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22
CURPWD=`pwd`
33
PROJNAME=${PWD##*/}
44

5-
cd ./bin
5+
PLATFORM=`jq --raw-output '.platforms[0]' ${CURPWD}/${PROJNAME}-config.json`
6+
7+
if [ "$PLATFORM" == "esp32" ]; then
8+
MY_COMMAND="cd ${OCFPATH}/iotivity-lite/port/${PLATFORM}/"
9+
eval ${MY_COMMAND}
10+
MY_COMMAND="idf.py -p /dev/ttyUSB0 flash monitor"
11+
eval ${MY_COMMAND}
12+
else
13+
cd ./bin
14+
./${PROJNAME}
15+
fi
616

7-
./${PROJNAME}
817
cd ${CURPWD}

0 commit comments

Comments
 (0)