Mbed Client sample for GR-LYCHEE where ZXing is incorporated.

Dependencies:   DisplayApp AsciiFont

Fork of GR-PEACH_mbed-os-client-ZXingSample by Renesas

Overview

This sample program shows how to use mbed Client together with ZXing which is an open-source, multi-format 1D/2D barcode image processing library. For more info on ZXing, please refer to https://github.com/zxing/zxing.

Required hardware

Application setup

  1. Select the connection type. For details, please refer to the following wiki:
    https://os.mbed.com/users/1050186/code/GR-LYCHEE_mbed-os-client-ZXingSample/wiki/Connection-type.
  2. Set the client credentials. For details, please refer to the following wiki:
    https://os.mbed.com/users/1050186/code/GR-LYCHEE_mbed-os-client-ZXingSample/wiki/Client-credentials.
  3. Change Wifi settings. For details, please refer to the following wiki:
    https://os.mbed.com/users/1050186/code/GR-LYCHEE_mbed-os-client-ZXingSample/wiki/Wifi-settings.

Building the example

To build this example:

  1. Import this example onto mbed Compiler.
  2. Configure the example in accordance with Application setup.
  3. Compile the example on mbed Compiler and download the resultant binary file.
  4. Plug the micro-USB cable into the OpenSDA port which lies on the next to the RESET button.
  5. Copy the binary previously downloaded to your PC to GR-LYCHEE to flash this example. When the copy is successfully completed, the board is ready to work.
  6. Press the RESET button on the board to run the example.
  7. For verification, please refer to the following wiki:
    https://os.mbed.com/users/1050186/code/GR-LYCHEE_mbed-os-client-ZXingSample/wiki/Monitoring-the-application.

Application resources

This example exposes four resources listed below:

  1. 3202/0/5700. Decode result of barcode data input from camera (GET).
  2. 3201/0/5850. Blink function, blinks LED when executed (POST).
  3. 3201/0/5853. Blink pattern, used by the blink function to determine how to blink. In the format of 1000:500:1000:500:1000:500 (PUT).
  4. 3201/0/5855. Blink color, used by the blink function. Any of green, yellow, orange and red is acceptable (PUT).
