A library that simplifies interactions with the IBM Internet of Things Foundation

Dependencies:   MQTT

Dependents:   IBMIoTClientLibrarySamplefinal IBMWIoTPSecureClientSample IBMIoTClientLibrarySample

Introduction

Use the mBed C++ client library to easily connect mBed devices, such as LPC1768 or FRDM-K64F, to the IBM Watson™ IoT Platform service.

Although the library uses C++, it still avoids dynamic memory allocations and the use of STL functions, because the mBed devices sometimes have idiosyncratic memory models that make porting difficult. In any case, the library allows you to make memory use as predictable as possible.

Dependencies

DependencyDescription
Eclipse Paho MQTT libraryProvides an MQTT client library for mBed devices. For more information, see Embedded MQTT C/C++ client libraries
mbed-osARM mbed OS

How to use the library

Use the mBed compiler to create your applications when you use the mBed C++ IBMIoTF client library. The mBed compiler provides a lightweight online C/C++ IDE that is configured for writing, compiling, and downloading programs to run on your mBed microcontroller.

Note: You don't have to install or set up anything to get running with mBed.

For information on how to connect an ARM mBed NXP LPC 1768 microcontroller to the Watson IoT Platform, see the mBed C++ client library for IBM Watson IoT Platform recipe.

Supported Features

FeatureSupported?
Device connectivityYes
Event publishYes
Command receiptYes
SSL/TLSYes
Device ManagementNo

License

This library is shipped under License Eclipse Public License - v 1.0 and Eclipse Distribution License v1.0

For more information about the Eclipse Public License - v 1.0, refer this page. Also, for more information about the Eclipse Distribution License v1.0, refer this page.

Contributor License Agreement

Version 1.0.0 January 14, 2014

In order for You (as defined below) to make intellectual property Contributions (as defined below) now or in the future to IBM repositories, You must agree to this Contributor License Agreement ("CLA").

Please read this CLA carefully before accepting its terms. By accepting the CLA, You are agreeing to be bound by its terms. If You submit a Pull Request against this repository You must include in the Pull Request a statement of Your acceptance of this CLA.

As used in this CLA: (i) "You" (or "Your") shall mean the entity that is making this Agreement with IBM; (ii)"Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is submitted by You to IBM for inclusion in, or documentation of, any of the IBM repositories; (iii) "Submit" (or "Submitted") means any form of communication sent to IBM (e.g. the content You post in the Issue or submit as part of a Pull Request).

This agreement applies to all Contributions You Submit.

This CLA, and the license(s) associated with the particular IBM repositories You are contributing to, provides a license to Your Contributions to IBM and downstream consumers, but You still own Your Contributions, and except for the licenses provided for in this CLA, You reserve all right, title and interest in Your Contributions.

IBM requires that each Contribution You Submit now or in the future comply with the following four commitments.

1) You will only Submit Contributions where You have authored 100% of the content. 2) You will only Submit Contributions to which You have the necessary rights. This means that if You are employed You have received the necessary permissions from Your employer to make the Contributions. 3) Whatever content You Contribute will be provided under the license(s) associated with the particular IBM repository You are contributing to. 4) You understand and agree that IBM repositories and Your contributions are public, and that a record of the contribution (including all personal information You submit with it) is maintained indefinitely and may be redistributed consistent with the license(s) involved. You will promptly notify the Eclipse Foundation if You become aware of any facts or circumstances that would make these commitments inaccurate in any way. To do so, please create an Issue in the appropriate repository.

