leo hendrickson / Mbed OS example-Ethernet-mbed-Cloud-connect
Committer:
leothedragon
Date:
Tue May 04 08:55:12 2021 +0000
Revision:
0:8f0bb79ddd48
nmn

Who changed what in which revision?

UserRevisionLine numberNew contents of line
leothedragon 0:8f0bb79ddd48 1 // ----------------------------------------------------------------------------
leothedragon 0:8f0bb79ddd48 2 // Copyright 2018 ARM Ltd.
leothedragon 0:8f0bb79ddd48 3 //
leothedragon 0:8f0bb79ddd48 4 // Licensed under the Apache License, Version 2.0 (the "License");
leothedragon 0:8f0bb79ddd48 5 // you may not use this file except in compliance with the License.
leothedragon 0:8f0bb79ddd48 6 // You may obtain a copy of the License at
leothedragon 0:8f0bb79ddd48 7 //
leothedragon 0:8f0bb79ddd48 8 // http://www.apache.org/licenses/LICENSE-2.0
leothedragon 0:8f0bb79ddd48 9 //
leothedragon 0:8f0bb79ddd48 10 // Unless required by applicable law or agreed to in writing, software
leothedragon 0:8f0bb79ddd48 11 // distributed under the License is distributed on an "AS IS" BASIS,
leothedragon 0:8f0bb79ddd48 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
leothedragon 0:8f0bb79ddd48 13 // See the License for the specific language governing permissions and
leothedragon 0:8f0bb79ddd48 14 // limitations under the License.
leothedragon 0:8f0bb79ddd48 15 // ----------------------------------------------------------------------------
leothedragon 0:8f0bb79ddd48 16
leothedragon 0:8f0bb79ddd48 17 #ifndef __CERTIFICATE_ENROLLMENT_COMMON_H__
leothedragon 0:8f0bb79ddd48 18 #define __CERTIFICATE_ENROLLMENT_COMMON_H__
leothedragon 0:8f0bb79ddd48 19
leothedragon 0:8f0bb79ddd48 20 #include "mbed-client/m2mresource.h"
leothedragon 0:8f0bb79ddd48 21 #include "ce_defs.h"
leothedragon 0:8f0bb79ddd48 22 #include "CertificateEnrollmentClient.h"
leothedragon 0:8f0bb79ddd48 23 #include "EstClient.h"
leothedragon 0:8f0bb79ddd48 24
leothedragon 0:8f0bb79ddd48 25 #ifdef CERT_ENROLLMENT_EST_MOCK
leothedragon 0:8f0bb79ddd48 26 #include "ce_est_mock.h"
leothedragon 0:8f0bb79ddd48 27 #define CERT_ENROLLMENT_EST_CLIENT EstClientMock
leothedragon 0:8f0bb79ddd48 28 #else
leothedragon 0:8f0bb79ddd48 29 #define CERT_ENROLLMENT_EST_CLIENT EstClient
leothedragon 0:8f0bb79ddd48 30 #endif
leothedragon 0:8f0bb79ddd48 31
leothedragon 0:8f0bb79ddd48 32 /*
leothedragon 0:8f0bb79ddd48 33 * This file declares common functions, and extern's common global variables needed by multiple C++ CertificateEnrollmentClient files.
leothedragon 0:8f0bb79ddd48 34 * The definitions are in CertificateEnrollmentClientCommon.cpp
leothedragon 0:8f0bb79ddd48 35 */
leothedragon 0:8f0bb79ddd48 36
leothedragon 0:8f0bb79ddd48 37 namespace CertificateEnrollmentClient {
leothedragon 0:8f0bb79ddd48 38
leothedragon 0:8f0bb79ddd48 39 /**
leothedragon 0:8f0bb79ddd48 40 * \brief Call the user registered certificate renewal callback if it is not NULL
leothedragon 0:8f0bb79ddd48 41 * All calls to the user must be with this function so that if the callback is NULL - do nothing.
leothedragon 0:8f0bb79ddd48 42 * The event will have an application level priority
leothedragon 0:8f0bb79ddd48 43 * \param cert_name A null terminated string - the renewed certificate name. Persistence guaranteed only in context of the callback.
leothedragon 0:8f0bb79ddd48 44 * \param ce_status_e The return status of the renewal operation
leothedragon 0:8f0bb79ddd48 45 * \param initiator whether the renewal was initiated by the device or by the server
leothedragon 0:8f0bb79ddd48 46 */
leothedragon 0:8f0bb79ddd48 47 void call_user_cert_renewal_cb(const char *cert_name, ce_status_e status, ce_initiator_e initiator);
leothedragon 0:8f0bb79ddd48 48
leothedragon 0:8f0bb79ddd48 49 /**
leothedragon 0:8f0bb79ddd48 50 * \brief Set the user callback
leothedragon 0:8f0bb79ddd48 51 * Simply set the cert_renewal_cb static pointer to whatever the user passed.
leothedragon 0:8f0bb79ddd48 52 *
leothedragon 0:8f0bb79ddd48 53 * \param user_cb Pointer to the user callback. May be NULL
leothedragon 0:8f0bb79ddd48 54 */
leothedragon 0:8f0bb79ddd48 55 void set_user_cert_renewal_cb(cert_renewal_cb_f user_cb);
leothedragon 0:8f0bb79ddd48 56
leothedragon 0:8f0bb79ddd48 57 // The certificate renewal LwM2M resource. the pointer to this object is needed in order to set the resource value and set delayed responses.
leothedragon 0:8f0bb79ddd48 58 extern M2MResource* g_cert_enroll_lwm2m_resource;
leothedragon 0:8f0bb79ddd48 59 extern M2MObject *g_cert_enroll_lwm2m_obj;
leothedragon 0:8f0bb79ddd48 60
leothedragon 0:8f0bb79ddd48 61 }
leothedragon 0:8f0bb79ddd48 62
leothedragon 0:8f0bb79ddd48 63 #endif // __CERTIFICATE_ENROLLMENT_COMMON_H__