Rick McConney
/
stripReader
Proximity strip reader
Fork of StarterKit by
Diff: Wnc.cpp
- Revision:
- 44:60008ebffdd4
- Parent:
- 43:3979ea0a2df3
- Child:
- 45:fe90f1fcb4e0
--- a/Wnc.cpp Mon Oct 10 16:29:34 2016 +0000 +++ b/Wnc.cpp Wed Oct 26 18:40:40 2016 +0000 @@ -17,8 +17,12 @@ DigitalOut shield_3v3_1v8_sig_trans_ena(PTC4); // 0 = disabled (all signals high impedence, 1 = translation active DigitalOut mdm_uart1_cts(PTD0); +DigitalOut uart1Rts(PTD1); + SerialBuffered mdm(PTD3, PTD2, 512); +int t3412Timer = 4*60*60; +int t3324Timer = 20; bool powerSave = false; bool firstWake = false; @@ -99,6 +103,16 @@ mdm_wakeup_in = 0; } +int Wnc::gett3412Timer() +{ + return t3412Timer; +} + +int Wnc::gett3324Timer() +{ + return t3324Timer; +} + char* Wnc::read(int timeout_ms) { static char response[3200]; @@ -171,6 +185,7 @@ } int Wnc::init(void) { + uart1Rts = 0; mdm_wakeup_in.output(); // disable signal level translator (necessary // for the modem to boot properly) @@ -225,6 +240,7 @@ if(isModemResponding()) { SetLedColor(0); + //mdm_uart2_rx_boot_mode_sel = 0; return true; } SetLedColor(0); //off @@ -297,6 +313,8 @@ { if(on) { + t3412Timer = t3412; + t3324Timer = t3324; int tau = secToTau(t3412); int activity = secToActivity(t3324); mdm_wakeup_in = 0; //allow power sleep mode @@ -548,6 +566,7 @@ hi = reply[pos_start++]; } } + data[length/2] = NULL; } } }