SakuraIO

Fork of SakuraIO by SAKURA Internet

Files at this revision

API Documentation at this revision

Comitter:
chibiegg
Date:
Fri Jan 06 17:57:08 2017 +0900
Parent:
5:84a9fcd0c28b
Commit message:
Follow SakuraIOArduino v1.0.3

Changed in this revision

SakuraIO.cpp Show annotated file Show diff for this revision Revisions of this file
SakuraIO.h Show annotated file Show diff for this revision Revisions of this file
diff -r 84a9fcd0c28b -r 25e1fa75c64d SakuraIO.cpp
--- a/SakuraIO.cpp	Thu Nov 24 14:57:52 2016 +0000
+++ b/SakuraIO.cpp	Fri Jan 06 17:57:08 2017 +0900
@@ -1,19 +1,19 @@
 /* SAKURA Internet IoT Communication Module Library for mbed
- * 
+ *
  * The MIT License (MIT)
- * 
+ *
  * Copyright (c) SAKURA Internet Inc.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the Software
  * is furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be included
  * in all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@@ -106,7 +106,7 @@
   return response[0];
 }
 
-uint8_t SakuraIO::getSignalQuarity(){
+uint8_t SakuraIO::getSignalQuality(){
   uint8_t responseLength = 1;
   uint8_t response[1] = {0x00};
 
@@ -116,6 +116,11 @@
   return response[0];
 }
 
+uint8_t SakuraIO::getSignalQuarity(){
+  // deprecated
+  return getSignalQuality();
+}
+
 uint64_t SakuraIO::getUnixtime(){
   uint8_t responseLength = 8;
   uint8_t response[8] = {0x00};
diff -r 84a9fcd0c28b -r 25e1fa75c64d SakuraIO.h
--- a/SakuraIO.h	Thu Nov 24 14:57:52 2016 +0000
+++ b/SakuraIO.h	Fri Jan 06 17:57:08 2017 +0900
@@ -1,19 +1,19 @@
 /* SAKURA Internet IoT Communication Module Library for mbed
- * 
+ *
  * The MIT License (MIT)
- * 
+ *
  * Copyright (c) SAKURA Internet Inc.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the Software
  * is furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be included
  * in all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@@ -28,6 +28,8 @@
 #include "mbed.h"
 #include <SakuraIO/commands.h>
 
+#define SAKURAIO_CONNECTION_STATUS_MASK (0x80)
+
 class SakuraIO
 {
 protected:
@@ -48,7 +50,8 @@
 
 public:
   uint8_t getConnectionStatus();
-  uint8_t getSignalQuarity();
+  uint8_t getSignalQuarity(); // Deprecated
+  uint8_t getSignalQuality();
   uint64_t getUnixtime();
   uint8_t echoback(uint8_t length, uint8_t *data, uint8_t *response);
   uint16_t getADC(uint8_t channel);
@@ -102,7 +105,7 @@
 protected:
   I2C i2c;
   int _length;
- 
+
   virtual void begin();
   virtual void end();
   virtual void sendByte(uint8_t data);