C027_SupportTest_xively_locationで使用しているC027用ライブラリ

Fork of C027_Support by u-blox

下記のプログラムC027_SupportTest_xively_locationで使用しているC027用ライブラリです。

Import programC027_SupportTest_xively_location

インターフェース2014年10月号のu-blox C027で3G通信する記事で使用したプログラム。   CQ publishing Interface 2014.10 issue, C027 3G test program.

オリジナルのライブラリは下記を参照してください。

Import libraryC027_Support

support library for C027 helper functions for Buffer Pipes, Buffered Serial Port (rtos capable) and GPS parsing. It includes modem APIs for USSD, SMS and Sockets.

Revision:
95:8282dbbe1492
Parent:
76:f7c3dd568dae
--- a/GPS.cpp	Thu Jun 12 12:41:26 2014 +0000
+++ b/GPS.cpp	Tue Jun 17 07:03:48 2014 +0000
@@ -1,7 +1,6 @@
 #include "mbed.h"
 #include <ctype.h>
 #include "GPS.h"
-#include "Relax.h"
 #ifdef TARGET_UBLOX_C027
  #include "C027_api.h"
 #endif
@@ -261,16 +260,14 @@
 bool GPSSerial::init(PinName pn)
 {
     // send a byte to wakup the device again
-    putc(0);
+    putc(0xFF);
     // wait until we get some bytes
     int size = _pipeRx.size();
-    int i = 30;
-    while (i--) {
-        RELAX_MS(10);
-        if(size != _pipeRx.size())
-            break;
-    }   
-    return (i >= 0);
+    Timer timer;
+    timer.start();
+    while ((100 > timer.read_ms()) && (size == _pipeRx.size()))
+        /* nothing / just wait */;
+    return (size != _pipeRx.size());
 }
 
 int GPSSerial::getMessage(char* buf, int len)
@@ -314,9 +311,9 @@
 {
     if (pn != NC) {
         DigitalOut pin(pn, 0);
-        wait_us(1);
+        ::wait_us(1);
         pin = 1;
-        RELAX_MS(100);
+        ::wait_ms(100);
     }
     return !I2C::write(_i2cAdr,&REGSTREAM,sizeof(REGSTREAM));
 }