summaryrefslogtreecommitdiff
path: root/Libraries/WiShield/WiShield.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/WiShield/WiShield.cpp')
-rw-r--r--Libraries/WiShield/WiShield.cpp32
1 files changed, 27 insertions, 5 deletions
diff --git a/Libraries/WiShield/WiShield.cpp b/Libraries/WiShield/WiShield.cpp
index 2e61afa..4488a67 100644
--- a/Libraries/WiShield/WiShield.cpp
+++ b/Libraries/WiShield/WiShield.cpp
@@ -41,12 +41,13 @@ extern "C" {
#include "spi.h"
void stack_init(void);
void stack_process(void);
+ void stack_send_udp(void);
}
#include "WProgram.h"
#include "WiShield.h"
-void WiShield::init()
+void WiShield::init(int async)
{
zg_init();
@@ -61,11 +62,26 @@ void WiShield::init()
PCMSK0 |= (1<<PCINT0);
#endif
- while(zg_get_conn_state() != 1) {
- zg_drv_process();
- }
+ if (async == 0)
+ {
+ while(zg_get_conn_state() != 1) {
+ zg_drv_process();
+ }
- stack_init();
+ stack_init();
+ }
+}
+
+int WiShield::continueInit()
+{
+ if (zg_get_conn_state() != 1)
+ {
+ zg_drv_process();
+ return 0;
+ } else {
+ stack_init();
+ return 1;
+ }
}
void WiShield::run()
@@ -74,6 +90,12 @@ void WiShield::run()
zg_drv_process();
}
+void WiShield::sendUdp()
+{
+ stack_send_udp();
+ zg_drv_process();
+}
+
#if defined USE_DIG8_INTR && !defined APP_WISERVER
// PCINT0 interrupt vector
ISR(PCINT0_vect)