Ram Gandikota / Mbed OS ABCD
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers m2mbase_stub.h Source File

m2mbase_stub.h

00001 /*
00002  * Copyright (c) 2015 ARM Limited. All rights reserved.
00003  * SPDX-License-Identifier: Apache-2.0
00004  * Licensed under the Apache License, Version 2.0 (the License); you may
00005  * not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  * http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
00012  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 #ifndef M2M_BASE_STUB_H
00017 #define M2M_BASE_STUB_H
00018 
00019 #include "m2mbase.h"
00020 #include "nsdlaccesshelper_stub.h"
00021 static sn_nsdl_static_resource_parameters_s params_static = {
00022     (char*)"",      // resource_type_ptr
00023     (char*)"",                     // interface_description_ptr
00024     (uint8_t*)"",    // path
00025     (uint8_t*)"value",           // resource
00026     0,                      // pathlen
00027     5,                      // resourcelen
00028     false,                  // external_memory_block
00029     SN_GRS_DYNAMIC,         // mode
00030     false                   // free_on_delete
00031 };
00032 
00033 static sn_nsdl_dynamic_resource_parameters_s params_dynamic = {
00034     __nsdl_c_callback,
00035     &params_static,
00036     {NULL, NULL},                     // link
00037     0, // coap_content_type
00038     M2MBase::PUT_ALLOWED,   // access
00039     0,                      // registered
00040     false,                  // publish_uri
00041     false,                  // free_on_delete
00042     true                    // observable
00043 };
00044 
00045 const static M2MBase::lwm2m_parameters params = {
00046     0, // max_age
00047     1, // instance_id
00048     0, // name_id
00049     (char*)"", // name
00050     &params_dynamic,
00051     M2MBase::Resource, // base_type
00052     false // free_on_delete
00053 };
00054 
00055 //some internal test related stuff
00056 namespace m2mbase_stub
00057 {
00058     extern uint8_t uint8_value;
00059     extern uint16_t uint16_value;
00060     extern uint32_t uint32_value;
00061     extern uint16_t int_value;
00062     extern int32_t name_id_value;
00063     extern const char *string_value;
00064     extern const char *object_instance_name;
00065     extern const char *resource_name;
00066     extern const char *resource_name_inst;
00067     extern bool bool_value;
00068     extern M2MBase::BaseType base_type;
00069     extern M2MBase::Mode mode_value;
00070     extern M2MBase::Operation operation;
00071     extern void *void_value;
00072     extern M2MObservationHandler *observe;
00073     extern M2MReportHandler *report;
00074     extern M2MBase::Observation observation_level_value;
00075     extern bool is_value_updated_function_set;
00076     void clear();
00077     extern uint8_t* object_token;
00078     extern uint32_t object_token_len;
00079     extern uint8_t* resource_token;
00080     extern uint32_t resource_token_len;
00081     extern uint8_t* object_inst_token;
00082     extern uint32_t object_inst_token_len;
00083     extern sn_nsdl_dynamic_resource_parameters_s *nsdl_resource;
00084     extern bool find_resource;
00085     extern int32_t ret_counter;
00086 }
00087 
00088 #endif // M2M_BASE_STUB_H
00089