summaryrefslogtreecommitdiff
path: root/pjlib/src/pj/os_symbian.h
diff options
context:
space:
mode:
Diffstat (limited to 'pjlib/src/pj/os_symbian.h')
-rw-r--r--pjlib/src/pj/os_symbian.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/pjlib/src/pj/os_symbian.h b/pjlib/src/pj/os_symbian.h
index 74ae7f0c..3497e7af 100644
--- a/pjlib/src/pj/os_symbian.h
+++ b/pjlib/src/pj/os_symbian.h
@@ -313,6 +313,21 @@ public:
}
}
+ //
+ // Return true if the access point connection is up
+ //
+ bool IsConnectionUp() const
+ {
+ return isConnectionUp_;
+ }
+
+ //
+ // Set access point connection status
+ //
+ void SetConnectionStatus(bool up)
+ {
+ isConnectionUp_ = up;
+ }
//
// Unicode Converter
@@ -353,6 +368,8 @@ public:
}
private:
+ bool isConnectionUp_;
+
bool isSocketServInitialized_;
RSocketServ socketServ_;
@@ -374,6 +391,17 @@ private:
PjSymbianOS();
};
+// This macro is used to check the access point connection status and return
+// failure if the AP connection is down or unusable. See the documentation
+// of pj_symbianos_set_connection_status() for more info
+#define PJ_SYMBIAN_CHECK_CONNECTION() \
+ PJ_SYMBIAN_CHECK_CONNECTION2(PJ_ECANCELLED)
+
+#define PJ_SYMBIAN_CHECK_CONNECTION2(retval) \
+ do { \
+ if (!PjSymbianOS::Instance()->IsConnectionUp()) \
+ return retval; \
+ } while (0);
#endif /* __OS_SYMBIAN_H__ */