1

Committer:
group-STM32F031
Date:
Wed Mar 21 18:13:41 2018 +0000
Revision:
0:d193d40d4fa1
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
group-STM32F031 0:d193d40d4fa1 1 // ----------------------------------------------------------------------------
group-STM32F031 0:d193d40d4fa1 2 // Copyright 2016-2017 ARM Ltd.
group-STM32F031 0:d193d40d4fa1 3 //
group-STM32F031 0:d193d40d4fa1 4 // SPDX-License-Identifier: Apache-2.0
group-STM32F031 0:d193d40d4fa1 5 //
group-STM32F031 0:d193d40d4fa1 6 // Licensed under the Apache License, Version 2.0 (the "License");
group-STM32F031 0:d193d40d4fa1 7 // you may not use this file except in compliance with the License.
group-STM32F031 0:d193d40d4fa1 8 // You may obtain a copy of the License at
group-STM32F031 0:d193d40d4fa1 9 //
group-STM32F031 0:d193d40d4fa1 10 // http://www.apache.org/licenses/LICENSE-2.0
group-STM32F031 0:d193d40d4fa1 11 //
group-STM32F031 0:d193d40d4fa1 12 // Unless required by applicable law or agreed to in writing, software
group-STM32F031 0:d193d40d4fa1 13 // distributed under the License is distributed on an "AS IS" BASIS,
group-STM32F031 0:d193d40d4fa1 14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
group-STM32F031 0:d193d40d4fa1 15 // See the License for the specific language governing permissions and
group-STM32F031 0:d193d40d4fa1 16 // limitations under the License.
group-STM32F031 0:d193d40d4fa1 17 // ----------------------------------------------------------------------------
group-STM32F031 0:d193d40d4fa1 18
group-STM32F031 0:d193d40d4fa1 19
group-STM32F031 0:d193d40d4fa1 20 #ifndef RESOURCE_H
group-STM32F031 0:d193d40d4fa1 21 #define RESOURCE_H
group-STM32F031 0:d193d40d4fa1 22
group-STM32F031 0:d193d40d4fa1 23
group-STM32F031 0:d193d40d4fa1 24 /**
group-STM32F031 0:d193d40d4fa1 25 * \brief Helper function for creating different kind of resources.
group-STM32F031 0:d193d40d4fa1 26 * The path of the resource will be "object_id/instance_id/resource_id"
group-STM32F031 0:d193d40d4fa1 27 * For example if object_id = 1, instance_id = 2, resource_id = 3
group-STM32F031 0:d193d40d4fa1 28 * the path would be 1/2/3
group-STM32F031 0:d193d40d4fa1 29 *
group-STM32F031 0:d193d40d4fa1 30 * \param list Pointer to the object list,
group-STM32F031 0:d193d40d4fa1 31 * contains objects to be registered to the server.
group-STM32F031 0:d193d40d4fa1 32 * \param object_id Name of the object in integer format.
group-STM32F031 0:d193d40d4fa1 33 * \param instance_id Name of the instance in integer format.
group-STM32F031 0:d193d40d4fa1 34 * \param resource_id Name of the resource in integer format.
group-STM32F031 0:d193d40d4fa1 35 * \param resource_type Resource type name.
group-STM32F031 0:d193d40d4fa1 36 * \param data_type Data type of the resource value.
group-STM32F031 0:d193d40d4fa1 37 * \param allowed Methods allowed for accessing this resource.
group-STM32F031 0:d193d40d4fa1 38 * \param value Resource value as a null terminated string.
group-STM32F031 0:d193d40d4fa1 39 * May be set as NULL.
group-STM32F031 0:d193d40d4fa1 40 * \param observable Resource set observable if true.
group-STM32F031 0:d193d40d4fa1 41 * \param cb Function pointer to either:
group-STM32F031 0:d193d40d4fa1 42 * value_updated_callback2 if allowed & GET_PUT_ALLOWED
group-STM32F031 0:d193d40d4fa1 43 * OR
group-STM32F031 0:d193d40d4fa1 44 * execute_callback_2 in if allowed & POST_ALLOWED.
group-STM32F031 0:d193d40d4fa1 45 * In other cases this parameter is ignored.
group-STM32F031 0:d193d40d4fa1 46 *
group-STM32F031 0:d193d40d4fa1 47 * NOTE: This function is not designed to support setting both
group-STM32F031 0:d193d40d4fa1 48 * GET_PUT_ALLOWED and POST_ALLOWED for parameter allowed
group-STM32F031 0:d193d40d4fa1 49 * at the same time.
group-STM32F031 0:d193d40d4fa1 50 * \param notification_status_cb Function pointer to notification_delivery_status_cb
group-STM32F031 0:d193d40d4fa1 51 * if resource is set to be observable.
group-STM32F031 0:d193d40d4fa1 52 */
group-STM32F031 0:d193d40d4fa1 53 M2MResource* add_resource(M2MObjectList *list,
group-STM32F031 0:d193d40d4fa1 54 uint16_t object_id,
group-STM32F031 0:d193d40d4fa1 55 uint16_t instance_id,
group-STM32F031 0:d193d40d4fa1 56 uint16_t resource_id,
group-STM32F031 0:d193d40d4fa1 57 const char *resource_type,
group-STM32F031 0:d193d40d4fa1 58 M2MResourceInstance::ResourceType data_type,
group-STM32F031 0:d193d40d4fa1 59 M2MBase::Operation allowed,
group-STM32F031 0:d193d40d4fa1 60 const char *value,
group-STM32F031 0:d193d40d4fa1 61 bool observable,
group-STM32F031 0:d193d40d4fa1 62 void *cb,
group-STM32F031 0:d193d40d4fa1 63 void *notification_status_cb);
group-STM32F031 0:d193d40d4fa1 64
group-STM32F031 0:d193d40d4fa1 65 #endif //RESOURCE_H