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:
11:b084552b03fe
Parent:
9:e7a5959ffae1
Child:
12:684b31d5482b
--- a/SerialPipe.cpp	Thu Nov 14 12:57:21 2013 +0000
+++ b/SerialPipe.cpp	Thu Nov 14 15:52:36 2013 +0000
@@ -16,26 +16,29 @@
 }
 
 // tx channel
-int SerialPipe::put(const char* b, int s, bool t)    
+int SerialPipe::put(const char* b, int n, bool t)    
 { 
-    int c = 0;
-    while (s && t)
+    int c = n;
+    while (c && t)
     {
-        c += _pipeTx.put(b, s, false);
-        b ++;
-        s --;
+        int i = _pipeTx.put(b, c, false);
+        b += i;
+        c -= i;
         // give a chance to start tx
         __disable_irq();
         txIrqBuf();
         __enable_irq();
     }
-    return c;
+    return (n - c);
 }
 
 void SerialPipe::txIrqBuf(void)
 {
     while (serial_writable(&_serial) && _pipeTx.readable())
-        serial_putc(&_serial, _pipeTx.getc());
+    {
+        char ch = _pipeTx.getc();
+        serial_putc(&_serial, ch);
+    }
 }
 
 // rx channel