summaryrefslogtreecommitdiff
path: root/src/testApp.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2012-06-30 09:58:06 +0100
committerTim Redfern <tim@eclectronics.org>2012-06-30 09:58:06 +0100
commit4525c22d902e1eff47d6a8a64d022d885ac3a76a (patch)
tree4601b215e8590030e5644848df9db6f7d0a46a12 /src/testApp.cpp
parentafed229f7f70d51313239394f6e1079fa6086da3 (diff)
version 1.0
Diffstat (limited to 'src/testApp.cpp')
-rw-r--r--src/testApp.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/testApp.cpp b/src/testApp.cpp
index 9de5fab..7b28acd 100644
--- a/src/testApp.cpp
+++ b/src/testApp.cpp
@@ -215,13 +215,16 @@ void testApp::update(){
float r=ofRandom(windowWidth/3)+(windowWidth/6);
devices[number]=obtsDevice(imsi,imei,number,icons,ofVec2f(a,r));
}
- devices[number].excite(); //whenever an event concerns a device it brightens
+
+ if(tokens[3].find("retreived")==string::npos) devices[number].excite(); //whenever an event concerns a device it brightens
+
if(tokens[3].find("joined network")!=string::npos) devices[number].connect();
if(tokens[3].find("leaving network")!=string::npos) devices[number].disconnect();
if(tokens[3].find("queued")!=string::npos) {
string t_number=split(tokens[3],' ')[4];
printf(">>> SMS from %s to %s (%i)\n",number.c_str(),t_number.c_str(),devices.count(t_number));
if (devices.count(t_number)) {
+ devices[t_number].connect(); //just in case it hasnt been recognised
devices[number].sms(&devices[t_number]);
}
}
@@ -229,6 +232,7 @@ void testApp::update(){
string t_number=split(tokens[3],' ')[3];
printf(">>> call from %s to %s\n",number.c_str(),t_number.c_str());
if (devices.count(t_number)) {
+ devices[t_number].connect(); //just in case it hasnt been recognised
devices[number].call(&devices[t_number]);
}
else devices[number].call(&devices["default"]);
@@ -237,6 +241,7 @@ void testApp::update(){
string t_number=split(tokens[3],' ')[4];
printf(">>> ringing from %s to %s\n",number.c_str(),t_number.c_str());
if (devices.count(t_number)) {
+ devices[t_number].connect(); //just in case it hasnt been recognised
devices[number].ringing(&devices[t_number]);
}
}
@@ -244,6 +249,7 @@ void testApp::update(){
string t_number=split(tokens[3],' ')[3];
printf(">>> call connected from %s to %s\n",number.c_str(),t_number.c_str());
if (devices.count(t_number)) {
+ devices[t_number].connect(); //just in case it hasnt been recognised
devices[number].connectCall();
}
}