Fork of https://developer.mbed.org/teams/Renesas/code/GR-PEACH_mbed-os-client-ZXingSample/

Files at this revision

API Documentation at this revision

Comitter:
Osamu Nakamura
Date:
Fri Jan 12 15:41:00 2018 +0900
Commit message:
Initial commit

Changed in this revision

.gitignore Show annotated file Show diff for this revision Revisions of this file
AsciiFont.lib Show annotated file Show diff for this revision Revisions of this file
DisplayApp.lib Show annotated file Show diff for this revision Revisions of this file
GR-PEACH_video.lib Show annotated file Show diff for this revision Revisions of this file
GW_Binary/gateway6LoWPANDynamic.bin Show annotated file Show diff for this revision Revisions of this file
GW_Binary/gateway6LoWPANStatic.bin Show annotated file Show diff for this revision Revisions of this file
GW_Binary/gatewayThreadDynamic.bin Show annotated file Show diff for this revision Revisions of this file
GW_Binary/gatewayThreadStatic.bin Show annotated file Show diff for this revision Revisions of this file
GraphicsFramework.lib Show annotated file Show diff for this revision Revisions of this file
LCD_shield_config.lib Show annotated file Show diff for this revision Revisions of this file
LICENSE Show annotated file Show diff for this revision Revisions of this file
R_BSP.lib Show annotated file Show diff for this revision Revisions of this file
USBDevice.lib Show annotated file Show diff for this revision Revisions of this file
apache-2.0.txt Show annotated file Show diff for this revision Revisions of this file
configs/eth-wifi-mbedignore Show annotated file Show diff for this revision Revisions of this file
configs/eth_v4.json Show annotated file Show diff for this revision Revisions of this file
configs/eth_v6.json Show annotated file Show diff for this revision Revisions of this file
configs/mesh-mbedignore Show annotated file Show diff for this revision Revisions of this file
configs/mesh_6lowpan.json Show annotated file Show diff for this revision Revisions of this file
configs/mesh_6lowpan_subg.json Show annotated file Show diff for this revision Revisions of this file
configs/mesh_thread.json Show annotated file Show diff for this revision Revisions of this file
configs/wifi_esp8266_v4.json Show annotated file Show diff for this revision Revisions of this file
configs/wifi_odin_v4.json Show annotated file Show diff for this revision Revisions of this file
configs/wifi_v4.json Show annotated file Show diff for this revision Revisions of this file
docs/img/Radio_Identifications.png Show annotated file Show diff for this revision Revisions of this file
docs/img/Radio_Identifications_GW.png Show annotated file Show diff for this revision Revisions of this file
docs/img/ep_lookup.PNG Show annotated file Show diff for this revision Revisions of this file
docs/radio_module_identify.md Show annotated file Show diff for this revision Revisions of this file
easy-connect-gr-peach.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-client.lib Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
mbed_app.json Show annotated file Show diff for this revision Revisions of this file
mbed_client_config.h Show annotated file Show diff for this revision Revisions of this file
mbed_settings.py Show annotated file Show diff for this revision Revisions of this file
mbedtls_mbed_client_config.h Show annotated file Show diff for this revision Revisions of this file
pal.lib Show annotated file Show diff for this revision Revisions of this file
security.h Show annotated file Show diff for this revision Revisions of this file
simpleclient.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/ImageReaderSource.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/TOOLCHAIN_ARM_STD/zxing_lib.ar Show annotated file Show diff for this revision Revisions of this file
zxing_lib/TOOLCHAIN_GCC_ARM/libzxing.a Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/BarcodeFormat.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/Binarizer.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/BinaryBitmap.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/DecodeHints.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/Exception.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/LuminanceSource.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/MultiFormatReader.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/Reader.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/ReaderException.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/Result.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/ResultPoint.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/ResultPointCallback.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/ZXing.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/common/Array.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/common/BitArray.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/common/BitMatrix.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/common/Counted.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/common/DecoderResult.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/common/GlobalHistogramBinarizer.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/common/HybridBinarizer.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/common/IllegalArgumentException.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/common/Str.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/common/reedsolomon/GenericGF.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/common/reedsolomon/GenericGFPoly.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/common/reedsolomon/ReedSolomonDecoder.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/multi/ByQuadrantReader.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/multi/GenericMultipleBarcodeReader.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/multi/MultipleBarcodeReader.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/multi/qrcode/QRCodeMultiReader.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/qrcode/QRCodeReader.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing/qrcode/decoder/Decoder.h Show annotated file Show diff for this revision Revisions of this file
zxing_lib/zxing_config.h Show annotated file Show diff for this revision Revisions of this file
zxing_main.cpp Show annotated file Show diff for this revision Revisions of this file
zxing_main.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.gitignore	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,34 @@
+# Object files
+*.o
+*.ko
+*.obj
+*.elf
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Libraries
+*.a
+*.la
+*.lo
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.out
+*.app
+*.i*86
+*.x86_64
+*.hex
+
+yotta_modules/
+yotta_targets/
+build/
+.yotta.json
+source/security.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/AsciiFont.lib	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/Renesas/code/AsciiFont/#1eaa4942db53
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DisplayApp.lib	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/dkato/code/DisplayApp/#b7ffe5216cd7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GR-PEACH_video.lib	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/Renesas/code/GR-PEACH_video/#aeefe5171463
Binary file GW_Binary/gateway6LoWPANDynamic.bin has changed
Binary file GW_Binary/gateway6LoWPANStatic.bin has changed
Binary file GW_Binary/gatewayThreadDynamic.bin has changed
Binary file GW_Binary/gatewayThreadStatic.bin has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GraphicsFramework.lib	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/Renesas/code/GraphicsFramework/#80f4beab1243
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LCD_shield_config.lib	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/dkato/code/LCD_shield_config/#720a62b44d67
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LICENSE	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,2 @@
+Unless specifically indicated otherwise in a file, files are licensed
+under the Apache 2.0 license, as can be found in: apache-2.0.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/R_BSP.lib	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/Renesas/code/R_BSP/#fb9eda52224e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/USBDevice.lib	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/mbed_official/code/USBDevice/#01321bd6ff89
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apache-2.0.txt	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,56 @@
+
+
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+    You must give any other recipients of the Work or Derivative Works a copy of this License; and
+    You must cause any modified files to carry prominent notices stating that You changed the files; and
+    You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+    If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
+
+    You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/configs/eth-wifi-mbedignore	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,3 @@
+easy-connect/atmel-rf-driver/*
+easy-connect/mcr20a-rf-driver/*
+easy-connect/stm-spirit1-rf-driver/*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/configs/eth_v4.json	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,22 @@
+{
+    "config": {
+        "network-interface":{
+            "help": "Options are ETHERNET, WIFI_ESP8266, WIFI_ODIN, MESH_LOWPAN_ND, MESH_THREAD",
+            "value": "ETHERNET"
+        }
+    },
+    "macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\""],
+    "target_overrides": {
+        "*": {
+            "target.features_add": ["LWIP", "COMMON_PAL"],
+            "platform.stdio-baud-rate": 115200,
+            "platform.stdio-convert-newlines": true,
+            "lwip.ipv4-enabled": true,
+            "lwip.ipv6-enabled": false,
+            "mbed-trace.enable": 0
+        },
+            "UBLOX_EVK_ODIN_W2": {
+            "target.device_has_remove": ["EMAC"]
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/configs/eth_v6.json	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,22 @@
+{
+    "config": {
+        "network-interface":{
+            "help": "Options are ETHERNET, WIFI_ESP8266, WIFI_ODIN, MESH_LOWPAN_ND, MESH_THREAD",
+            "value": "ETHERNET"
+        }
+    },
+    "macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\""],
+    "target_overrides": {
+        "*": {
+            "target.features_add": ["LWIP", "COMMON_PAL"],
+            "platform.stdio-baud-rate": 115200,
+            "platform.stdio-convert-newlines": true,
+            "lwip.ipv4-enabled": false,
+            "lwip.ipv6-enabled": true,
+            "mbed-trace.enable": 0
+        },
+            "UBLOX_EVK_ODIN_W2": {
+            "target.device_has_remove": ["EMAC"]
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/configs/mesh-mbedignore	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,1 @@
+easy-connect/esp8266-driver/*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/configs/mesh_6lowpan.json	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,23 @@
+{
+    "config": {
+        "network-interface":{
+            "help": "Options are ETHERNET, WIFI_ESP8266, WIFI_ODIN, MESH_LOWPAN_ND, MESH_THREAD",
+            "value": "MESH_LOWPAN_ND"
+        },
+        "mesh_radio_type": {
+        	"help": "options are ATMEL, MCR20",
+        	"value": "ATMEL"
+        }
+    },
+    "macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\""],
+    "target_overrides": {
+        "*": {
+            "target.features_add": ["NANOSTACK", "LOWPAN_ROUTER", "COMMON_PAL"],
+            "platform.stdio-baud-rate": 115200,
+            "platform.stdio-convert-newlines": true,
+            "mbed-mesh-api.6lowpan-nd-channel-page": 0,
+            "mbed-mesh-api.6lowpan-nd-channel": 12,
+            "mbed-trace.enable": 0
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/configs/mesh_6lowpan_subg.json	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,26 @@
+{
+    "config": {
+        "network-interface":{
+            "help": "Options are ETHERNET, WIFI_ESP8266, WIFI_ODIN, MESH_LOWPAN_ND, MESH_THREAD",
+            "value": "MESH_LOWPAN_ND"
+        },
+        "mesh_radio_type": {
+        	"help": "options are ATMEL, MCR20, SPIRIT1",
+        	"value": "SPIRIT1"
+        }
+    },
+    "macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\""],
+    "target_overrides": {
+        "*": {
+            "spirit1.mac-address": "{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7}",
+            "target.features_add": ["NANOSTACK", "LOWPAN_ROUTER", "COMMON_PAL"],
+            "platform.stdio-baud-rate": 115200,
+            "platform.stdio-convert-newlines": true,
+            "mbed-mesh-api.6lowpan-nd-security-mode": "PSK",
+            "mbed-mesh-api.6lowpan-nd-channel-page": 2,
+            "mbed-mesh-api.6lowpan-nd-channel": 1,
+            "mbed-mesh-api.6lowpan-nd-channel-mask": "(1<<1)",
+            "mbed-trace.enable": 0
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/configs/mesh_thread.json	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,23 @@
+{
+    "config": {
+        "network-interface":{
+            "help": "Options are ETHERNET, WIFI_ESP8266, WIFI_ODIN, MESH_LOWPAN_ND, MESH_THREAD",
+            "value": "MESH_THREAD"
+        },
+        "mesh_radio_type": {
+        	"help": "options are ATMEL, MCR20",
+        	"value": "ATMEL"
+        }
+    },
+    "macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\""],
+    "target_overrides": {
+        "*": {
+            "target.features_add": ["NANOSTACK", "THREAD_ROUTER", "COMMON_PAL"],
+            "platform.stdio-baud-rate": 115200,
+            "platform.stdio-convert-newlines": true,
+            "mbed-mesh-api.thread-config-channel": 22,
+            "mbed-mesh-api.thread-config-panid": "0x0700",
+            "mbed-trace.enable": 0
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/configs/wifi_esp8266_v4.json	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,43 @@
+{
+    "config": {
+        "network-interface":{
+            "help": "Options are ETHERNET, WIFI_ESP8266, WIFI_ODIN, MESH_LOWPAN_ND, MESH_THREAD",
+            "value": "WIFI_ESP8266"
+        },
+        "wifi-ssid": {
+            "help": "WiFi SSID",
+            "value": "\"SSID\""
+        },
+        "wifi-password": {
+            "help": "WiFi Password",
+            "value": "\"Password\""
+        },
+        "wifi-tx": {
+            "help": "TX pin for serial connection to external device",
+            "value": "D1"
+        },
+        "wifi-rx": {
+            "help": "RX pin for serial connection to external device",
+            "value": "D0"
+        }
+    },
+    "macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\""],
+    "target_overrides": {
+        "*": {
+            "target.features_add": ["LWIP", "COMMON_PAL"],
+            "platform.stdio-baud-rate": 115200,
+            "platform.stdio-convert-newlines": true,
+            "lwip.ipv4-enabled": true,
+            "lwip.ipv6-enabled": false,
+            "mbed-trace.enable": 0
+        },
+        "NUCLEO_F401RE": {
+            "wifi-tx": "PA_11",
+            "wifi-rx": "PA_12"
+        },
+        "NUCLEO_F411RE": {
+            "wifi-tx": "PA_11",
+            "wifi-rx": "PA_12"
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/configs/wifi_odin_v4.json	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,43 @@
+{
+    "config": {
+        "network-interface":{
+            "help": "Options are ETHERNET, WIFI_ESP8266, WIFI_ODIN, MESH_LOWPAN_ND, MESH_THREAD",
+            "value": "WIFI_ODIN"
+        },
+        "wifi-ssid": {
+            "help": "WiFi SSID",
+            "value": "\"SSID\""
+        },
+        "wifi-password": {
+            "help": "WiFi Password",
+            "value": "\"Password\""
+        },
+        "wifi-tx": {
+            "help": "TX pin for serial connection to external device",
+            "value": "D1"
+        },
+        "wifi-rx": {
+            "help": "RX pin for serial connection to external device",
+            "value": "D0"
+        }
+    },
+    "macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\""],
+    "target_overrides": {
+        "*": {
+            "target.features_add": ["LWIP", "COMMON_PAL"],
+            "platform.stdio-baud-rate": 115200,
+            "platform.stdio-convert-newlines":true,
+            "lwip.ipv4-enabled": true,
+            "lwip.ipv6-enabled": false,
+            "mbed-trace.enable": 0
+        },
+        "NUCLEO_F401RE": {
+            "wifi-tx": "PA_11",
+            "wifi-rx": "PA_12"
+        },
+        "NUCLEO_F411RE": {
+            "wifi-tx": "PA_11",
+            "wifi-rx": "PA_12"
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/configs/wifi_v4.json	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,43 @@
+{
+    "config": {
+        "network-interface":{
+            "help": "Options are ETHERNET, WIFI_ESP8266, WIFI_ODIN, MESH_LOWPAN_ND, MESH_THREAD",
+            "value": "WIFI_ESP8266"
+        },
+        "wifi-ssid": {
+            "help": "WiFi SSID",
+            "value": "\"SSID\""
+        },
+        "wifi-password": {
+            "help": "WiFi Password",
+            "value": "\"Password\""
+        },
+        "wifi-tx": {
+            "help": "TX pin for serial connection to external device",
+            "value": "D1"
+        },
+        "wifi-rx": {
+            "help": "RX pin for serial connection to external device",
+            "value": "D0"
+        }
+    },
+    "macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\""],
+    "target_overrides": {
+        "*": {
+            "target.features_add": ["LWIP", "COMMON_PAL"],
+            "platform.stdio-baud-rate": 115200,
+            "platform.stdio-convert-newlines": true,
+            "lwip.ipv4-enabled": true,
+            "lwip.ipv6-enabled": false,
+            "mbed-trace.enable": 0
+        },
+        "NUCLEO_F401RE": {
+            "wifi-tx": "PA_11",
+            "wifi-rx": "PA_12"
+        },
+        "NUCLEO_F411RE": {
+            "wifi-tx": "PA_11",
+            "wifi-rx": "PA_12"
+        }
+    }
+}
Binary file docs/img/Radio_Identifications.png has changed
Binary file docs/img/Radio_Identifications_GW.png has changed
Binary file docs/img/ep_lookup.PNG has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/radio_module_identify.md	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,17 @@
+## Radio module identification
+
+* Make sure that you are using the same radio modules on both server and client sides:
+
+	* If the radio module on the gateway router supports the 2.4 GHz frequency band, the client side must have an mbed 6LoWPAN shield that uses a 2.4 GHz radio module (such as Atmel AT86RF233).
+
+	* If the radio module on the gateway router supports the sub-GHz frequency band, the client side must have an mbed 6LoWPAN shield that uses a sub-GHz radio module (such as Atmel AT86RF212B).
+
+* An easy way to identify which frequency band your setup uses is to check the **Antenna size** on the radio module:
+
+	* The sub-GHz band antenna is larger than the 2.4 GHz antenna.
+
+	* For the client side (mbed 6LoWPAN shield connected to an FRDM-K64F board), see the image below:
+  ![](img/Radio_Identifications.png) 
+
+	* For the gateway router, see the image below:
+  ![](img/Radio_Identifications_GW.png) 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easy-connect-gr-peach.lib	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/dkato/code/easy-connect-gr-peach/#34fe4f11941d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,370 @@
+/*
+ * Copyright (c) 2015, 2016 ARM Limited. All rights reserved.
+ * SPDX-License-Identifier: Apache-2.0
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "mbed-trace/mbed_trace.h"
+#include "mbed.h"
+#include "zxing_main.h"
+
+// Network interaction must be performed outside of interrupt context
+osThreadId mainThread;
+
+#define NO_CONNECT         (-1)
+
+#if MBED_CONF_APP_NETWORK_INTERFACE == NO_CONNECT
+
+static void callback_zxing(char * addr, int size) {
+    printf("%s\r\n", addr);
+}
+
+// Entry point to the program
+int main() {
+    // Keep track of the main thread
+    mainThread = osThreadGetId();
+    printf("no connect\n");
+    mbed_trace_init();
+    zxing_init(&callback_zxing);
+
+    while (1) {
+        zxing_loop();
+        Thread::wait(5);
+    }
+}
+
+#else // MBED_CONF_APP_NETWORK_INTERFACE != NO_CONNECT
+
+#define __STDC_FORMAT_MACROS
+#include <string>
+#include <sstream>
+#include <vector>
+#include "security.h"
+#include "simpleclient.h"
+#include "mbedtls/entropy_poll.h"
+
+// easy-connect compliancy, it has 2 sets of wifi pins we have only one
+#define MBED_CONF_APP_ESP8266_TX MBED_CONF_APP_WIFI_TX
+#define MBED_CONF_APP_ESP8266_RX MBED_CONF_APP_WIFI_RX
+#include "easy-connect.h"
+
+// These are example resource values for the Device Object
+struct MbedClientDevice device = {
+    "Manufacturer_String",      // Manufacturer
+    "Type_String",              // Type
+    "ModelNumber_String",       // ModelNumber
+    "SerialNumber_String"       // SerialNumber
+};
+
+// Instantiate the class which implements LWM2M Client API (from simpleclient.h)
+MbedClient mbed_client(device);
+
+// LED Output
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+/*
+ * The Led contains one property (pattern) and a function (blink).
+ * When the function blink is executed, the pattern is read, and the LED
+ * will blink based on the pattern.
+ */
+class LedResource {
+public:
+    LedResource() {
+        // create ObjectID with metadata tag of '3201', which is 'digital output'
+        led_object = M2MInterfaceFactory::create_object("3201");
+        M2MObjectInstance* led_inst = led_object->create_object_instance();
+
+        // 5855 = Multi-state output
+        M2MResource* color_res = led_inst->create_dynamic_resource("5855", "Color",
+            M2MResourceInstance::STRING, false);
+        // read and write
+        color_res->set_operation(M2MBase::GET_PUT_ALLOWED);
+        // set red as initial color
+        color_res->set_value((const uint8_t*)"red", 3);
+        
+        // 5853 = Multi-state output
+        M2MResource* pattern_res = led_inst->create_dynamic_resource("5853", "Pattern",
+            M2MResourceInstance::STRING, false);
+        // read and write
+        pattern_res->set_operation(M2MBase::GET_PUT_ALLOWED);
+        // set initial pattern (toggle every 200ms. 7 toggles in total)
+        pattern_res->set_value((const uint8_t*)"500:500:500:500:500:500:500", 27);
+
+        // there's not really an execute LWM2M ID that matches... hmm...
+        M2MResource* led_res = led_inst->create_dynamic_resource("5850", "Blink",
+            M2MResourceInstance::OPAQUE, false);
+        // we allow executing a function here...
+        led_res->set_operation(M2MBase::POST_ALLOWED);
+        // when a POST comes in, we want to execute the led_execute_callback
+        led_res->set_execute_function(execute_callback(this, &LedResource::blink));
+
+    }
+
+    M2MObject* get_object() {
+        return led_object;
+    }
+
+    void blink(void *argument) {
+
+
+        // read the value of 'Pattern'
+        M2MObjectInstance* inst = led_object->object_instance();
+        M2MResource* res = inst->resource("5853");
+        // read the value of 'Color'
+        M2MObjectInstance* instC = led_object->object_instance();
+        M2MResource* resC = instC->resource("5855");
+
+        // values in mbed Client are all buffers, and we need a vector of int's
+        uint8_t* buffIn = NULL;
+        uint32_t sizeIn;
+        res->get_value(buffIn, sizeIn);
+        
+        uint8_t* cbuffIn = NULL;
+        uint32_t csizeIn;
+        resC->get_value(cbuffIn, csizeIn);
+
+        // turn the buffer into a string, and initialize a vector<int> on the heap
+        std::string s((char*)buffIn, sizeIn);
+        std::vector<uint32_t>* v = new std::vector<uint32_t>;
+
+        printf("led_execute_callback pattern=%s\r\n", s.c_str());
+
+        // our pattern is something like 500:200:500, so parse that
+        std::size_t found = s.find_first_of(":");
+        while (found!=std::string::npos) {
+
+            v->push_back(atoi((const char*)s.substr(0,found).c_str()));
+            s = s.substr(found+1);
+            found=s.find_first_of(":");
+            if(found == std::string::npos) {
+                v->push_back(atoi((const char*)s.c_str()));
+            }
+        }
+        int position = 0;
+        while (1) {
+            do_blink(cbuffIn);
+            if (position >= v->size()) {
+                break;
+            }
+            // how long do we need to wait before the next blink?
+            Thread::wait(v->at(position));
+            position++;
+        }
+        free(buffIn);
+        free(cbuffIn);
+        delete v;
+    }
+
+private:
+    M2MObject* led_object;
+    void do_blink(uint8_t* color) {
+        
+        if (!strcmp((char *)color, "red")) {
+            // blink the LED in red color
+            led1 = !led1;
+        }
+        else if (!strcmp((char *)color, "green")) {
+            // blink in green color
+            led2 = !led2;
+        }
+        else if (!strcmp((char *)color, "blue")) {
+            // blink in blue color
+            led3 = !led3;
+        }
+        else if (!strcmp((char *)color, "cyan")) {
+            // blink in cyan color
+            led2 = !led2;
+            led3 = !led3;
+        }
+        else if (!strcmp((char *)color, "yellow")) {
+            // blink in yellow color
+            led1 = !led1;
+            led2 = !led2;
+        }
+        else if (!strcmp((char *)color, "magenta")) {
+            // blink in magenta color
+            led1 = !led1;
+            led3 = !led3;
+        }            
+        else if (!strcmp((char *)color, "white")) {
+            // blink in white color
+            led1 = !led1;
+            led2 = !led2;
+            led3 = !led3;
+        }
+        else {
+            // no operation
+        }
+    }
+};
+
+/*
+ * The Zxing contains a function (send string).
+ * When `handle_string_send` is executed, the string after decoding is sent.
+ */
+class ZxingResource {
+public:
+    ZxingResource() {
+        // create ObjectID with metadata tag of '3202', which is 'send string'
+        zxing_object = M2MInterfaceFactory::create_object("3202");
+        M2MObjectInstance* zxing_inst = zxing_object->create_object_instance();
+        // create resource with ID '5700', which is 'send string'
+        M2MResource* zxing_res = zxing_inst->create_dynamic_resource("5700", "zxing",
+            M2MResourceInstance::STRING, true);
+        // we can read this value
+        zxing_res->set_operation(M2MBase::GET_ALLOWED);
+        // set initial value (all values in mbed Client are buffers)
+        // to be able to read this data easily in the Connector console, we'll use a string
+        zxing_res->set_value((uint8_t*)"0", 1);
+    }
+
+    ~ZxingResource() {
+    }
+
+    M2MObject* get_object() {
+        return zxing_object;
+    }
+
+    /*
+     * When you success the decode process of barcode, we send the string after decoding to mbed Device Connector.
+     */
+    void handle_string_send(char * addr, int size) {
+        M2MObjectInstance* inst = zxing_object->object_instance();
+        M2MResource* res = inst->resource("5700");
+
+        printf("%s\r\n", addr);
+
+        // tell the string to connector
+        res->set_value((uint8_t *)addr, size);
+
+        // Write 0 to 3202/0/5700 so that the same item can be added to the cart consectively
+        res->set_value((uint8_t *)"0", 1);
+    }
+
+private:
+    M2MObject* zxing_object;
+};
+
+ZxingResource zxing_resource;
+
+static void callback_zxing(char * addr, int size) {
+    zxing_resource.handle_string_send(addr, size);
+}
+
+static volatile bool registered;
+
+void unregister() {
+    registered = false;
+}
+
+// Entry point to the program
+int main() {
+
+    unsigned int seed;
+    size_t len;
+
+#ifdef MBEDTLS_ENTROPY_HARDWARE_ALT
+    // Used to randomize source port
+    mbedtls_hardware_poll(NULL, (unsigned char *) &seed, sizeof seed, &len);
+
+#elif defined MBEDTLS_TEST_NULL_ENTROPY
+
+#warning "mbedTLS security feature is disabled. Connection will not be secure !! Implement proper hardware entropy for your selected hardware."
+    // Used to randomize source port
+    mbedtls_null_entropy_poll( NULL,(unsigned char *) &seed, sizeof seed, &len);
+
+#else
+
+#error "This hardware does not have entropy, endpoint will not register to Connector.\
+You need to enable NULL ENTROPY for your application, but if this configuration change is made then no security is offered by mbed TLS.\
+Add MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES and MBEDTLS_TEST_NULL_ENTROPY in mbed_app.json macros to register your endpoint."
+
+#endif
+
+    srand(seed);
+    // Keep track of the main thread
+    mainThread = osThreadGetId();
+    printf("\nStarting mbed Client example in ");
+
+#if defined (MESH) || (MBED_CONF_LWIP_IPV6_ENABLED==true)
+    printf("IPv6 mode\n");
+#else
+    printf("IPv4 mode\n");
+#endif
+
+    mbed_trace_init();
+
+#if MBED_CONF_APP_NETWORK_INTERFACE == WIFI_BP3595
+    DigitalOut usb1en(P3_8);
+    usb1en = 1;
+    Thread::wait(5);
+    usb1en = 0;
+    Thread::wait(5);
+#endif
+
+    NetworkInterface* network = easy_connect(true);
+    if(network == NULL) {
+        printf("\nConnection to Network Failed - exiting application...\n");
+        return -1;
+    }
+    LedResource led_resource;
+
+    // Create endpoint interface to manage register and unregister
+    mbed_client.create_interface(MBED_SERVER_ADDRESS, network);
+
+    // Create Objects of varying types, see simpleclient.h for more details on implementation.
+    M2MSecurity* register_object = mbed_client.create_register_object(); // server object specifying connector info
+    M2MDevice*   device_object   = mbed_client.create_device_object();   // device resources object
+
+    // Create list of Objects to register
+    M2MObjectList object_list;
+
+    // Add objects to list
+    object_list.push_back(device_object);
+    object_list.push_back(led_resource.get_object());
+    object_list.push_back(zxing_resource.get_object());
+
+    // Set endpoint registration object
+    mbed_client.set_register_object(register_object);
+
+    // Register with mbed Device Connector
+    mbed_client.test_register(register_object, object_list);
+
+    zxing_init(&callback_zxing);
+
+    Timer update_timer;
+    update_timer.reset();
+    update_timer.start();
+
+    registered = true;
+    InterruptIn unreg_button(USER_BUTTON0);
+    unreg_button.fall(&unregister);
+
+    while (registered) {
+        if (zxing_loop() == 0) {
+            update_timer.reset();
+        } else if (update_timer.read() >= 25) {
+            mbed_client.test_update_register();
+            update_timer.reset();
+        } else {
+            // do nothing
+        }
+        Thread::wait(5);
+    }
+
+    mbed_client.test_unregister();
+}
+
+#endif // MBED_CONF_APP_NETWORK_INTERFACE != NO_CONNECT
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-client.lib	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-client/#26ed79aa6cb88eead7ee0fe97ab5fbe8fa3a0b5e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#42be5c01a7f91292d5e27124ad9584236025f6ab
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed_app.json	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,53 @@
+{
+    "config": {
+        "network-interface":{
+            "help": "Options are ETHERNET, WIFI_ESP8266, WIFI_BP3595, NO_CONNECT",
+            "value": "ETHERNET"
+        },
+        "wifi-ssid": {
+            "help": "WiFi SSID",
+            "value": "\"SSID\""
+        },
+        "wifi-password": {
+            "help": "WiFi Password",
+            "value": "\"Password\""
+        },
+        "wifi-security":{
+            "help": "Options are NSAPI_SECURITY_WEP, NSAPI_SECURITY_WPA, NSAPI_SECURITY_WPA2, NSAPI_SECURITY_WPA_WPA2",
+            "value": "NSAPI_SECURITY_WPA_WPA2"
+        },
+        "wifi-tx": {
+            "help": "TX pin for serial connection to external device",
+            "value": "D1"
+        },
+        "wifi-rx": {
+            "help": "RX pin for serial connection to external device",
+            "value": "D0"
+        }
+    },
+    "macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\""],
+    "target_overrides": {
+        "*": {
+            "target.features_add": ["COMMON_PAL"],
+            "platform.stdio-baud-rate": 115200,
+            "platform.stdio-convert-newlines": true,
+            "mbed-trace.enable": 0
+        },
+        "NUCLEO_F401RE": {
+            "wifi-tx": "PA_11",
+            "wifi-rx": "PA_12"
+        },
+        "NUCLEO_F411RE": {
+            "wifi-tx": "PA_11",
+            "wifi-rx": "PA_12"
+        },
+        "RZ_A1H": {
+            "target.macros_add": ["MBEDTLS_TEST_NULL_ENTROPY", "MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES"]
+        },
+        "UBLOX_EVK_ODIN_W2": {
+        "target.device_has_remove": ["EMAC"]
+        }
+    }
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed_client_config.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2016 ARM Limited. All rights reserved.
+ * SPDX-License-Identifier: Apache-2.0
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef MBED_CLIENT_CONFIG_H
+#define MBED_CLIENT_CONFIG_H
+
+
+// Defines the number of times client should try re-connection towards
+// Server in case of connectivity loss , also defines the number of CoAP
+// re-transmission attempts.Default value is 3
+#define M2M_CLIENT_RECONNECTION_COUNT		3
+
+// Defines the interval (in seconds) in which client should try re-connection towards
+// Server in case of connectivity loss , also use the same interval for CoAP
+// re-transmission attempts. Default value is 5 seconds
+#define M2M_CLIENT_RECONNECTION_INTERVAL	5
+
+// Defines the keep-alive interval (in seconds) in which client should send keep alive
+// pings to server while connected through TCP mode. Default value is 300 seconds
+#define M2M_CLIENT_TCP_KEEPALIVE_TIME 		300
+
+// Defines the maximum CoAP messages that client can hold, maximum value is 6
+#define SN_COAP_DUPLICATION_MAX_MSGS_COUNT  2
+
+// Defines the size of blockwise CoAP messages that client can handle.
+// The values that can be defined uust be 2^x and x is at least 4.
+// Suitable values: 0, 16, 32, 64, 128, 256, 512 and 1024
+#define SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE  1024
+
+// Many pure LWM2M servers doen't accept 'obs' text in registration message.
+// While using Client against such servers, this flag can be set to define to
+// disable client sending 'obs' text for observable resources.
+#undef COAP_DISABLE_OBS_FEATURE
+
+// Disable Bootstrap functionality in client in order to reduce code size, if bootstrap
+// functionality is not required.
+#undef M2M_CLIENT_DISABLE_BOOTSTRAP_FEATURE
+
+#endif // MBED_CLIENT_CONFIG_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed_settings.py	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,45 @@
+"""
+mbed SDK
+Copyright (c) 2016 ARM Limited
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+from os.path import join, abspath, dirname
+
+#ROOT = abspath(join(dirname(__file__), "."))
+
+##############################################################################
+# Build System Settings
+##############################################################################
+#BUILD_DIR = abspath(join(ROOT, "build"))
+
+# ARM
+#ARM_PATH = "C:/Program Files/ARM"
+
+# GCC ARM
+#GCC_ARM_PATH = ""
+
+# GCC CodeRed
+#GCC_CR_PATH = "C:/code_red/RedSuite_4.2.0_349/redsuite/Tools/bin"
+
+# IAR
+#IAR_PATH = "C:/Program Files (x86)/IAR Systems/Embedded Workbench 7.0/arm"
+
+# Goanna static analyser. Please overload it in private_settings.py
+#GOANNA_PATH = "c:/Program Files (x86)/RedLizards/Goanna Central 3.2.3/bin"
+
+#BUILD_OPTIONS = []
+
+# mbed.org username
+#MBED_ORG_USER = ""
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbedtls_mbed_client_config.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,111 @@
+/**
+ *  Minimal configuration for using mbedtls as part of mbed-client
+ *
+ *  NOTE! This is an optimized, minimal configuration for mbed Client.
+ *  We know it works with mbed Client but if you want to add more
+ *  services/communications to the application yourself - please ensure
+ *  you update this configuration accordingly. The default configuration
+ *  can be found from mbedTLS Github:
+ *
+ *  https://github.com/ARMmbed/mbedtls/blob/development/include/mbedtls/config.h
+ *
+ *
+ *  Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
+ *  SPDX-License-Identifier: Apache-2.0
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may
+ *  not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  This file is part of mbed TLS (https://tls.mbed.org)
+ */
+
+
+#ifndef MBEDTLS_CUSTOM_CONFIG_H
+#define MBEDTLS_CUSTOM_CONFIG_H
+
+/* System support */
+#define MBEDTLS_HAVE_ASM
+
+/* mbed TLS feature support */
+#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
+#define MBEDTLS_ECP_NIST_OPTIM
+#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
+#define MBEDTLS_SSL_PROTO_TLS1_2
+#define MBEDTLS_SSL_PROTO_DTLS
+#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
+#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
+#define MBEDTLS_SSL_EXPORT_KEYS
+
+/* mbed TLS modules */
+#define MBEDTLS_AES_C
+#define MBEDTLS_ASN1_PARSE_C
+#define MBEDTLS_ASN1_WRITE_C
+#define MBEDTLS_BIGNUM_C
+#define MBEDTLS_CIPHER_C
+#define MBEDTLS_CTR_DRBG_C
+#define MBEDTLS_ECP_C
+#define MBEDTLS_ENTROPY_C
+#define MBEDTLS_MD_C
+#define MBEDTLS_OID_C
+#define MBEDTLS_PK_C
+#define MBEDTLS_PK_PARSE_C
+#define MBEDTLS_SHA256_C
+#define MBEDTLS_SSL_COOKIE_C
+#define MBEDTLS_SSL_CLI_C
+#define MBEDTLS_SSL_SRV_C
+#define MBEDTLS_SSL_TLS_C
+
+// XXX mbedclient needs these: mbedtls_x509_crt_free, mbedtls_x509_crt_init, mbedtls_x509_crt_parse
+#define MBEDTLS_X509_USE_C
+#define MBEDTLS_X509_CRT_PARSE_C
+
+// XXX: clean these up!!
+#define MBEDTLS_SHA512_C
+#define MBEDTLS_ECDH_C
+#define MBEDTLS_GCM_C
+
+#define MBEDTLS_ECDH_C
+#define MBEDTLS_ECDSA_C
+#define MBEDTLS_X509_CRT_PARSE_C
+
+// Remove RSA, save 20KB at total
+#undef MBEDTLS_RSA_C
+#undef MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
+
+// Remove error messages, save 10KB of ROM
+#undef MBEDTLS_ERROR_C
+
+// Remove selftesting and save 11KB of ROM
+#undef MBEDTLS_SELF_TEST
+
+// Reduces ROM size by 30 kB
+#undef MBEDTLS_ERROR_STRERROR_DUMMY
+#undef MBEDTLS_VERSION_FEATURES
+#undef MBEDTLS_DEBUG_C
+
+// needed for parsing the certificates
+#define MBEDTLS_PEM_PARSE_C
+// dep of the previous
+#define MBEDTLS_BASE64_C
+
+// Reduce IO buffer to save RAM, default is 16KB
+#define MBEDTLS_SSL_MAX_CONTENT_LEN 2048
+
+// define to save 8KB RAM at the expense of ROM
+#undef MBEDTLS_AES_ROM_TABLES
+
+// Save ROM and a few bytes of RAM by specifying our own ciphersuite list
+#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
+
+#include "mbedtls/check_config.h"
+
+#endif /* MBEDTLS_CUSTOM_CONFIG_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pal.lib	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/pal/#4e46c0ea870631bb5bec3e4aa9fd7eebf3db21f0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/security.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2015 ARM Limited. All rights reserved.
+ * SPDX-License-Identifier: Apache-2.0
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __SECURITY_H__
+#define __SECURITY_H__
+ 
+#include <inttypes.h>
+ 
+#define MBED_DOMAIN "DOMAIN"
+#define MBED_ENDPOINT_NAME "ENDPOINT_NAME"
+ 
+const uint8_t SERVER_CERT[] = "-----BEGIN CERTIFICATE-----\r\n"
+"-----END CERTIFICATE-----\r\n";
+ 
+const uint8_t CERT[] = "-----BEGIN CERTIFICATE-----\r\n"
+"-----END CERTIFICATE-----\r\n";
+ 
+const uint8_t KEY[] = "-----BEGIN PRIVATE KEY-----\r\n"
+"-----END PRIVATE KEY-----\r\n";
+ 
+#endif //__SECURITY_H__
+ 
+#error "You need to get security.h credentials from connector.mbed.com and replace the content of this security.h file"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/simpleclient.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,362 @@
+/*
+ * Copyright (c) 2015 ARM Limited. All rights reserved.
+ * SPDX-License-Identifier: Apache-2.0
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SIMPLECLIENT_H__
+#define __SIMPLECLIENT_H__
+
+#include "mbed-client/m2minterfacefactory.h"
+#include "mbed-client/m2mdevice.h"
+#include "mbed-client/m2minterfaceobserver.h"
+#include "mbed-client/m2minterface.h"
+#include "mbed-client/m2mobject.h"
+#include "mbed-client/m2mobjectinstance.h"
+#include "mbed-client/m2mresource.h"
+#include "mbed-client/m2mconfig.h"
+#include "mbed-client/m2mblockmessage.h"
+#include "security.h"
+#include "mbed.h"
+
+#define ETHERNET        1
+#define WIFI            2
+#define MESH_LOWPAN_ND  3
+#define MESH_THREAD     4
+#define ATMEL           5
+#define MCR20           6
+
+#define STRINGIFY(s) #s
+
+// Check if using mesh networking, define helper
+#if MBED_CONF_APP_NETWORK_INTERFACE == MESH_LOWPAN_ND
+    #define MESH
+#elif MBED_CONF_APP_NETWORK_INTERFACE == MESH_THREAD
+    #define MESH
+#endif
+
+#if defined (MESH) || (MBED_CONF_LWIP_IPV6_ENABLED==true)
+    // Mesh is always IPV6 - also WiFi and ETH can be IPV6 if IPV6 is enabled
+    M2MInterface::NetworkStack NETWORK_STACK = M2MInterface::LwIP_IPv6;
+#else
+    // Everything else - we assume it's IPv4
+    M2MInterface::NetworkStack NETWORK_STACK = M2MInterface::LwIP_IPv4;
+#endif
+
+//Select binding mode: UDP or TCP -- note - Mesh networking is IPv6 UDP ONLY
+#ifdef MESH
+    M2MInterface::BindingMode SOCKET_MODE = M2MInterface::UDP;
+#else
+    // WiFi or Ethernet supports both - TCP by default to avoid
+    // NAT problems, but UDP will also work - IF you configure
+    // your network right.
+    M2MInterface::BindingMode SOCKET_MODE = M2MInterface::TCP;
+#endif
+
+
+// MBED_DOMAIN and MBED_ENDPOINT_NAME come
+// from the security.h file copied from connector.mbed.com
+
+struct MbedClientDevice {
+    const char* Manufacturer;
+    const char* Type;
+    const char* ModelNumber;
+    const char* SerialNumber;
+};
+
+/*
+* Wrapper for mbed client stack that handles all callbacks, error handling, and
+* other shenanigans to make the mbed client stack easier to use.
+*
+* The end user should only have to care about configuring the parameters at the
+* top of this file and making sure they add the security.h file correctly.
+* To add resources you can copy the _TODO__ function and add as many instances as
+* you want.
+*
+*/
+class MbedClient: public M2MInterfaceObserver {
+public:
+
+    // constructor for MbedClient object, initialize private variables
+    MbedClient(struct MbedClientDevice device) {
+        _interface = NULL;
+        _bootstrapped = false;
+        _error = false;
+        _registered = false;
+        _unregistered = false;
+        _register_security = NULL;
+        _value = 0;
+        _object = NULL;
+        _device = device;
+    }
+
+    // de-constructor for MbedClient object, you can ignore this
+    ~MbedClient() {
+        if(_interface) {
+            delete _interface;
+        }
+        if(_register_security){
+            delete _register_security;
+        }
+    }
+
+    // debug printf function
+    void trace_printer(const char* str) {
+        printf("\r\n%s\r\n", str);
+    }
+
+    /*
+    *  Creates M2MInterface using which endpoint can
+    *  setup its name, resource type, life time, connection mode,
+    *  Currently only LwIPv4 is supported.
+    */
+    void create_interface(const char *server_address,
+                          void *handler=NULL) {
+    // Randomizing listening port for Certificate mode connectivity
+    _server_address = server_address;
+    uint16_t port = 0; // Network interface will randomize with port 0
+
+    // create mDS interface object, this is the base object everything else attaches to
+    _interface = M2MInterfaceFactory::create_interface(*this,
+                                                      MBED_ENDPOINT_NAME,       // endpoint name string
+                                                      "test",                   // endpoint type string
+                                                      100,                      // lifetime
+                                                      port,                     // listen port
+                                                      MBED_DOMAIN,              // domain string
+                                                      SOCKET_MODE,              // binding mode
+                                                      NETWORK_STACK,            // network stack
+                                                      "");                      // context address string
+    const char *binding_mode = (SOCKET_MODE == M2MInterface::UDP) ? "UDP" : "TCP";
+    printf("\r\nSOCKET_MODE : %s\r\n", binding_mode);
+    printf("Connecting to %s\r\n", server_address);
+
+    if(_interface) {
+        _interface->set_platform_network_handler(handler);
+    }
+
+    }
+
+    /*
+    *  check private variable to see if the registration was sucessful or not
+    */
+    bool register_successful() {
+        return _registered;
+    }
+
+    /*
+    *  check private variable to see if un-registration was sucessful or not
+    */
+    bool unregister_successful() {
+        return _unregistered;
+    }
+
+    /*
+    *  Creates register server object with mbed device server address and other parameters
+    *  required for client to connect to mbed device server.
+    */
+    M2MSecurity* create_register_object() {
+        // create security object using the interface factory.
+        // this will generate a security ObjectID and ObjectInstance
+        M2MSecurity *security = M2MInterfaceFactory::create_security(M2MSecurity::M2MServer);
+
+        // make sure security ObjectID/ObjectInstance was created successfully
+        if(security) {
+            // Add ResourceID's and values to the security ObjectID/ObjectInstance
+            security->set_resource_value(M2MSecurity::M2MServerUri, _server_address);
+            security->set_resource_value(M2MSecurity::SecurityMode, M2MSecurity::Certificate);
+            security->set_resource_value(M2MSecurity::ServerPublicKey, SERVER_CERT, sizeof(SERVER_CERT) - 1);
+            security->set_resource_value(M2MSecurity::PublicKey, CERT, sizeof(CERT) - 1);
+            security->set_resource_value(M2MSecurity::Secretkey, KEY, sizeof(KEY) - 1);
+        }
+        return security;
+    }
+
+    /*
+    * Creates device object which contains mandatory resources linked with
+    * device endpoint.
+    */
+    M2MDevice* create_device_object() {
+        // create device objectID/ObjectInstance
+        M2MDevice *device = M2MInterfaceFactory::create_device();
+        // make sure device object was created successfully
+        if(device) {
+            // add resourceID's to device objectID/ObjectInstance
+            device->create_resource(M2MDevice::Manufacturer, _device.Manufacturer);
+            device->create_resource(M2MDevice::DeviceType, _device.Type);
+            device->create_resource(M2MDevice::ModelNumber, _device.ModelNumber);
+            device->create_resource(M2MDevice::SerialNumber, _device.SerialNumber);
+        }
+        return device;
+    }
+
+    /*
+    * register an object
+    */
+    void test_register(M2MSecurity *register_object, M2MObjectList object_list){
+        if(_interface) {
+            // Register function
+            _interface->register_object(register_object, object_list);
+        }
+    }
+
+    /*
+    * unregister all objects
+    */
+    void test_unregister() {
+        if(_interface) {
+            // Unregister function
+            _interface->unregister_object(NULL); // NULL will unregister all objects
+        }
+    }
+
+    //Callback from mbed client stack when the bootstrap
+    // is successful, it returns the mbed Device Server object
+    // which will be used for registering the resources to
+    // mbed Device server.
+    void bootstrap_done(M2MSecurity *server_object){
+        if(server_object) {
+            _bootstrapped = true;
+            _error = false;
+            trace_printer("Bootstrapped");
+        }
+    }
+
+    //Callback from mbed client stack when the registration
+    // is successful, it returns the mbed Device Server object
+    // to which the resources are registered and registered objects.
+    void object_registered(M2MSecurity */*security_object*/, const M2MServer &/*server_object*/){
+        _registered = true;
+        _unregistered = false;
+        trace_printer("Registered object successfully!");
+    }
+
+    //Callback from mbed client stack when the unregistration
+    // is successful, it returns the mbed Device Server object
+    // to which the resources were unregistered.
+    void object_unregistered(M2MSecurity */*server_object*/){
+        trace_printer("Unregistered Object Successfully");
+        _unregistered = true;
+        _registered = false;
+    }
+
+    /*
+    * Callback from mbed client stack when registration is updated
+    */
+    void registration_updated(M2MSecurity */*security_object*/, const M2MServer & /*server_object*/){
+        /* The registration is updated automatically and frequently by the
+        *  mbed client stack. This print statement is turned off because it
+        *  tends to happen alot.
+        */
+        //trace_printer("\r\nRegistration Updated\r\n");
+    }
+
+    // Callback from mbed client stack if any error is encountered
+    // during any of the LWM2M operations. Error type is passed in
+    // the callback.
+    void error(M2MInterface::Error error){
+        _error = true;
+        switch(error){
+            case M2MInterface::AlreadyExists:
+                trace_printer("[ERROR:] M2MInterface::AlreadyExist");
+                break;
+            case M2MInterface::BootstrapFailed:
+                trace_printer("[ERROR:] M2MInterface::BootstrapFailed");
+                break;
+            case M2MInterface::InvalidParameters:
+                trace_printer("[ERROR:] M2MInterface::InvalidParameters");
+                break;
+            case M2MInterface::NotRegistered:
+                trace_printer("[ERROR:] M2MInterface::NotRegistered");
+                break;
+            case M2MInterface::Timeout:
+                trace_printer("[ERROR:] M2MInterface::Timeout");
+                break;
+            case M2MInterface::NetworkError:
+                trace_printer("[ERROR:] M2MInterface::NetworkError");
+                break;
+            case M2MInterface::ResponseParseFailed:
+                trace_printer("[ERROR:] M2MInterface::ResponseParseFailed");
+                break;
+            case M2MInterface::UnknownError:
+                trace_printer("[ERROR:] M2MInterface::UnknownError");
+                break;
+            case M2MInterface::MemoryFail:
+                trace_printer("[ERROR:] M2MInterface::MemoryFail");
+                break;
+            case M2MInterface::NotAllowed:
+                trace_printer("[ERROR:] M2MInterface::NotAllowed");
+                break;
+            case M2MInterface::SecureConnectionFailed:
+                trace_printer("[ERROR:] M2MInterface::SecureConnectionFailed");
+                break;
+            case M2MInterface::DnsResolvingFailed:
+                trace_printer("[ERROR:] M2MInterface::DnsResolvingFailed");
+                break;
+
+            default:
+                break;
+        }
+    }
+
+    /* Callback from mbed client stack if any value has changed
+    *  during PUT operation. Object and its type is passed in
+    *  the callback.
+    *  BaseType enum from m2mbase.h
+    *       Object = 0x0, Resource = 0x1, ObjectInstance = 0x2, ResourceInstance = 0x3
+    */
+    void value_updated(M2MBase *base, M2MBase::BaseType type) {
+        printf("\r\nPUT Request Received!");
+        printf("\r\nName :'%s', \r\nPath : '%s', \r\nType : '%d' (0 for Object, 1 for Resource), \r\nType : '%s'\r\n",
+               base->name(),
+               base->uri_path(),
+               type,
+               base->resource_type()
+               );
+    }
+
+    /*
+    * update the registration period
+    */
+    void test_update_register() {
+        if (_registered) {
+            _interface->update_registration(_register_security, 100);
+        }
+    }
+
+    /*
+    * manually configure the security object private variable
+    */
+   void set_register_object(M2MSecurity *register_object) {
+        if (_register_security == NULL) {
+            _register_security = register_object;
+        }
+    }
+
+private:
+
+    /*
+    *  Private variables used in class
+    */
+    M2MInterface    	     *_interface;
+    M2MSecurity              *_register_security;
+    M2MObject                *_object;
+    volatile bool            _bootstrapped;
+    volatile bool            _error;
+    volatile bool            _registered;
+    volatile bool            _unregistered;
+    int                      _value;
+    struct MbedClientDevice  _device;
+    String                   _server_address;
+};
+
+#endif // __SIMPLECLIENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/ImageReaderSource.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,77 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+#ifndef __IMAGE_READER_SOURCE_H_
+#define __IMAGE_READER_SOURCE_H_
+/*
+ *  Copyright 2010-2011 ZXing authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "mbed.h"
+#include <iostream>
+#include <fstream>
+#include <string>
+#include <zxing/LuminanceSource.h>
+#include <zxing/common/Counted.h>
+#include <zxing/Binarizer.h>
+#include <zxing/MultiFormatReader.h>
+#include <zxing/Result.h>
+#include <zxing/ReaderException.h>
+#include <zxing/common/GlobalHistogramBinarizer.h>
+#include <zxing/common/HybridBinarizer.h>
+#include <exception>
+#include <zxing/Exception.h>
+#include <zxing/common/IllegalArgumentException.h>
+#include <zxing/BinaryBitmap.h>
+#include <zxing/DecodeHints.h>
+
+#include <zxing/qrcode/QRCodeReader.h>
+#include <zxing/multi/qrcode/QRCodeMultiReader.h>
+#include <zxing/multi/ByQuadrantReader.h>
+#include <zxing/multi/MultipleBarcodeReader.h>
+#include <zxing/multi/GenericMultipleBarcodeReader.h>
+
+using std::string;
+using std::ostringstream;
+using zxing::Ref;
+using zxing::ArrayRef;
+using zxing::LuminanceSource;
+
+using namespace std;
+using namespace zxing;
+using namespace zxing::multi;
+using namespace zxing::qrcode;
+
+
+class ImageReaderSource : public zxing::LuminanceSource {
+private:
+  typedef LuminanceSource Super;
+
+  const zxing::ArrayRef<char> image;
+  const int comps;
+
+  char convertPixel(const char* pixel) const;
+
+public:
+  static zxing::Ref<LuminanceSource> create(char* buf, int buf_size, int width, int height);
+
+  ImageReaderSource(zxing::ArrayRef<char> image, int width, int height, int comps);
+
+  zxing::ArrayRef<char> getRow(int y, zxing::ArrayRef<char> row) const;
+  zxing::ArrayRef<char> getMatrix() const;
+};
+
+extern int ex_decode(uint8_t* buf, int buf_size, int width, int height, vector<Ref<Result> > * results, DecodeHints &hints);
+
+
+#endif /* __IMAGE_READER_SOURCE_H_ */
Binary file zxing_lib/TOOLCHAIN_ARM_STD/zxing_lib.ar has changed
Binary file zxing_lib/TOOLCHAIN_GCC_ARM/libzxing.a has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/BarcodeFormat.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,60 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+#ifndef __BARCODE_FORMAT_H__
+#define __BARCODE_FORMAT_H__
+
+/*
+ *  BarcodeFormat.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace zxing {
+
+class BarcodeFormat {
+public:
+  // if you update the enum, update BarcodeFormat.cpp
+
+  enum Value {
+    NONE,
+    AZTEC,
+    CODABAR,
+    CODE_39,
+    CODE_93,
+    CODE_128,
+    DATA_MATRIX,
+    EAN_8,
+    EAN_13,
+    ITF,
+    MAXICODE,
+    PDF_417,
+    QR_CODE,
+    RSS_14,
+    RSS_EXPANDED,
+    UPC_A,
+    UPC_E,
+    UPC_EAN_EXTENSION
+  };
+
+  BarcodeFormat(Value v) : value(v) {}  
+  const Value value;
+  operator Value () const {return value;}
+
+  static char const* barcodeFormatNames[];
+};
+
+}
+
+#endif // __BARCODE_FORMAT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/Binarizer.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,50 @@
+#ifndef BINARIZER_H_
+#define BINARIZER_H_
+
+/*
+ *  Binarizer.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/LuminanceSource.h>
+#include <zxing/common/BitArray.h>
+#include <zxing/common/BitMatrix.h>
+#include <zxing/common/Counted.h>
+
+namespace zxing {
+
+class Binarizer : public Counted {
+ private:
+  Ref<LuminanceSource> source_;
+
+ public:
+  Binarizer(Ref<LuminanceSource> source);
+  virtual ~Binarizer();
+
+  virtual Ref<BitArray> getBlackRow(int y, Ref<BitArray> row) = 0;
+  virtual Ref<BitMatrix> getBlackMatrix() = 0;
+
+  Ref<LuminanceSource> getLuminanceSource() const ;
+  virtual Ref<Binarizer> createBinarizer(Ref<LuminanceSource> source) = 0;
+
+  int getWidth() const;
+  int getHeight() const;
+
+};
+
+}
+#endif /* BINARIZER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/BinaryBitmap.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,56 @@
+#ifndef __BINARYBITMAP_H__
+#define __BINARYBITMAP_H__
+
+/*
+ *  BinaryBitmap.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/common/Counted.h>
+#include <zxing/common/BitMatrix.h>
+#include <zxing/common/BitArray.h>
+#include <zxing/Binarizer.h>
+
+namespace zxing {
+	
+	class BinaryBitmap : public Counted {
+	private:
+		Ref<Binarizer> binarizer_;
+		
+	public:
+		BinaryBitmap(Ref<Binarizer> binarizer);
+		virtual ~BinaryBitmap();
+		
+		Ref<BitArray> getBlackRow(int y, Ref<BitArray> row);
+		Ref<BitMatrix> getBlackMatrix();
+		
+		Ref<LuminanceSource> getLuminanceSource() const;
+
+		int getWidth() const;
+		int getHeight() const;
+
+		bool isRotateSupported() const;
+		Ref<BinaryBitmap> rotateCounterClockwise();
+
+		bool isCropSupported() const;
+		Ref<BinaryBitmap> crop(int left, int top, int width, int height);
+
+	};
+	
+}
+
+#endif /* BINARYBITMAP_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/DecodeHints.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,89 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+#ifndef __DECODEHINTS_H_
+#define __DECODEHINTS_H_
+/*
+ *  DecodeHintType.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/BarcodeFormat.h>
+#include <zxing/ResultPointCallback.h>
+
+namespace zxing {
+
+typedef unsigned int DecodeHintType;
+class DecodeHints;
+DecodeHints operator | (DecodeHints const&, DecodeHints const&);
+
+class DecodeHints {
+ private:
+  DecodeHintType hints;
+  Ref<ResultPointCallback> callback;
+
+ public:
+  static const DecodeHintType AZTEC_HINT = 1 << BarcodeFormat::AZTEC;
+  static const DecodeHintType CODABAR_HINT = 1 << BarcodeFormat::CODABAR;
+  static const DecodeHintType CODE_39_HINT = 1 << BarcodeFormat::CODE_39;
+  static const DecodeHintType CODE_93_HINT = 1 << BarcodeFormat::CODE_93;
+  static const DecodeHintType CODE_128_HINT = 1 << BarcodeFormat::CODE_128;
+  static const DecodeHintType DATA_MATRIX_HINT = 1 << BarcodeFormat::DATA_MATRIX;
+  static const DecodeHintType EAN_8_HINT = 1 << BarcodeFormat::EAN_8;
+  static const DecodeHintType EAN_13_HINT = 1 << BarcodeFormat::EAN_13;
+  static const DecodeHintType ITF_HINT = 1 << BarcodeFormat::ITF;
+  static const DecodeHintType MAXICODE_HINT = 1 << BarcodeFormat::MAXICODE;
+  static const DecodeHintType PDF_417_HINT = 1 << BarcodeFormat::PDF_417;
+  static const DecodeHintType QR_CODE_HINT = 1 << BarcodeFormat::QR_CODE;
+  static const DecodeHintType RSS_14_HINT = 1 << BarcodeFormat::RSS_14;
+  static const DecodeHintType RSS_EXPANDED_HINT = 1 << BarcodeFormat::RSS_EXPANDED;
+  static const DecodeHintType UPC_A_HINT = 1 << BarcodeFormat::UPC_A;
+  static const DecodeHintType UPC_E_HINT = 1 << BarcodeFormat::UPC_E;
+  static const DecodeHintType UPC_EAN_EXTENSION_HINT = 1 << BarcodeFormat::UPC_EAN_EXTENSION;
+
+#if defined(__ICCARM__)             //
+  static const DecodeHintType TRYHARDER_HINT = 0x80000000;
+#else
+  static const DecodeHintType TRYHARDER_HINT = 1 << 31;
+#endif                              //
+  static const DecodeHintType CHARACTER_SET = 1 << 30;
+  // static const DecodeHintType ALLOWED_LENGTHS = 1 << 29;
+  // static const DecodeHintType ASSUME_CODE_39_CHECK_DIGIT = 1 << 28;
+  static const DecodeHintType  ASSUME_GS1 = 1 << 27;
+  // static const DecodeHintType NEED_RESULT_POINT_CALLBACK = 1 << 26;
+  
+  static const DecodeHints PRODUCT_HINT;
+  static const DecodeHints ONED_HINT;
+  static const DecodeHints DEFAULT_HINT;
+
+  DecodeHints();
+  DecodeHints(DecodeHintType init);
+
+  void addFormat(BarcodeFormat toadd);
+  bool containsFormat(BarcodeFormat tocheck) const;
+  bool isEmpty() const {return (hints==0);}
+  void clear() {hints=0;}
+  void setTryHarder(bool toset);
+  bool getTryHarder() const;
+
+  void setResultPointCallback(Ref<ResultPointCallback> const&);
+  Ref<ResultPointCallback> getResultPointCallback() const;
+
+  friend DecodeHints operator | (DecodeHints const&, DecodeHints const&);
+};
+
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/Exception.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,51 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+#ifndef __EXCEPTION_H__
+#define __EXCEPTION_H__
+
+/*
+ *  Exception.h
+ *  ZXing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <string>
+#include <exception>
+
+namespace zxing {
+
+class Exception : public std::exception {
+private:
+  char const* const message;
+
+public:
+  Exception() throw() : message(0) {}
+  Exception(const char* msg) throw() : message(copy(msg)) {}
+  Exception(Exception const& that) throw() : std::exception(that), message(copy(that.message)) {}
+  ~Exception() throw() {
+    if(message) {
+      deleteMessage();
+    }
+  }
+  char const* what() const throw() {return message ? message : "";}
+
+private:
+  static char const* copy(char const*);
+  void deleteMessage();
+};
+
+}
+
+#endif // __EXCEPTION_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/LuminanceSource.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,59 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+#ifndef __LUMINANCESOURCE_H__
+#define __LUMINANCESOURCE_H__
+/*
+ *  LuminanceSource.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/common/Counted.h>
+#include <zxing/common/Array.h>
+#include <string.h>
+
+namespace zxing {
+
+class LuminanceSource : public Counted {
+ private:
+  const int width;
+  const int height;
+
+ public:
+  LuminanceSource(int width, int height);
+  virtual ~LuminanceSource();
+
+  int getWidth() const { return width; }
+  int getHeight() const { return height; }
+
+  // Callers take ownership of the returned memory and must call delete [] on it themselves.
+  virtual ArrayRef<char> getRow(int y, ArrayRef<char> row) const = 0;
+  virtual ArrayRef<char> getMatrix() const = 0;
+
+  virtual bool isCropSupported() const;
+  virtual Ref<LuminanceSource> crop(int left, int top, int width, int height) const;
+
+  virtual bool isRotateSupported() const;
+
+  virtual Ref<LuminanceSource> invert() const;
+  
+  virtual Ref<LuminanceSource> rotateCounterClockwise() const;
+
+  operator std::string () const;
+};
+
+}
+
+#endif /* LUMINANCESOURCE_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/MultiFormatReader.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,48 @@
+#ifndef __MULTI_FORMAT_READER_H__
+#define __MULTI_FORMAT_READER_H__
+
+/*
+ *  MultiFormatBarcodeReader.h
+ *  ZXing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ 
+#include <zxing/Reader.h>
+#include <zxing/common/BitArray.h>
+#include <zxing/Result.h>
+#include <zxing/DecodeHints.h>
+
+namespace zxing {
+  class MultiFormatReader : public Reader {
+  private:
+    Ref<Result> decodeInternal(Ref<BinaryBitmap> image);
+  
+    std::vector<Ref<Reader> > readers_;
+    DecodeHints hints_;
+
+  public:
+    MultiFormatReader();
+    
+    Ref<Result> decode(Ref<BinaryBitmap> image);
+    Ref<Result> decode(Ref<BinaryBitmap> image, DecodeHints hints);
+    Ref<Result> decodeWithState(Ref<BinaryBitmap> image);
+    void setHints(DecodeHints hints);
+    ~MultiFormatReader();
+  };
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/Reader.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,40 @@
+#ifndef __READER_H__
+#define __READER_H__
+
+/*
+ *  Reader.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/BinaryBitmap.h>
+#include <zxing/Result.h>
+#include <zxing/DecodeHints.h>
+
+namespace zxing {
+
+ class Reader : public Counted {
+  protected:
+   Reader() {}
+  public:
+   virtual Ref<Result> decode(Ref<BinaryBitmap> image);
+   virtual Ref<Result> decode(Ref<BinaryBitmap> image, DecodeHints hints) = 0;
+   virtual ~Reader();
+};
+
+}
+
+#endif // __READER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/ReaderException.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,37 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+#ifndef __READER_EXCEPTION_H__
+#define __READER_EXCEPTION_H__
+
+/*
+ *  ReaderException.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/Exception.h>
+
+namespace zxing {
+
+class ReaderException : public Exception {
+ public:
+  ReaderException() throw() {}
+  ReaderException(char const* msg) throw() : Exception(msg) {}
+  ~ReaderException() throw() {}
+};
+
+}
+
+#endif // __READER_EXCEPTION_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/Result.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,55 @@
+#ifndef __RESULT_H__
+#define __RESULT_H__
+
+/*
+ *  Result.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <string>
+#include <zxing/common/Array.h>
+#include <zxing/common/Counted.h>
+#include <zxing/common/Str.h>
+#include <zxing/ResultPoint.h>
+#include <zxing/BarcodeFormat.h>
+
+namespace zxing {
+
+class Result : public Counted {
+private:
+  Ref<String> text_;
+  ArrayRef<char> rawBytes_;
+  ArrayRef< Ref<ResultPoint> > resultPoints_;
+  BarcodeFormat format_;
+
+public:
+  Result(Ref<String> text,
+         ArrayRef<char> rawBytes,
+         ArrayRef< Ref<ResultPoint> > resultPoints,
+         BarcodeFormat format);
+  ~Result();
+  Ref<String> getText();
+  ArrayRef<char> getRawBytes();
+  ArrayRef< Ref<ResultPoint> > const& getResultPoints() const;
+  ArrayRef< Ref<ResultPoint> >& getResultPoints();
+  BarcodeFormat getBarcodeFormat() const;
+
+  friend std::ostream& operator<<(std::ostream &out, Result& result);
+};
+
+}
+#endif // __RESULT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/ResultPoint.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,55 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+#ifndef __RESULT_POINT_H__
+#define __RESULT_POINT_H__
+
+/*
+ *  ResultPoint.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/common/Counted.h>
+#include <vector>
+
+namespace zxing {
+
+class ResultPoint : public Counted {
+protected:
+  const float posX_;
+  const float posY_;
+  
+public:
+  ResultPoint();
+  ResultPoint(float x, float y);
+  ResultPoint(int x, int y);
+  virtual ~ResultPoint();
+
+  virtual float getX() const;
+  virtual float getY() const;
+
+  bool equals(Ref<ResultPoint> other);
+
+  static void orderBestPatterns(std::vector<Ref<ResultPoint> > &patterns);
+  static float distance(Ref<ResultPoint> point1, Ref<ResultPoint> point2);
+  static float distance(float x1, float x2, float y1, float y2);
+
+private:
+  static float crossProductZ(Ref<ResultPoint> pointA, Ref<ResultPoint> pointB, Ref<ResultPoint> pointC);
+};
+
+}
+
+#endif // __RESULT_POINT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/ResultPointCallback.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,39 @@
+#ifndef __RESULT_POINT_CALLBACK_H__
+#define __RESULT_POINT_CALLBACK_H__
+
+/*
+ *  ResultPointCallback.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/common/Counted.h>
+
+namespace zxing {
+
+class ResultPoint;
+
+class ResultPointCallback : public Counted {
+protected:
+  ResultPointCallback() {}
+public:
+  virtual void foundPossibleResultPoint(ResultPoint const& point) = 0;
+  virtual ~ResultPointCallback();
+};
+
+}
+
+#endif // __RESULT_POINT_CALLBACK_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/ZXing.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,135 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+/*
+ *  Copyright 2013 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __ZXING_H_
+#define __ZXING_H_
+
+#define ZXING_ARRAY_LEN(v) ((int)(sizeof(v)/sizeof(v[0])))
+#define ZX_LOG_DIGITS(digits) \
+    ((digits == 8) ? 3 : \
+     ((digits == 16) ? 4 : \
+      ((digits == 32) ? 5 : \
+       ((digits == 64) ? 6 : \
+        ((digits == 128) ? 7 : \
+         (-1))))))
+
+#ifndef ZXING_DEBUG
+#define ZXING_DEBUG 0
+#endif
+
+namespace zxing {
+typedef char byte;
+typedef bool boolean;
+}
+
+#include <limits>
+
+#if defined(_WIN32) || defined(_WIN64)
+
+#include <float.h>
+
+namespace zxing {
+inline bool isnan(float v) {return _isnan(v) != 0;}
+inline bool isnan(double v) {return _isnan(v) != 0;}
+inline float nan() {return std::numeric_limits<float>::quiet_NaN();}
+}
+
+#else
+
+#include <cmath>
+
+namespace zxing {
+#if defined(__ICCARM__) || defined( __CC_ARM )  //
+#else                                           //
+inline bool isnan(float v) {return std::isnan(v);}
+inline bool isnan(double v) {return std::isnan(v);}
+#endif                                          //
+inline float nan() {return std::numeric_limits<float>::quiet_NaN();}
+}
+#endif
+
+#if ZXING_DEBUG
+
+#include <iostream>
+#include <string>
+
+using std::cout;
+using std::cerr;
+using std::endl;
+using std::flush;
+using std::string;
+using std::ostream;
+
+#if ZXING_DEBUG_TIMER
+
+#include <sys/time.h>
+
+namespace zxing {
+
+class DebugTimer {
+public:
+  DebugTimer(char const* string_) : chars(string_) {
+    gettimeofday(&start, 0);
+  }
+
+  DebugTimer(std::string const& string_) : chars(0), string(string_) {
+    gettimeofday(&start, 0);
+  }
+
+  void mark(char const* string) {
+    struct timeval end;
+    gettimeofday(&end, 0);
+    int diff =
+      (end.tv_sec - start.tv_sec)*1000*1000+(end.tv_usec - start.tv_usec);
+    
+    cerr << diff << " " << string << '\n';
+  }
+
+  void mark(std::string string) {
+    mark(string.c_str());
+  }
+
+  ~DebugTimer() {
+    if (chars) {
+      mark(chars);
+    } else {
+      mark(string.c_str());
+    }
+  }
+
+private:
+  char const* const chars;
+  std::string string;
+  struct timeval start;
+};
+
+}
+
+#define ZXING_TIME(string) DebugTimer __timer__ (string)
+#define ZXING_TIME_MARK(string) __timer__.mark(string)
+
+#endif
+
+#endif // ZXING_DEBUG
+
+#ifndef ZXING_TIME
+#define ZXING_TIME(string) (void)0
+#endif
+#ifndef ZXING_TIME_MARK
+#define ZXING_TIME_MARK(string) (void)0
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/common/Array.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,170 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+#ifndef __ARRAY_H__
+#define __ARRAY_H__
+
+/*
+ *  Array.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <vector>
+
+#include <zxing/common/Counted.h>
+
+namespace zxing {
+
+template<typename T> class Array : public Counted {
+protected:
+public:
+  std::vector<T> values_;
+  Array() {}
+  Array(int n) :
+      Counted(), values_(n, T()) {
+  }
+  Array(T const* ts, int n) :
+      Counted(), values_(ts, ts+n) {
+  }
+  Array(T const* ts, T const* te) :
+      Counted(), values_(ts, te) {
+  }
+  Array(T v, int n) :
+      Counted(), values_(n, v) {
+  }
+  Array(std::vector<T> &v) :
+      Counted(), values_(v) {
+  }
+  Array(Array<T> &other) :
+      Counted(), values_(other.values_) {
+  }
+  Array(Array<T> *other) :
+      Counted(), values_(other->values_) {
+  }
+  virtual ~Array() {
+  }
+  Array<T>& operator=(const Array<T> &other) {
+    values_ = other.values_;
+    return *this;
+  }
+  Array<T>& operator=(const std::vector<T> &array) {
+    values_ = array;
+    return *this;
+  }
+  T const& operator[](int i) const {
+    return values_[i];
+  }
+  T& operator[](int i) {
+    return values_[i];
+  }
+  int size() const {
+    return values_.size();
+  }
+  bool empty() const {
+    return values_.size() == 0;
+  }
+  std::vector<T> const& values() const {
+    return values_;
+  }
+  std::vector<T>& values() {
+    return values_;
+  }
+};
+
+template<typename T> class ArrayRef : public Counted {
+private:
+public:
+  Array<T> *array_;
+  ArrayRef() :
+      array_(0) {
+  }
+  explicit ArrayRef(int n) :
+      array_(0) {
+    reset(new Array<T> (n));
+  }
+  ArrayRef(T *ts, int n) :
+      array_(0) {
+    reset(new Array<T> (ts, n));
+  }
+  ArrayRef(Array<T> *a) :
+      array_(0) {
+    reset(a);
+  }
+  ArrayRef(const ArrayRef &other) :
+      Counted(), array_(0) {
+    reset(other.array_);
+  }
+
+  template<class Y>
+  ArrayRef(const ArrayRef<Y> &other) :
+      array_(0) {
+    reset(static_cast<const Array<T> *>(other.array_));
+  }
+
+  ~ArrayRef() {
+    if (array_) {
+      array_->release();
+    }
+    array_ = 0;
+  }
+
+  T const& operator[](int i) const {
+    return (*array_)[i];
+  }
+
+  T& operator[](int i) {
+    return (*array_)[i];
+  }
+
+  void reset(Array<T> *a) {
+    if (a) {
+      a->retain();
+    }
+    if (array_) {
+      array_->release();
+    }
+    array_ = a;
+  }
+  void reset(const ArrayRef<T> &other) {
+    reset(other.array_);
+  }
+  ArrayRef<T>& operator=(const ArrayRef<T> &other) {
+    reset(other);
+    return *this;
+  }
+  ArrayRef<T>& operator=(Array<T> *a) {
+    reset(a);
+    return *this;
+  }
+
+  Array<T>& operator*() const {
+    return *array_;
+  }
+
+  Array<T>* operator->() const {
+    return array_;
+  }
+
+  operator bool () const {
+    return array_ != 0;
+  }
+  bool operator ! () const {
+    return array_ == 0;
+  }
+};
+
+} // namespace zxing
+
+#endif // __ARRAY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/common/BitArray.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,81 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+#ifndef __BIT_ARRAY_H__
+#define __BIT_ARRAY_H__
+
+/*
+ *  Copyright 2010 ZXing authors. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/ZXing.h>
+#include <zxing/common/Counted.h>
+#include <zxing/common/IllegalArgumentException.h>
+#include <zxing/common/Array.h>
+#include <vector>
+#include <limits>
+#include <iostream>
+
+namespace zxing {
+
+class BitArray : public Counted {
+public:
+  static const int bitsPerWord = std::numeric_limits<unsigned int>::digits;
+
+private:
+  int size;
+  ArrayRef<int> bits;
+  static const int logBits = ZX_LOG_DIGITS(bitsPerWord);
+  static const int bitsMask = (1 << logBits) - 1;
+
+public:
+  BitArray(int size);
+  ~BitArray();
+  int getSize() const;
+
+  bool get(int i) const {
+    return (bits[i >> logBits] & (1 << (i & bitsMask))) != 0;
+  }
+
+  void set(int i) {
+    bits[i >> logBits] |= 1 << (i & bitsMask);
+  }
+
+  int getNextSet(int from);
+  int getNextUnset(int from);
+
+  void setBulk(int i, int newBits);
+  void setRange(int start, int end);
+  void clear();
+  bool isRange(int start, int end, bool value);
+  std::vector<int>& getBitArray();
+  
+  void reverse();
+
+  class Reverse {
+   private:
+    Ref<BitArray> array;
+   public:
+    Reverse(Ref<BitArray> array);
+    ~Reverse();
+  };
+
+private:
+  static int makeArraySize(int size);
+};
+
+std::ostream& operator << (std::ostream&, BitArray const&);
+
+}
+
+#endif // __BIT_ARRAY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/common/BitMatrix.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,94 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+#ifndef __BIT_MATRIX_H__
+#define __BIT_MATRIX_H__
+
+/*
+ *  BitMatrix.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/common/Counted.h>
+#include <zxing/common/BitArray.h>
+#include <zxing/common/Array.h>
+#include <limits>
+#if defined(__ICCARM__)             //
+#include <stddef.h> /*for size_t*/  //
+#endif                              //
+
+namespace zxing {
+
+class BitMatrix : public Counted {
+public:
+  static const int bitsPerWord = std::numeric_limits<unsigned int>::digits;
+
+private:
+  int width;
+  int height;
+  int rowSize;
+  ArrayRef<int> bits;
+
+#define ZX_LOG_DIGITS(digits) \
+    ((digits == 8) ? 3 : \
+     ((digits == 16) ? 4 : \
+      ((digits == 32) ? 5 : \
+       ((digits == 64) ? 6 : \
+        ((digits == 128) ? 7 : \
+         (-1))))))
+
+  static const int logBits = ZX_LOG_DIGITS(bitsPerWord);
+  static const int bitsMask = (1 << logBits) - 1;
+
+public:
+  BitMatrix(int dimension);
+  BitMatrix(int width, int height);
+
+  ~BitMatrix();
+
+  bool get(int x, int y) const {
+    int offset = y * rowSize + (x >> logBits);
+    return ((((unsigned)bits[offset]) >> (x & bitsMask)) & 1) != 0;
+  }
+
+  void set(int x, int y) {
+    int offset = y * rowSize + (x >> logBits);
+    bits[offset] |= 1 << (x & bitsMask);
+  }
+
+  void flip(int x, int y);
+  void clear();
+  void setRegion(int left, int top, int width, int height);
+  Ref<BitArray> getRow(int y, Ref<BitArray> row);
+
+  int getWidth() const;
+  int getHeight() const;
+
+  ArrayRef<int> getTopLeftOnBit() const;
+  ArrayRef<int> getBottomRightOnBit() const;
+
+  friend std::ostream& operator<<(std::ostream &out, const BitMatrix &bm);
+  const char *description();
+
+private:
+  inline void init(int, int);
+
+  BitMatrix(const BitMatrix&);
+  BitMatrix& operator =(const BitMatrix&);
+};
+
+}
+
+#endif // __BIT_MATRIX_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/common/Counted.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,140 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+#ifndef __COUNTED_H__
+#define __COUNTED_H__
+
+/*
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <iostream>
+
+namespace zxing {
+
+/* base class for reference-counted objects */
+class Counted {
+private:
+  unsigned int count_;
+public:
+  Counted() :
+      count_(0) {
+  }
+  virtual ~Counted() {
+  }
+  Counted *retain() {
+    count_++;
+    return this;
+  }
+  void release() {
+    count_--;
+    if (count_ == 0) {
+      count_ = 0xDEADF001;
+      delete this;
+    }
+  }
+
+
+  /* return the current count for denugging purposes or similar */
+  int count() const {
+    return count_;
+  }
+};
+
+/* counting reference to reference-counted objects */
+template<typename T> class Ref {
+private:
+public:
+  T *object_;
+  explicit Ref(T *o = 0) :
+      object_(0) {
+    reset(o);
+  }
+  Ref(const Ref &other) :
+      object_(0) {
+    reset(other.object_);
+  }
+
+  template<class Y>
+  Ref(const Ref<Y> &other) :
+      object_(0) {
+    reset(other.object_);
+  }
+
+  ~Ref() {
+    if (object_) {
+      object_->release();
+    }
+  }
+
+  void reset(T *o) {
+    if (o) {
+      o->retain();
+    }
+    if (object_ != 0) {
+      object_->release();
+    }
+    object_ = o;
+  }
+  Ref& operator=(const Ref &other) {
+    reset(other.object_);
+    return *this;
+  }
+  template<class Y>
+  Ref& operator=(const Ref<Y> &other) {
+    reset(other.object_);
+    return *this;
+  }
+  Ref& operator=(T* o) {
+    reset(o);
+    return *this;
+  }
+  template<class Y>
+  Ref& operator=(Y* o) {
+    reset(o);
+    return *this;
+  }
+
+  T& operator*() {
+    return *object_;
+  }
+  T* operator->() const {
+    return object_;
+  }
+  operator T*() const {
+    return object_;
+  }
+
+  bool operator==(const T* that) {
+    return object_ == that;
+  }
+  bool operator==(const Ref &other) const {
+    return object_ == other.object_ || *object_ == *(other.object_);
+  }
+  template<class Y>
+  bool operator==(const Ref<Y> &other) const {
+    return object_ == other.object_ || *object_ == *(other.object_);
+  }
+
+  bool operator!=(const T* that) {
+    return !(*this == that);
+  }
+
+  bool empty() const {
+    return object_ == 0;
+  }
+};
+
+}
+
+#endif // __COUNTED_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/common/DecoderResult.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,51 @@
+#ifndef __DECODER_RESULT_H__
+#define __DECODER_RESULT_H__
+
+/*
+ *  DecoderResult.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/common/Counted.h>
+#include <zxing/common/Array.h>
+#include <string>
+#include <zxing/common/Str.h>
+
+namespace zxing {
+
+class DecoderResult : public Counted {
+private:
+  ArrayRef<char> rawBytes_;
+  Ref<String> text_;
+  ArrayRef< ArrayRef<char> > byteSegments_;
+  std::string ecLevel_;
+
+public:
+  DecoderResult(ArrayRef<char> rawBytes,
+                Ref<String> text,
+                ArrayRef< ArrayRef<char> >& byteSegments,
+                std::string const& ecLevel);
+
+  DecoderResult(ArrayRef<char> rawBytes, Ref<String> text);
+
+  ArrayRef<char> getRawBytes();
+  Ref<String> getText();
+};
+
+}
+
+#endif // __DECODER_RESULT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/common/GlobalHistogramBinarizer.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,48 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+#ifndef __GLOBALHISTOGRAMBINARIZER_H__
+#define __GLOBALHISTOGRAMBINARIZER_H__
+/*
+ *  GlobalHistogramBinarizer.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/Binarizer.h>
+#include <zxing/common/BitArray.h>
+#include <zxing/common/BitMatrix.h>
+#include <zxing/common/Array.h>
+
+namespace zxing {
+	
+class GlobalHistogramBinarizer : public Binarizer {
+private:
+  ArrayRef<char> luminances;
+  ArrayRef<int> buckets;
+public:
+  GlobalHistogramBinarizer(Ref<LuminanceSource> source);
+  virtual ~GlobalHistogramBinarizer();
+		
+  virtual Ref<BitArray> getBlackRow(int y, Ref<BitArray> row);
+  virtual Ref<BitMatrix> getBlackMatrix();
+  static int estimateBlackPoint(ArrayRef<int> const& buckets);
+  Ref<Binarizer> createBinarizer(Ref<LuminanceSource> source);
+private:
+  void initArrays(int luminanceSize);
+};
+
+}
+	
+#endif /* GLOBALHISTOGRAMBINARIZER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/common/HybridBinarizer.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,67 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+#ifndef __HYBRIDBINARIZER_H__
+#define __HYBRIDBINARIZER_H__
+/*
+ *  HybridBinarizer.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <vector>
+#include <zxing/Binarizer.h>
+#include <zxing/common/GlobalHistogramBinarizer.h>
+#include <zxing/common/BitArray.h>
+#include <zxing/common/BitMatrix.h>
+
+namespace zxing {
+	
+	class HybridBinarizer : public GlobalHistogramBinarizer {
+	 private:
+    Ref<BitMatrix> matrix_;
+	  Ref<BitArray> cached_row_;
+
+	public:
+		HybridBinarizer(Ref<LuminanceSource> source);
+		virtual ~HybridBinarizer();
+		
+		virtual Ref<BitMatrix> getBlackMatrix();
+		Ref<Binarizer> createBinarizer(Ref<LuminanceSource> source);
+  private:
+    // We'll be using one-D arrays because C++ can't dynamically allocate 2D
+    // arrays
+    ArrayRef<int> calculateBlackPoints(ArrayRef<char> luminances,
+                                       int subWidth,
+                                       int subHeight,
+                                       int width,
+                                       int height);
+    void calculateThresholdForBlock(ArrayRef<char> luminances,
+                                    int subWidth,
+                                    int subHeight,
+                                    int width,
+                                    int height,
+                                    ArrayRef<int> blackPoints,
+                                    Ref<BitMatrix> const& matrix);
+    void thresholdBlock(ArrayRef<char>luminances,
+                        int xoffset,
+                        int yoffset,
+                        int threshold,
+                        int stride,
+                        Ref<BitMatrix> const& matrix);
+	};
+
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/common/IllegalArgumentException.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,36 @@
+#ifndef __ILLEGAL_ARGUMENT_EXCEPTION_H__
+#define __ILLEGAL_ARGUMENT_EXCEPTION_H__
+
+/*
+ *  IllegalArgumentException.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/Exception.h>
+
+namespace zxing {
+
+class IllegalArgumentException : public Exception {
+public:
+  IllegalArgumentException();
+  IllegalArgumentException(const char *msg);
+  ~IllegalArgumentException() throw();
+};
+
+}
+
+#endif // __ILLEGAL_ARGUMENT_EXCEPTION_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/common/Str.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,51 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+#ifndef __STR_H__
+#define __STR_H__
+
+/*
+ *  Str.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <string>
+#include <iostream>
+#include <zxing/common/Counted.h>
+
+namespace zxing {
+
+class String;
+std::ostream& operator << (std::ostream& out, String const& s);
+
+class String : public Counted {
+private:
+  std::string text_;
+public:
+  explicit String(const std::string &text);
+  explicit String(int);
+  char charAt(int) const;
+  Ref<String> substring(int) const;
+  const std::string& getText() const;
+  int size() const;
+  void append(std::string const& tail);
+  void append(char c);
+  int length() const;
+  friend std::ostream& zxing::operator << (std::ostream& out, String const& s);
+};
+
+}
+
+#endif // __COMMON__STRING_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/common/reedsolomon/GenericGF.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,73 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+/*
+ *  GenericGF.h
+ *  zxing
+ *
+ *  Created by Lukas Stabe on 13/02/2012.
+ *  Copyright 2012 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef GENERICGF_H
+#define GENERICGF_H
+
+#include <vector>
+#include <zxing/common/Counted.h>
+
+namespace zxing {
+  class GenericGFPoly;
+  
+  class GenericGF : public Counted {
+    
+  private:
+    std::vector<int> expTable;
+    std::vector<int> logTable;
+    Ref<GenericGFPoly> zero;
+    Ref<GenericGFPoly> one;
+    int size;
+    int primitive;
+    int generatorBase;
+    bool initialized;
+    
+    void initialize();
+    void checkInit();
+    
+  public:
+    static Ref<GenericGF> AZTEC_DATA_12;
+    static Ref<GenericGF> AZTEC_DATA_10;
+    static Ref<GenericGF> AZTEC_DATA_8;
+    static Ref<GenericGF> AZTEC_DATA_6;
+    static Ref<GenericGF> AZTEC_PARAM;
+    static Ref<GenericGF> QR_CODE_FIELD_256;
+    static Ref<GenericGF> DATA_MATRIX_FIELD_256;
+    static Ref<GenericGF> MAXICODE_FIELD_64;
+    
+    GenericGF(int primitive, int size, int b);
+    
+    Ref<GenericGFPoly> getZero();
+    Ref<GenericGFPoly> getOne();
+    int getSize();
+    int getGeneratorBase();
+    Ref<GenericGFPoly> buildMonomial(int degree, int coefficient);
+    
+    static int addOrSubtract(int a, int b);
+    int exp(int a);
+    int log(int a);
+    int inverse(int a);
+    int multiply(int a, int b);
+  };
+}
+
+#endif //GENERICGF_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/common/reedsolomon/GenericGFPoly.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,56 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+/*
+ *  GenericGFPoly.h
+ *  zxing
+ *
+ *  Created by Lukas Stabe on 13/02/2012.
+ *  Copyright 2012 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef GENERICGFPOLY_H
+#define GENERICGFPOLY_H
+
+#include <vector>
+#include <zxing/common/Array.h>
+#include <zxing/common/Counted.h>
+
+namespace zxing {
+
+class GenericGF;
+  
+class GenericGFPoly : public Counted {
+private:
+  GenericGF &field_;
+  ArrayRef<int> coefficients_;
+    
+public:
+  GenericGFPoly(GenericGF &field, ArrayRef<int> coefficients);
+  ArrayRef<int> getCoefficients();
+  int getDegree();
+  bool isZero();
+  int getCoefficient(int degree);
+  int evaluateAt(int a);
+  Ref<GenericGFPoly> addOrSubtract(Ref<GenericGFPoly> other);
+  Ref<GenericGFPoly> multiply(Ref<GenericGFPoly> other);
+  Ref<GenericGFPoly> multiply(int scalar);
+  Ref<GenericGFPoly> multiplyByMonomial(int degree, int coefficient);
+  std::vector<Ref<GenericGFPoly> > divide(Ref<GenericGFPoly> other);
+    
+
+};
+
+}
+
+#endif //GENERICGFPOLY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/common/reedsolomon/ReedSolomonDecoder.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,49 @@
+#ifndef __REED_SOLOMON_DECODER_H__
+#define __REED_SOLOMON_DECODER_H__
+
+/*
+ *  ReedSolomonDecoder.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <memory>
+#include <vector>
+#include <zxing/common/Counted.h>
+#include <zxing/common/Array.h>
+#include <zxing/common/reedsolomon/GenericGFPoly.h>
+#include <zxing/common/reedsolomon/GenericGF.h>
+
+namespace zxing {
+class GenericGFPoly;
+class GenericGF;
+
+class ReedSolomonDecoder {
+private:
+  Ref<GenericGF> field;
+public:
+  ReedSolomonDecoder(Ref<GenericGF> fld);
+  ~ReedSolomonDecoder();
+  void decode(ArrayRef<int> received, int twoS);
+  std::vector<Ref<GenericGFPoly> > runEuclideanAlgorithm(Ref<GenericGFPoly> a, Ref<GenericGFPoly> b, int R);
+
+private:
+  ArrayRef<int> findErrorLocations(Ref<GenericGFPoly> errorLocator);
+  ArrayRef<int> findErrorMagnitudes(Ref<GenericGFPoly> errorEvaluator, ArrayRef<int> errorLocations);
+};
+}
+
+#endif // __REED_SOLOMON_DECODER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/multi/ByQuadrantReader.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,42 @@
+#ifndef __BY_QUADRANT_READER_H__
+#define __BY_QUADRANT_READER_H__
+
+/*
+ *  Copyright 2011 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/Reader.h>
+#include <zxing/BinaryBitmap.h>
+#include <zxing/Result.h>
+#include <zxing/DecodeHints.h>
+
+namespace zxing {
+namespace multi {
+
+class ByQuadrantReader : public Reader {
+  private:
+    Reader& delegate_;
+
+  public:
+    ByQuadrantReader(Reader& delegate);
+    virtual ~ByQuadrantReader();
+    virtual Ref<Result> decode(Ref<BinaryBitmap> image);
+    virtual Ref<Result> decode(Ref<BinaryBitmap> image, DecodeHints hints);
+};
+
+}
+}
+
+#endif // __BY_QUADRANT_READER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/multi/GenericMultipleBarcodeReader.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,51 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+#ifndef __GENERIC_MULTIPLE_BARCODE_READER_H__
+#define __GENERIC_MULTIPLE_BARCODE_READER_H__
+
+/*
+ *  Copyright 2011 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/multi/MultipleBarcodeReader.h>
+#include <zxing/Reader.h>
+
+namespace zxing {
+namespace multi {
+
+class GenericMultipleBarcodeReader : public MultipleBarcodeReader {
+ private:
+  static Ref<Result> translateResultPoints(Ref<Result> result, 
+                                           int xOffset, 
+                                           int yOffset);
+  void doDecodeMultiple(Ref<BinaryBitmap> image, 
+                        DecodeHints hints, 
+                        std::vector<Ref<Result> >& results, 
+                        int xOffset, 
+                        int yOffset,
+                        int currentDepth);
+  Reader& delegate_;
+  static const int MIN_DIMENSION_TO_RECUR = 100;
+  static const int MAX_DEPTH = 4;
+
+ public:
+  GenericMultipleBarcodeReader(Reader& delegate);
+  virtual ~GenericMultipleBarcodeReader();
+  virtual std::vector<Ref<Result> > decodeMultiple(Ref<BinaryBitmap> image, DecodeHints hints);
+};
+
+}
+}
+
+#endif // __GENERIC_MULTIPLE_BARCODE_READER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/multi/MultipleBarcodeReader.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,41 @@
+#ifndef __MULTIPLE_BARCODE_READER_H__
+#define __MULTIPLE_BARCODE_READER_H__
+
+/*
+ *  Copyright 2011 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/common/Counted.h>
+#include <zxing/Result.h>
+#include <zxing/BinaryBitmap.h>
+#include <zxing/DecodeHints.h>
+#include <vector>
+
+namespace zxing {
+namespace multi {
+
+class MultipleBarcodeReader : public Counted {
+  protected:
+    MultipleBarcodeReader() {}
+  public:
+    virtual std::vector<Ref<Result> > decodeMultiple(Ref<BinaryBitmap> image);
+    virtual std::vector<Ref<Result> > decodeMultiple(Ref<BinaryBitmap> image, DecodeHints hints) = 0;
+    virtual ~MultipleBarcodeReader();
+};
+
+}
+}
+
+#endif // __MULTIPLE_BARCODE_READER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/multi/qrcode/QRCodeMultiReader.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,36 @@
+#ifndef __QRCODE_MULTI_READER_H__
+#define __QRCODE_MULTI_READER_H__
+
+/*
+ *  Copyright 2011 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/multi/MultipleBarcodeReader.h>
+#include <zxing/qrcode/QRCodeReader.h>
+
+namespace zxing {
+namespace multi {
+
+class QRCodeMultiReader: public zxing::qrcode::QRCodeReader, public MultipleBarcodeReader {
+  public:
+    QRCodeMultiReader();
+    virtual ~QRCodeMultiReader();
+    virtual std::vector<Ref<Result> > decodeMultiple(Ref<BinaryBitmap> image, DecodeHints hints);
+};
+
+}
+}
+
+#endif // __QRCODE_MULTI_READER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/qrcode/QRCodeReader.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,48 @@
+// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
+#ifndef __QR_CODE_READER_H__
+#define __QR_CODE_READER_H__
+
+/*
+ *  QRCodeReader.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/Reader.h>
+#include <zxing/qrcode/decoder/Decoder.h>
+#include <zxing/DecodeHints.h>
+
+namespace zxing {
+namespace qrcode {
+		
+class QRCodeReader : public Reader {
+ private:
+  Decoder decoder_;
+			
+ protected:
+  Decoder& getDecoder();
+
+ public:
+  QRCodeReader();
+  virtual ~QRCodeReader();
+			
+  Ref<Result> decode(Ref<BinaryBitmap> image, DecodeHints hints);
+};
+
+}
+}
+
+#endif // __QR_CODE_READER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing/qrcode/decoder/Decoder.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,46 @@
+#ifndef __DECODER_H__
+#define __DECODER_H__
+
+/*
+ *  Decoder.h
+ *  zxing
+ *
+ *  Copyright 2010 ZXing authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <zxing/common/reedsolomon/ReedSolomonDecoder.h>
+#include <zxing/common/Counted.h>
+#include <zxing/common/Array.h>
+#include <zxing/common/DecoderResult.h>
+#include <zxing/common/BitMatrix.h>
+
+namespace zxing {
+namespace qrcode {
+
+class Decoder {
+private:
+  ReedSolomonDecoder rsDecoder_;
+
+  void correctErrors(ArrayRef<char> bytes, int numDataCodewords);
+
+public:
+  Decoder();
+  Ref<DecoderResult> decode(Ref<BitMatrix> bits);
+};
+
+}
+}
+
+#endif // __DECODER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_lib/zxing_config.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,21 @@
+
+/**** User Selection *********/
+
+//#define ZXING_EXCLUDE_1DCODE                      /* define : 1D barcodes can not be scanned */
+#undef ZXING_EXCLUDE_1DCODE                         /* undef  : 1D barcodes can be scanned */
+                                                    
+//#define ZXING_EXCLUDE_QRCODE                      /* define : QR-code can not be scanned */
+#undef ZXING_EXCLUDE_QRCODE                         /* undef  : QR-code can be scanned */
+                                                    
+//#define ZXING_EXCLUDE_MATRIX                      /* define : Matrix can not be scanned */
+#undef ZXING_EXCLUDE_MATRIX                         /* undef  : Matrix can be scanned */
+                                                    
+//#define ZXING_EXCLUDE_AZTEC                       /* define : Aztec can not be scanned */
+#undef ZXING_EXCLUDE_AZTEC                          /* undef  : Aztec can be scanned */
+                                                    
+//#define ZXING_EXCLUDE_PDF417                      /* define : PDF417 can not be scanned */
+#undef ZXING_EXCLUDE_PDF417                         /* undef  : PDF417 can be scanned */
+
+//#define ZXING_MULTI_QUADRANT                      /* define : Zxing can multi decode */
+#undef ZXING_MULTI_QUADRANT                         /* undef  : Zxing can not multi decode */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_main.cpp	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,456 @@
+
+#include "mbed.h"
+#include "rtos.h"
+#include "DisplayBace.h"
+#include "ImageReaderSource.h"
+
+#define VIDEO_CVBS             (0)                 /* Analog  Video Signal */
+#define VIDEO_CMOS_CAMERA      (1)                 /* Digital Video Signal */
+
+/**** User Selection *********/
+/** Camera setting **/
+#define VIDEO_INPUT_METHOD     (VIDEO_CMOS_CAMERA) /* Select  VIDEO_CVBS or VIDEO_CMOS_CAMERA                       */
+#define USE_VIDEO_CH           (0)                 /* Select  0 or 1            If selecting VIDEO_CMOS_CAMERA, should be 0.)               */
+#define VIDEO_PAL              (0)                 /* Select  0(NTSC) or 1(PAL) If selecting VIDEO_CVBS, this parameter is not referenced.) */
+/** LCD setting **/
+#define LCD_ONOFF              (1)                 /* Select  0(without LCD) or 1(with LCD) */
+#define LCD_TYPE               (0)                 /* Select  0(4.3inch) or 1(7.1inch) */
+/** JPEG out setting **/
+#define JPEG_SEND              (0)                 /* Select  0(JPEG images are not output to PC) or 1(JPEG images are output to PC on USB(CDC) for focusing the camera) */
+/** Decode hints **/
+#define DECODE_HINTS           (DecodeHints::ONED_HINT | DecodeHints::QR_CODE_HINT | DecodeHints::DATA_MATRIX_HINT | DecodeHints::AZTEC_HINT)
+/*****************************/
+
+#if LCD_ONOFF
+/** LCD shield config **/
+#if (LCD_TYPE == 0)
+  #include "LCD_shield_config_4_3inch.h"
+#else
+  #include "LCD_shield_config_7_1inch.h"
+#endif
+  #include "AsciiFont.h"
+#endif
+
+#if JPEG_SEND
+  #include "JPEG_Converter.h"
+  #include "DisplayApp.h"
+#endif
+
+/** Video and Grapics (GRAPHICS_LAYER_0) parameter **/
+/* video input */
+#if USE_VIDEO_CH == (0)
+  #define VIDEO_INPUT_CH       (DisplayBase::VIDEO_INPUT_CHANNEL_0)
+  #define VIDEO_INT_TYPE       (DisplayBase::INT_TYPE_S0_VFIELD)
+#else
+  #define VIDEO_INPUT_CH       (DisplayBase::VIDEO_INPUT_CHANNEL_1)
+  #define VIDEO_INT_TYPE       (DisplayBase::INT_TYPE_S1_VFIELD)
+#endif
+
+/* NTSC or PAL */
+#if VIDEO_PAL == 0
+  #define COL_SYS              (DisplayBase::COL_SYS_NTSC_358)
+#else
+  #define COL_SYS              (DisplayBase::COL_SYS_PAL_443)
+#endif
+
+/* Video input */
+#define VIDEO_FORMAT           (DisplayBase::VIDEO_FORMAT_YCBCR422)
+#define GRAPHICS_FORMAT        (DisplayBase::GRAPHICS_FORMAT_YCBCR422)
+#define WR_RD_WRSWA            (DisplayBase::WR_RD_WRSWA_16BIT)
+#define FRAME_BUFFER_BYTE_PER_PIXEL   (2u)
+
+#if VIDEO_INPUT_METHOD == VIDEO_CVBS
+  #define WAIT_VFIELD_CNT      (2)
+#else
+  #define WAIT_VFIELD_CNT      (1)
+#endif
+
+/* The size of the video input */
+#if ((LCD_ONOFF) && (LCD_TYPE == 0))
+  #define VIDEO_PIXEL_HW       LCD_PIXEL_WIDTH
+  #define VIDEO_PIXEL_VW       LCD_PIXEL_HEIGHT
+#else
+  #define VIDEO_PIXEL_HW       (640)  /* VGA */
+  #define VIDEO_PIXEL_VW       (480)  /* VGA */
+#endif
+
+/*! Frame buffer stride: Frame buffer stride should be set to a multiple of 32 or 128
+    in accordance with the frame buffer burst transfer mode. */
+/* FRAME BUFFER Parameter GRAPHICS_LAYER_0 */
+#define FRAME_BUFFER_STRIDE    (((VIDEO_PIXEL_HW * FRAME_BUFFER_BYTE_PER_PIXEL) + 31u) & ~31u)
+
+static DisplayBase Display;
+static Timer decode_timer;
+
+/* 32 bytes aligned */
+static uint8_t user_frame_buffer0[FRAME_BUFFER_STRIDE * VIDEO_PIXEL_VW]__attribute((section("NC_BSS"),aligned(32)));
+
+static volatile int32_t vfield_count = 0;
+static bool graphics_init_end = false;
+static int decode_wait_time = 0;
+static void (*p_callback_func)(char * addr, int size);
+
+#if LCD_ONOFF
+/****** LCD ******/
+static DigitalOut  lcd_pwon(P7_15);
+static DigitalOut  lcd_blon(P8_1);
+static PwmOut      lcd_cntrst(P8_15);
+
+static void Init_LCD_Display(void) {
+    DisplayBase::graphics_error_t error;
+    DisplayBase::lcd_config_t lcd_config;
+    PinName lvds_pin[8] = {
+        /* data pin */
+        P5_7, P5_6, P5_5, P5_4, P5_3, P5_2, P5_1, P5_0
+    };
+
+    lcd_pwon = 0;
+    lcd_blon = 0;
+    Thread::wait(100);
+    lcd_pwon = 1;
+    lcd_blon = 1;
+
+    Display.Graphics_Lvds_Port_Init(lvds_pin, 8);
+
+    /* Graphics initialization process */
+    lcd_config = LcdCfgTbl_LCD_shield;
+    error = Display.Graphics_init(&lcd_config);
+    if (error != DisplayBase::GRAPHICS_OK) {
+        printf("Line %d, error %d\n", __LINE__, error);
+        mbed_die();
+    }
+    graphics_init_end = true;
+}
+
+static void Start_LCD_Display(uint8_t * p_buf) {
+    DisplayBase::rect_t rect;
+
+    rect.vs = 0;
+    rect.vw = VIDEO_PIXEL_VW;
+    rect.hs = 0;
+    rect.hw = VIDEO_PIXEL_HW;
+    Display.Graphics_Read_Setting(
+        DisplayBase::GRAPHICS_LAYER_0,
+        (void *)p_buf,
+        FRAME_BUFFER_STRIDE,
+        GRAPHICS_FORMAT,
+        WR_RD_WRSWA,
+        &rect
+    );
+    Display.Graphics_Start(DisplayBase::GRAPHICS_LAYER_0);
+}
+
+#define VIDEO_PIXEL_HW_STR              (VIDEO_PIXEL_HW - 64)
+#define VIDEO_PIXEL_VW_STR              (VIDEO_PIXEL_VW - 64)
+#define FRAME_BUFFER_BYTE_PER_PIXEL_STR (2u)
+#define FRAME_BUFFER_STRIDE_STR         (((VIDEO_PIXEL_HW_STR * FRAME_BUFFER_BYTE_PER_PIXEL_STR) + 31u) & ~31u)
+
+static uint8_t user_frame_buffer_string[FRAME_BUFFER_STRIDE_STR * VIDEO_PIXEL_VW_STR]__attribute((section("NC_BSS"),aligned(32)));
+static AsciiFont ascii_font(user_frame_buffer_string, VIDEO_PIXEL_HW_STR, VIDEO_PIXEL_VW_STR, FRAME_BUFFER_STRIDE_STR, FRAME_BUFFER_BYTE_PER_PIXEL_STR);
+static bool      string_draw;
+
+static void decode_string_init(void) {
+    DisplayBase::rect_t rect;
+
+    /* The layer by which the touch panel location is drawn */
+    ascii_font.Erase(0x00000000);  /* rrrrGBAR (r:Reserve G:Green B:Blue A:Alpha R:Red */
+    rect.vs = 32;
+    rect.vw = VIDEO_PIXEL_VW_STR;
+    rect.hs = 32;
+    rect.hw = VIDEO_PIXEL_HW_STR;
+    Display.Graphics_Read_Setting(
+        DisplayBase::GRAPHICS_LAYER_1,
+        (void *)user_frame_buffer_string,
+        FRAME_BUFFER_STRIDE_STR,
+        DisplayBase::GRAPHICS_FORMAT_ARGB4444,
+        DisplayBase::WR_RD_WRSWA_32_16BIT,
+        &rect
+    );
+    Display.Graphics_Start(DisplayBase::GRAPHICS_LAYER_1);
+    string_draw = false;
+}
+
+static void decode_string_disp(char ** decode_str) {
+    if ((decode_str != NULL) && (*decode_str != NULL)) {
+        /* Drow string */
+        ascii_font.Erase(0x00000090);  /* rrrrGBAR (r:Reserve G:Green B:Blue A:Alpha R:Red */
+        int rest_size = strlen(*decode_str);
+        int draw_idx = 0;
+        int draw_size;
+        int draw_line = 0;
+
+        while (rest_size > 0) {
+            draw_size = ascii_font.DrawStr(*decode_str + draw_idx, 6, 5 + (18 * draw_line), 0x0000ffff, 2);
+            if (draw_size <= 0) {
+                break;
+            }
+            rest_size -= draw_size;
+            draw_idx += draw_size;
+            draw_line++;
+        }
+        string_draw = true;
+    } else {
+        if (string_draw != false) {
+            /* Clear string */
+            ascii_font.Erase(0x00000000);  /* rrrrGBAR (r:Reserve G:Green B:Blue A:Alpha R:Red */
+            string_draw = false;
+        }
+    }
+}
+#endif // LCD_ONOFF
+
+#if JPEG_SEND
+/****** Jpeg Send ******/
+#define JPEG_ENC_MAX_SIZE      (1024 * 63)
+#define JPEG_SIGNAL_CAP_COMP   (1L)
+
+#define JPEGSEND_STB           (0)
+#define JPEGSEND_ENC           (1)
+
+static Thread jpegsendTask(osPriorityAboveNormal, 2048);
+static DisplayApp  display_app;
+static uint8_t JpegBuffer[JPEG_ENC_MAX_SIZE]__attribute((section("NC_BSS"),aligned(8)));  //8 bytes aligned!;
+volatile static uint32_t jpegsend_status = JPEGSEND_STB;
+
+static void jpegsendTask_main( void ) {
+    JPEG_Converter Jcu;
+    size_t jcu_encode_size;
+
+    while (1) {
+        Thread::signal_wait(JPEG_SIGNAL_CAP_COMP, 80);
+        jpegsend_status = JPEGSEND_ENC;
+
+        /* JPEG Enc Start */
+        JPEG_Converter::bitmap_buff_info_t bitmap_buff_info;
+        JPEG_Converter::encode_options_t   encode_options;
+        bitmap_buff_info.width              = VIDEO_PIXEL_HW;
+        bitmap_buff_info.height             = VIDEO_PIXEL_VW;
+        bitmap_buff_info.format             = JPEG_Converter::WR_RD_YCbCr422;
+        bitmap_buff_info.buffer_address     = (void *)user_frame_buffer0;
+        encode_options.encode_buff_size     = sizeof(JpegBuffer);
+        encode_options.p_EncodeCallBackFunc = NULL;
+        encode_options.input_swapsetting    = JPEG_Converter::WR_RD_WRSWA_16_8BIT;
+        jcu_encode_size = 0;
+        if (Jcu.encode(&bitmap_buff_info, JpegBuffer, &jcu_encode_size, &encode_options) != JPEG_Converter::JPEG_CONV_OK) {
+            jcu_encode_size = 0;
+        }
+
+        /* JPEG Data Send */
+        if ((jcu_encode_size > 256) && (jcu_encode_size < JPEG_ENC_MAX_SIZE)) {
+            display_app.SendJpeg(JpegBuffer, jcu_encode_size);
+        }
+        jpegsend_status = JPEGSEND_STB;
+    }
+}
+
+static void jpegsendTask_init( void ) {
+    jpegsendTask.start(jpegsendTask_main);
+}
+
+static void jpegsend_cap_comp( void ) {
+    if (jpegsend_status == JPEGSEND_STB) {
+        jpegsendTask.signal_set(JPEG_SIGNAL_CAP_COMP);
+    }
+}
+#endif // JPEG_SEND
+
+/****** Video ******/
+static void IntCallbackFunc_Vfield(DisplayBase::int_type_t int_type) {
+    /* Interrupt callback function for Vfield interruption */
+    if (vfield_count > 0) {
+        vfield_count--;
+    }
+#if JPEG_SEND
+    jpegsend_cap_comp();
+#endif // JPEG_SEND
+}
+
+static void Wait_Vfield(const int32_t wait_count) {
+    /* Wait for the specified number of times Vsync occurs */
+    vfield_count = wait_count;
+    while (vfield_count > 0) {
+        Thread::wait(1);
+    }
+}
+
+static void Init_Video(void) {
+    DisplayBase::graphics_error_t error;
+
+    /* Graphics initialization process */
+    if (graphics_init_end == false) {
+        /* When not initializing LCD, this processing is needed. */
+        error = Display.Graphics_init(NULL);
+        if (error != DisplayBase::GRAPHICS_OK) {
+            printf("Line %d, error %d\n", __LINE__, error);
+            mbed_die();
+        }
+        graphics_init_end = true;
+    }
+
+#if VIDEO_INPUT_METHOD == VIDEO_CVBS
+    error = Display.Graphics_Video_init( DisplayBase::INPUT_SEL_VDEC, NULL);
+    if( error != DisplayBase::GRAPHICS_OK ) {
+        printf("Line %d, error %d\n", __LINE__, error);
+        mbed_die();
+    }
+#elif VIDEO_INPUT_METHOD == VIDEO_CMOS_CAMERA
+    DisplayBase::video_ext_in_config_t ext_in_config;
+    PinName cmos_camera_pin[11] = {
+        /* data pin */
+        P2_7, P2_6, P2_5, P2_4, P2_3, P2_2, P2_1, P2_0,
+        /* control pin */
+        P10_0,      /* DV0_CLK   */
+        P1_0,       /* DV0_Vsync */
+        P1_1        /* DV0_Hsync */
+    };
+
+    /* MT9V111 camera input config */
+    ext_in_config.inp_format     = DisplayBase::VIDEO_EXTIN_FORMAT_BT601; /* BT601 8bit YCbCr format */
+    ext_in_config.inp_pxd_edge   = DisplayBase::EDGE_RISING;              /* Clock edge select for capturing data          */
+    ext_in_config.inp_vs_edge    = DisplayBase::EDGE_RISING;              /* Clock edge select for capturing Vsync signals */
+    ext_in_config.inp_hs_edge    = DisplayBase::EDGE_RISING;              /* Clock edge select for capturing Hsync signals */
+    ext_in_config.inp_endian_on  = DisplayBase::OFF;                      /* External input bit endian change on/off       */
+    ext_in_config.inp_swap_on    = DisplayBase::OFF;                      /* External input B/R signal swap on/off         */
+    ext_in_config.inp_vs_inv     = DisplayBase::SIG_POL_NOT_INVERTED;     /* External input DV_VSYNC inversion control     */
+    ext_in_config.inp_hs_inv     = DisplayBase::SIG_POL_INVERTED;         /* External input DV_HSYNC inversion control     */
+    ext_in_config.inp_f525_625   = DisplayBase::EXTIN_LINE_525;           /* Number of lines for BT.656 external input */
+    ext_in_config.inp_h_pos      = DisplayBase::EXTIN_H_POS_CRYCBY;       /* Y/Cb/Y/Cr data string start timing to Hsync reference */
+    ext_in_config.cap_vs_pos     = 6;                                     /* Capture start position from Vsync */
+    ext_in_config.cap_hs_pos     = 150;                                   /* Capture start position form Hsync */
+#if ((LCD_ONOFF) && (LCD_TYPE == 0))
+    /* The same screen ratio as the screen ratio of the LCD. */
+    ext_in_config.cap_width      = 640;                                   /* Capture width */
+    ext_in_config.cap_height     = 363;                                   /* Capture height Max 468[line]
+                                                                             Due to CMOS(MT9V111) output signal timing and VDC5 specification */
+#else
+    ext_in_config.cap_width      = 640;                                   /* Capture width */
+    ext_in_config.cap_height     = 468;                                   /* Capture height Max 468[line]
+                                                                             Due to CMOS(MT9V111) output signal timing and VDC5 specification */
+#endif
+    error = Display.Graphics_Video_init( DisplayBase::INPUT_SEL_EXT, &ext_in_config);
+    if( error != DisplayBase::GRAPHICS_OK ) {
+        printf("Line %d, error %d\n", __LINE__, error);
+        mbed_die();
+    }
+
+    /* Camera input port setting */
+    error = Display.Graphics_Dvinput_Port_Init(cmos_camera_pin, 11);
+    if( error != DisplayBase::GRAPHICS_OK ) {
+        printf("Line %d, error %d\n", __LINE__, error);
+        mbed_die();
+    }
+#endif
+
+    /* Interrupt callback function setting (Field end signal for recording function in scaler 0) */
+    error = Display.Graphics_Irq_Handler_Set(VIDEO_INT_TYPE, 0, IntCallbackFunc_Vfield);
+    if (error != DisplayBase::GRAPHICS_OK) {
+        printf("Line %d, error %d\n", __LINE__, error);
+        mbed_die();
+    }
+}
+
+static void Start_Video(uint8_t * p_buf) {
+    DisplayBase::graphics_error_t error;
+
+    /* Video capture setting (progressive form fixed) */
+    error = Display.Video_Write_Setting(
+                VIDEO_INPUT_CH,
+                COL_SYS,
+                p_buf,
+                FRAME_BUFFER_STRIDE,
+                VIDEO_FORMAT,
+                WR_RD_WRSWA,
+                VIDEO_PIXEL_VW,
+                VIDEO_PIXEL_HW
+            );
+    if (error != DisplayBase::GRAPHICS_OK) {
+        printf("Line %d, error %d\n", __LINE__, error);
+        mbed_die();
+    }
+
+    /* Video write process start */
+    error = Display.Video_Start(VIDEO_INPUT_CH);
+    if (error != DisplayBase::GRAPHICS_OK) {
+        printf("Line %d, error %d\n", __LINE__, error);
+        mbed_die();
+    }
+
+    /* Video write process stop */
+    error = Display.Video_Stop(VIDEO_INPUT_CH);
+    if (error != DisplayBase::GRAPHICS_OK) {
+        printf("Line %d, error %d\n", __LINE__, error);
+        mbed_die();
+    }
+
+    /* Video write process start */
+    error = Display.Video_Start(VIDEO_INPUT_CH);
+    if (error != DisplayBase::GRAPHICS_OK) {
+        printf("Line %d, error %d\n", __LINE__, error);
+        mbed_die();
+    }
+}
+
+/****** zxing_init ******/
+void zxing_init(void (*pfunc)(char * addr, int size)) {
+
+#if JPEG_SEND
+    jpegsendTask_init();
+#endif // JPEG_SEND
+#if LCD_ONOFF
+    /* Initialization of LCD */
+    Init_LCD_Display();    /* When using LCD, please call before than Init_Video(). */
+#endif // LCD_ONOFF
+    /* Initialization of Video */
+    Init_Video();
+
+    /* Initialization memory */
+    memset(user_frame_buffer0, 0, (FRAME_BUFFER_STRIDE * VIDEO_PIXEL_VW));
+
+    /* Start of Video */
+    Start_Video(user_frame_buffer0);
+    /* Wait for first video drawing */
+    Wait_Vfield(WAIT_VFIELD_CNT);
+#if LCD_ONOFF
+    decode_string_init();
+    /* Start of LCD */
+    Start_LCD_Display(user_frame_buffer0);
+    /* Backlight on */
+    Thread::wait(200);
+    lcd_cntrst.write(1.0);
+#endif // LCD_ONOFF
+    p_callback_func = pfunc;
+    decode_timer.reset();
+    decode_timer.start();
+}
+
+/****** zxing_main ******/
+int zxing_loop() {
+    int decode_result = -1;
+    vector<Ref<Result> > results;
+    char ** decode_str = NULL;
+
+    Wait_Vfield(WAIT_VFIELD_CNT);
+    /* Decode barcode image */
+    if (decode_timer.read_ms() >= decode_wait_time) {
+        decode_timer.reset();
+        DecodeHints hints(DECODE_HINTS);
+        hints.setTryHarder(false);
+        decode_result = ex_decode(user_frame_buffer0, (FRAME_BUFFER_STRIDE * VIDEO_PIXEL_VW), VIDEO_PIXEL_HW, VIDEO_PIXEL_VW, &results, hints);
+        if (decode_result == 0) {
+            decode_str = (char **)&(results[0]->getText()->getText());
+            int size = strlen(*decode_str);
+            if (p_callback_func != NULL) {
+                p_callback_func(*decode_str, size);
+            }
+            decode_wait_time = 500;
+        } else {
+            decode_wait_time = 10;
+        }
+#if LCD_ONOFF
+        decode_string_disp(decode_str);
+#endif // LCD_ONOFF
+    }
+
+    return decode_result;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zxing_main.h	Fri Jan 12 15:41:00 2018 +0900
@@ -0,0 +1,9 @@
+
+#ifndef ZXING_MAIN_H
+#define ZXING_MAIN_H
+
+extern void zxing_init(void (*pfunc)(char * addr, int size));
+extern int zxing_loop();
+
+#endif
+