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 2016-2017 ARM Ltd.
leothedragon 0:8f0bb79ddd48 3 //
leothedragon 0:8f0bb79ddd48 4 // SPDX-License-Identifier: Apache-2.0
leothedragon 0:8f0bb79ddd48 5 //
leothedragon 0:8f0bb79ddd48 6 // Licensed under the Apache License, Version 2.0 (the "License");
leothedragon 0:8f0bb79ddd48 7 // you may not use this file except in compliance with the License.
leothedragon 0:8f0bb79ddd48 8 // You may obtain a copy of the License at
leothedragon 0:8f0bb79ddd48 9 //
leothedragon 0:8f0bb79ddd48 10 // http://www.apache.org/licenses/LICENSE-2.0
leothedragon 0:8f0bb79ddd48 11 //
leothedragon 0:8f0bb79ddd48 12 // Unless required by applicable law or agreed to in writing, software
leothedragon 0:8f0bb79ddd48 13 // distributed under the License is distributed on an "AS IS" BASIS,
leothedragon 0:8f0bb79ddd48 14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
leothedragon 0:8f0bb79ddd48 15 // See the License for the specific language governing permissions and
leothedragon 0:8f0bb79ddd48 16 // limitations under the License.
leothedragon 0:8f0bb79ddd48 17 // ----------------------------------------------------------------------------
leothedragon 0:8f0bb79ddd48 18
leothedragon 0:8f0bb79ddd48 19 #ifndef __ARM_UCS_FIRMWARE_UPDATE_RESOURCE_H__
leothedragon 0:8f0bb79ddd48 20 #define __ARM_UCS_FIRMWARE_UPDATE_RESOURCE_H__
leothedragon 0:8f0bb79ddd48 21
leothedragon 0:8f0bb79ddd48 22 #include "mbed-client/m2minterfacefactory.h"
leothedragon 0:8f0bb79ddd48 23 #include "mbed-client/m2minterface.h"
leothedragon 0:8f0bb79ddd48 24 #include "mbed-client/m2mresource.h"
leothedragon 0:8f0bb79ddd48 25 #include "mbed-client/m2mobject.h"
leothedragon 0:8f0bb79ddd48 26 #include "update-client-common/arm_uc_config.h"
leothedragon 0:8f0bb79ddd48 27 #include "update-client-monitor/arm_uc_monitor.h"
leothedragon 0:8f0bb79ddd48 28
leothedragon 0:8f0bb79ddd48 29 namespace FirmwareUpdateResource {
leothedragon 0:8f0bb79ddd48 30
leothedragon 0:8f0bb79ddd48 31 // New enums based on http://www.openmobilealliance.org/tech/profiles/lwm2m/10252.xml
leothedragon 0:8f0bb79ddd48 32 typedef arm_uc_update_state_t arm_ucs_lwm2m_state_t;
leothedragon 0:8f0bb79ddd48 33 typedef arm_uc_update_result_t arm_ucs_lwm2m_result_t;
leothedragon 0:8f0bb79ddd48 34
leothedragon 0:8f0bb79ddd48 35 void Initialize(void);
leothedragon 0:8f0bb79ddd48 36 void Uninitialize(void);
leothedragon 0:8f0bb79ddd48 37
leothedragon 0:8f0bb79ddd48 38 M2MObject *getObject(void);
leothedragon 0:8f0bb79ddd48 39
leothedragon 0:8f0bb79ddd48 40 /* Add callback for resource /10252/0/1, Package */
leothedragon 0:8f0bb79ddd48 41 int32_t addPackageCallback(void (*cb)(const uint8_t *buffer, uint16_t length));
leothedragon 0:8f0bb79ddd48 42
leothedragon 0:8f0bb79ddd48 43 #if !defined(ARM_UC_PROFILE_MBED_CLIENT_LITE) || (ARM_UC_PROFILE_MBED_CLIENT_LITE == 0)
leothedragon 0:8f0bb79ddd48 44 /* Add callback for resource /5/0/2, Update */
leothedragon 0:8f0bb79ddd48 45 int32_t addUpdateCallback(void (*cb)(void));
leothedragon 0:8f0bb79ddd48 46 #endif
leothedragon 0:8f0bb79ddd48 47
leothedragon 0:8f0bb79ddd48 48 /* Add callback for when send{State, UpdateResult} is done */
leothedragon 0:8f0bb79ddd48 49 int32_t addNotificationCallback(void (*notification_handler)(void));
leothedragon 0:8f0bb79ddd48 50
leothedragon 0:8f0bb79ddd48 51 /* Send state for resource /10252/0/2, State */
leothedragon 0:8f0bb79ddd48 52 int32_t sendState(arm_ucs_lwm2m_state_t state);
leothedragon 0:8f0bb79ddd48 53
leothedragon 0:8f0bb79ddd48 54 /* Send result for resource /10252/0/3, Update Result */
leothedragon 0:8f0bb79ddd48 55 int32_t sendUpdateResult(arm_ucs_lwm2m_result_t result);
leothedragon 0:8f0bb79ddd48 56
leothedragon 0:8f0bb79ddd48 57 /* Send name for resource /10252/0/5, PkgName */
leothedragon 0:8f0bb79ddd48 58 int32_t sendPkgName(const uint8_t *name, uint16_t length);
leothedragon 0:8f0bb79ddd48 59
leothedragon 0:8f0bb79ddd48 60 /* Send version for resource /10252/0/6, PkgVersion */
leothedragon 0:8f0bb79ddd48 61 int32_t sendPkgVersion(uint64_t version);
leothedragon 0:8f0bb79ddd48 62
leothedragon 0:8f0bb79ddd48 63 #if defined(ARM_UC_FEATURE_FW_SOURCE_COAP) && (ARM_UC_FEATURE_FW_SOURCE_COAP == 1)
leothedragon 0:8f0bb79ddd48 64 int32_t setM2MInterface(M2MInterface *interface);
leothedragon 0:8f0bb79ddd48 65
leothedragon 0:8f0bb79ddd48 66 M2MInterface *getM2MInterface(void);
leothedragon 0:8f0bb79ddd48 67 #endif //ARM_UC_FEATURE_FW_SOURCE_COAP
leothedragon 0:8f0bb79ddd48 68 }
leothedragon 0:8f0bb79ddd48 69
leothedragon 0:8f0bb79ddd48 70 #endif // __ARM_UCS_FIRMWARE_UPDATE_RESOURCE_H__