Committer:
lokeshhk
Date:
Tue May 30 06:36:04 2017 +0000
Revision:
6:5f037f24ce29
Parent:
5:ea9f483e0294
Added mbed-os and mqtt dependencies for the library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lokeshhk 5:ea9f483e0294 1 /*******************************************************************************
lokeshhk 5:ea9f483e0294 2 * Copyright (c) 2017 IBM Corp.
lokeshhk 5:ea9f483e0294 3 *
lokeshhk 5:ea9f483e0294 4 * All rights reserved. This program and the accompanying materials
lokeshhk 5:ea9f483e0294 5 * are made available under the terms of the Eclipse Public License v1.0
lokeshhk 5:ea9f483e0294 6 * and Eclipse Distribution License v1.0 which accompany this distribution.
lokeshhk 5:ea9f483e0294 7 *
lokeshhk 5:ea9f483e0294 8 * The Eclipse Public License is available at
lokeshhk 5:ea9f483e0294 9 * http://www.eclipse.org/legal/epl-v10.html
lokeshhk 5:ea9f483e0294 10 * and the Eclipse Distribution License is available at
lokeshhk 5:ea9f483e0294 11 * http://www.eclipse.org/org/documents/edl-v10.php.
lokeshhk 5:ea9f483e0294 12 *
lokeshhk 5:ea9f483e0294 13 * Contributors:
lokeshhk 5:ea9f483e0294 14 * Lokesh K Haralakatta Added default server certificate
lokeshhk 5:ea9f483e0294 15 *******************************************************************************/
lokeshhk 5:ea9f483e0294 16 #ifndef Certificates_H
lokeshhk 5:ea9f483e0294 17 #define Certificates_H
lokeshhk 5:ea9f483e0294 18
lokeshhk 5:ea9f483e0294 19 namespace IoTF {
lokeshhk 5:ea9f483e0294 20 //mbedTLS Client Name
lokeshhk 5:ea9f483e0294 21 const char tlsClientName[] = "mbed TLS mqtt client";
lokeshhk 5:ea9f483e0294 22
lokeshhk 5:ea9f483e0294 23 //Server Certificate Contents
lokeshhk 5:ea9f483e0294 24 const char serverCert[] = "-----BEGIN CERTIFICATE-----\n"
lokeshhk 5:ea9f483e0294 25 "MIIFqzCCBJOgAwIBAgIQCxjQE+z7NGL2+H7H3H33EDANBgkqhkiG9w0BAQsFADBN\n"
lokeshhk 5:ea9f483e0294 26 "MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E\n"
lokeshhk 5:ea9f483e0294 27 "aWdpQ2VydCBTSEEyIFNlY3VyZSBTZXJ2ZXIgQ0EwHhcNMTQwOTIyMDAwMDAwWhcN\n"
lokeshhk 5:ea9f483e0294 28 "MTcxMTI5MTIwMDAwWjCBwjELMAkGA1UEBhMCR0IxEjAQBgNVBAgTCUhhbXBzaGly\n"
lokeshhk 5:ea9f483e0294 29 "ZTETMBEGA1UEBxMKV2luY2hlc3RlcjEuMCwGA1UEChMlSW50ZXJuYXRpb25hbCBC\n"
lokeshhk 5:ea9f483e0294 30 "dXNpbmVzcyBNYWNoaW5lcyBDb3JwLjEmMCQGA1UECxMdSW50ZXJuZXQgb2YgVGhp\n"
lokeshhk 5:ea9f483e0294 31 "bmdzIEZvdW5kYXRpb24xMjAwBgNVBAMMKSoubWVzc2FnaW5nLmludGVybmV0b2Z0\n"
lokeshhk 5:ea9f483e0294 32 "aGluZ3MuaWJtY2xvdWQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\n"
lokeshhk 5:ea9f483e0294 33 "AQEAtkFprFEGn/3D4PpShvthi1RySonpvPL5S6/33rP9HH+pZRThnTRd9kTQWGQr\n"
lokeshhk 5:ea9f483e0294 34 "zS+bpGKwqIX6G+FixY1G08CDa+/JejLT1BiGAXCYY54/OCg7WvBr8feZ9mnK9GtB\n"
lokeshhk 5:ea9f483e0294 35 "XArF0u2TPdFTObXlE9ZBj5BDx9+5CS3Y0Grc9/Yg7S19JulhH37ZRxj1K0iCLJnU\n"
lokeshhk 5:ea9f483e0294 36 "NWuDwmXtCAvv/nMQ00upmNX4po+Jfo17bqmyGrvZWdJpFquWQlC2lzUkQ3clzc9k\n"
lokeshhk 5:ea9f483e0294 37 "wfu/mfHdgS55IloU4CwF+9nAkBSDhX8YQeJmZf3KDMIXoAhplrpAid221QNDKEfT\n"
lokeshhk 5:ea9f483e0294 38 "oE5ZGJcN9zhdrb+ZFInu7w66eQIDAQABo4ICDzCCAgswHwYDVR0jBBgwFoAUD4Bh\n"
lokeshhk 5:ea9f483e0294 39 "HIIxYdUvKOeNRji0LOHG2eIwHQYDVR0OBBYEFF6uJ2Mig7JY8gVIz2+cxymckEho\n"
lokeshhk 5:ea9f483e0294 40 "MF0GA1UdEQRWMFSCKSoubWVzc2FnaW5nLmludGVybmV0b2Z0aGluZ3MuaWJtY2xv\n"
lokeshhk 5:ea9f483e0294 41 "dWQuY29tgidtZXNzYWdpbmcuaW50ZXJuZXRvZnRoaW5ncy5pYm1jbG91ZC5jb20w\n"
lokeshhk 5:ea9f483e0294 42 "DgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBr\n"
lokeshhk 5:ea9f483e0294 43 "BgNVHR8EZDBiMC+gLaArhilodHRwOi8vY3JsMy5kaWdpY2VydC5jb20vc3NjYS1z\n"
lokeshhk 5:ea9f483e0294 44 "aGEyLWcyLmNybDAvoC2gK4YpaHR0cDovL2NybDQuZGlnaWNlcnQuY29tL3NzY2Et\n"
lokeshhk 5:ea9f483e0294 45 "c2hhMi1nMi5jcmwwQgYDVR0gBDswOTA3BglghkgBhv1sAQEwKjAoBggrBgEFBQcC\n"
lokeshhk 5:ea9f483e0294 46 "ARYcaHR0cHM6Ly93d3cuZGlnaWNlcnQuY29tL0NQUzB8BggrBgEFBQcBAQRwMG4w\n"
lokeshhk 5:ea9f483e0294 47 "JAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBGBggrBgEFBQcw\n"
lokeshhk 5:ea9f483e0294 48 "AoY6aHR0cDovL2NhY2VydHMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0U0hBMlNlY3Vy\n"
lokeshhk 5:ea9f483e0294 49 "ZVNlcnZlckNBLmNydDAMBgNVHRMBAf8EAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQBE\n"
lokeshhk 5:ea9f483e0294 50 "sTL/E2gWP8nWd5wor5sJpVD4nAnTluR2fSqoBnTi4DlxY+5ujpHYSQIo8f8rp1Fr\n"
lokeshhk 5:ea9f483e0294 51 "ADzy63x3woCNZXtWf5fs1uAJUHi53HK5Y9UH6nFBv4qwnSUiH+8JE+xBWVGT6bl0\n"
lokeshhk 5:ea9f483e0294 52 "uM8miFZVo7r4Jpuc1I13B9oHqxtP2ayQDyMvtcENOv9JvqZk9TEvp7IJgdtmYE4d\n"
lokeshhk 5:ea9f483e0294 53 "BsbKsHRC0m3S1tfXac9cuKA1rND21buWis9nV0cEabwT5XM4YpSITVeIdII6kvZ8\n"
lokeshhk 5:ea9f483e0294 54 "SREOxEG3urjy2xU8RxDDiMTcAYjNwSNshfZPyY7TijFDl4ZXpioHuQ+N3NxtZKzg\n"
lokeshhk 5:ea9f483e0294 55 "51QXrsnRosOX+sa4iSXx\n"
lokeshhk 5:ea9f483e0294 56 "-----END CERTIFICATE-----\n"
lokeshhk 5:ea9f483e0294 57 "-----BEGIN CERTIFICATE-----\n"
lokeshhk 5:ea9f483e0294 58 "MIIElDCCA3ygAwIBAgIQAf2j627KdciIQ4tyS8+8kTANBgkqhkiG9w0BAQsFADBh\n"
lokeshhk 5:ea9f483e0294 59 "MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\n"
lokeshhk 5:ea9f483e0294 60 "d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\n"
lokeshhk 5:ea9f483e0294 61 "QTAeFw0xMzAzMDgxMjAwMDBaFw0yMzAzMDgxMjAwMDBaME0xCzAJBgNVBAYTAlVT\n"
lokeshhk 5:ea9f483e0294 62 "MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxJzAlBgNVBAMTHkRpZ2lDZXJ0IFNIQTIg\n"
lokeshhk 5:ea9f483e0294 63 "U2VjdXJlIFNlcnZlciBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\n"
lokeshhk 5:ea9f483e0294 64 "ANyuWJBNwcQwFZA1W248ghX1LFy949v/cUP6ZCWA1O4Yok3wZtAKc24RmDYXZK83\n"
lokeshhk 5:ea9f483e0294 65 "nf36QYSvx6+M/hpzTc8zl5CilodTgyu5pnVILR1WN3vaMTIa16yrBvSqXUu3R0bd\n"
lokeshhk 5:ea9f483e0294 66 "KpPDkC55gIDvEwRqFDu1m5K+wgdlTvza/P96rtxcflUxDOg5B6TXvi/TC2rSsd9f\n"
lokeshhk 5:ea9f483e0294 67 "/ld0Uzs1gN2ujkSYs58O09rg1/RrKatEp0tYhG2SS4HD2nOLEpdIkARFdRrdNzGX\n"
lokeshhk 5:ea9f483e0294 68 "kujNVA075ME/OV4uuPNcfhCOhkEAjUVmR7ChZc6gqikJTvOX6+guqw9ypzAO+sf0\n"
lokeshhk 5:ea9f483e0294 69 "/RR3w6RbKFfCs/mC/bdFWJsCAwEAAaOCAVowggFWMBIGA1UdEwEB/wQIMAYBAf8C\n"
lokeshhk 5:ea9f483e0294 70 "AQAwDgYDVR0PAQH/BAQDAgGGMDQGCCsGAQUF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82 "j6tJLp07kzQoH3jOlOrHvdPJbRzeXDLz\n"
lokeshhk 5:ea9f483e0294 83 "-----END CERTIFICATE-----\n"
lokeshhk 5:ea9f483e0294 84 "-----BEGIN CERTIFICATE-----\n"
lokeshhk 5:ea9f483e0294 85 "MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\n"
lokeshhk 5:ea9f483e0294 86 "MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\n"
lokeshhk 5:ea9f483e0294 87 "d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\n"
lokeshhk 5:ea9f483e0294 88 "QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT\n"
lokeshhk 5:ea9f483e0294 89 "MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\n"
lokeshhk 5:ea9f483e0294 90 "b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG\n"
lokeshhk 5:ea9f483e0294 91 "9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB\n"
lokeshhk 5:ea9f483e0294 92 "CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97\n"
lokeshhk 5:ea9f483e0294 93 "nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt\n"
lokeshhk 5:ea9f483e0294 94 "43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P\n"
lokeshhk 5:ea9f483e0294 95 "T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4\n"
lokeshhk 5:ea9f483e0294 96 "gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO\n"
lokeshhk 5:ea9f483e0294 97 "BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR\n"
lokeshhk 5:ea9f483e0294 98 "TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw\n"
lokeshhk 5:ea9f483e0294 99 "DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr\n"
lokeshhk 5:ea9f483e0294 100 "hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\n"
lokeshhk 5:ea9f483e0294 101 "06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\n"
lokeshhk 5:ea9f483e0294 102 "PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\n"
lokeshhk 5:ea9f483e0294 103 "YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\n"
lokeshhk 5:ea9f483e0294 104 "CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n"
lokeshhk 5:ea9f483e0294 105 "-----END CERTIFICATE-----\n";
lokeshhk 5:ea9f483e0294 106
lokeshhk 5:ea9f483e0294 107 };
lokeshhk 5:ea9f483e0294 108
lokeshhk 5:ea9f483e0294 109 #endif