Committer:
1050186
Date:
Thu Dec 13 03:31:49 2018 +0000
Revision:
18:0ab91e767950
Parent:
0:eb73febb2bba
Child:
19:03e8d4d608f0
Replace easy-connect.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 0:eb73febb2bba 1 /*
1050186 18:0ab91e767950 2
<> 0:eb73febb2bba 3 * Copyright (c) 2015 ARM Limited. All rights reserved.
1050186 18:0ab91e767950 4
<> 0:eb73febb2bba 5 * SPDX-License-Identifier: Apache-2.0
1050186 18:0ab91e767950 6
<> 0:eb73febb2bba 7 * Licensed under the Apache License, Version 2.0 (the License); you may
1050186 18:0ab91e767950 8
<> 0:eb73febb2bba 9 * not use this file except in compliance with the License.
1050186 18:0ab91e767950 10
<> 0:eb73febb2bba 11 * You may obtain a copy of the License at
1050186 18:0ab91e767950 12
<> 0:eb73febb2bba 13 *
1050186 18:0ab91e767950 14
<> 0:eb73febb2bba 15 * http://www.apache.org/licenses/LICENSE-2.0
1050186 18:0ab91e767950 16
<> 0:eb73febb2bba 17 *
1050186 18:0ab91e767950 18
<> 0:eb73febb2bba 19 * Unless required by applicable law or agreed to in writing, software
1050186 18:0ab91e767950 20
<> 0:eb73febb2bba 21 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
1050186 18:0ab91e767950 22
<> 0:eb73febb2bba 23 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1050186 18:0ab91e767950 24
<> 0:eb73febb2bba 25 * See the License for the specific language governing permissions and
1050186 18:0ab91e767950 26
<> 0:eb73febb2bba 27 * limitations under the License.
1050186 18:0ab91e767950 28
<> 0:eb73febb2bba 29 */
1050186 18:0ab91e767950 30
<> 0:eb73febb2bba 31 #ifndef __SECURITY_H__
1050186 18:0ab91e767950 32
<> 0:eb73febb2bba 33 #define __SECURITY_H__
1050186 18:0ab91e767950 34
1050186 18:0ab91e767950 35
1050186 18:0ab91e767950 36
1050186 18:0ab91e767950 37 #include <inttypes.h>
1050186 18:0ab91e767950 38
1050186 18:0ab91e767950 39
1050186 18:0ab91e767950 40
1050186 18:0ab91e767950 41 #define MBED_DOMAIN "c044ba4e-1a9a-4593-b0b0-87f5d5b44652"
1050186 18:0ab91e767950 42
1050186 18:0ab91e767950 43 #define MBED_ENDPOINT_NAME "8e9994d0-d238-46f1-b9cd-8d2e7fcaaa74"
1050186 18:0ab91e767950 44
<> 0:eb73febb2bba 45
1050186 18:0ab91e767950 46
1050186 18:0ab91e767950 47 const uint8_t SERVER_CERT[] = "-----BEGIN CERTIFICATE-----\r\n"
1050186 18:0ab91e767950 48
1050186 18:0ab91e767950 49 "MIIBqDCCAU+gAwIBAgIRAOv/vH36PyOwG5J+g5gAAAAwCgYIKoZIzj0EAwIwSzEL\r\n"
1050186 18:0ab91e767950 50
1050186 18:0ab91e767950 51 "MAkGA1UEBhMCRkkxDTALBgNVBAcMBE91bHUxDDAKBgNVBAoMA0FSTTEMMAoGA1UE\r\n"
1050186 18:0ab91e767950 52
1050186 18:0ab91e767950 53 "CwwDSW9UMREwDwYDVQQDDAhBUk0gbWJlZDAiGA8yMDE4MDQyMDAwMDAwMFoYDzIy\r\n"
1050186 18:0ab91e767950 54
1050186 18:0ab91e767950 55 "MDAwMTAxMDAwMDAwWjBLMQswCQYDVQQGEwJGSTENMAsGA1UEBwwET3VsdTEMMAoG\r\n"
1050186 18:0ab91e767950 56
1050186 18:0ab91e767950 57 "A1UECgwDQVJNMQwwCgYDVQQLDANJb1QxETAPBgNVBAMMCEFSTSBtYmVkMFkwEwYH\r\n"
1050186 18:0ab91e767950 58
1050186 18:0ab91e767950 59 "KoZIzj0CAQYIKoZIzj0DAQcDQgAEu4DItKTSYDdrCAVHmbDZEe2Hju1FQ7jir9F3\r\n"
1050186 18:0ab91e767950 60
1050186 18:0ab91e767950 61 "MVmcuwCx3XwSzF3ksKlxP3DS2818G/jEnEbDTBxis8MNvz+uO6MQMA4wDAYDVR0T\r\n"
1050186 18:0ab91e767950 62
1050186 18:0ab91e767950 63 "BAUwAwEB/zAKBggqhkjOPQQDAgNHADBEAiBP55WaRmAek8EBdlKHF6Q3PSwUA3lN\r\n"
1050186 18:0ab91e767950 64
1050186 18:0ab91e767950 65 "xgJ3vjCHwfOZwAIgIZGTaizc+01uxzisdpwjLtSdNtKNI3tfITaMHLsyRjM=\r\n"
1050186 18:0ab91e767950 66
1050186 18:0ab91e767950 67 "-----END CERTIFICATE-----\r\n";
1050186 18:0ab91e767950 68
<> 0:eb73febb2bba 69
1050186 18:0ab91e767950 70
<> 0:eb73febb2bba 71 const uint8_t CERT[] = "-----BEGIN CERTIFICATE-----\r\n"
1050186 18:0ab91e767950 72
1050186 18:0ab91e767950 73 "MIIBzzCCAXOgAwIBAgIEW+TM4jAMBggqhkjOPQQDAgUAMDkxCzAJBgNVBAYTAkZ\r\n"
1050186 18:0ab91e767950 74
1050186 18:0ab91e767950 75 "JMQwwCgYDVQQKDANBUk0xHDAaBgNVBAMME21iZWQtY29ubmVjdG9yLTIwMTgwHh\r\n"
1050186 18:0ab91e767950 76
1050186 18:0ab91e767950 77 "cNMTgxMjEzMDMwNTI5WhcNMTgxMjMxMDYwMDAwWjCBoTFSMFAGA1UEAxNJYzA0N\r\n"
1050186 18:0ab91e767950 78
1050186 18:0ab91e767950 79 "GJhNGUtMWE5YS00NTkzLWIwYjAtODdmNWQ1YjQ0NjUyLzhlOTk5NGQwLWQyMzgt\r\n"
1050186 18:0ab91e767950 80
1050186 18:0ab91e767950 81 "NDZmMS1iOWNkLThkMmU3ZmNhYWE3NDEMMAoGA1UECxMDQVJNMRIwEAYDVQQKEwl\r\n"
1050186 18:0ab91e767950 82
1050186 18:0ab91e767950 83 "tYmVkIHVzZXIxDTALBgNVBAcTBE91bHUxDTALBgNVBAgTBE91bHUxCzAJBgNVBA\r\n"
1050186 18:0ab91e767950 84
1050186 18:0ab91e767950 85 "YTAkZJMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUefv5yVLBb6kbF3uqYNjh\r\n"
1050186 18:0ab91e767950 86
1050186 18:0ab91e767950 87 "tENq8G4i21rfrMgLck5KH5HJeM6TArBwK0SejzTicTmbx/1KETsEmv2KW6Ch56o\r\n"
1050186 18:0ab91e767950 88
1050186 18:0ab91e767950 89 "5TAMBggqhkjOPQQDAgUAA0gAMEUCIQCK/wtsEUiWRPj7xlYwK5OGDcirOVBts4d\r\n"
1050186 18:0ab91e767950 90
1050186 18:0ab91e767950 91 "TMb7JwWjTIgIgYurBY4WFr34r1oCCyk+7FBZyUQl8kDxGDyLklHY9FaI=\r\n"
1050186 18:0ab91e767950 92
<> 0:eb73febb2bba 93 "-----END CERTIFICATE-----\r\n";
1050186 18:0ab91e767950 94
<> 0:eb73febb2bba 95
1050186 18:0ab91e767950 96
<> 0:eb73febb2bba 97 const uint8_t KEY[] = "-----BEGIN PRIVATE KEY-----\r\n"
1050186 18:0ab91e767950 98
1050186 18:0ab91e767950 99 "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgWi3qeKOyj0BA3lLp\r\n"
1050186 18:0ab91e767950 100
1050186 18:0ab91e767950 101 "+tZW0YHZILbMiZ2RJBWOgw8FufOhRANCAARR5+/nJUsFvqRsXe6pg2OG0Q2rwbiL\r\n"
1050186 18:0ab91e767950 102
1050186 18:0ab91e767950 103 "bWt+syAtyTkofkcl4zpMCsHArRJ6PNOJxOZvH/UoROwSa/YpboKHnqjl\r\n"
1050186 18:0ab91e767950 104
<> 0:eb73febb2bba 105 "-----END PRIVATE KEY-----\r\n";
1050186 18:0ab91e767950 106
<> 0:eb73febb2bba 107
1050186 18:0ab91e767950 108
<> 0:eb73febb2bba 109 #endif //__SECURITY_H__