![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
FRDM K64F Metronome
mbed-client/test/mbedclient/utest/stub/m2mbase_stub.h@0:dbad57390bd1, 2017-05-14 (annotated)
- Committer:
- ram54288
- Date:
- Sun May 14 18:37:05 2017 +0000
- Revision:
- 0:dbad57390bd1
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ram54288 | 0:dbad57390bd1 | 1 | /* |
ram54288 | 0:dbad57390bd1 | 2 | * Copyright (c) 2015 ARM Limited. All rights reserved. |
ram54288 | 0:dbad57390bd1 | 3 | * SPDX-License-Identifier: Apache-2.0 |
ram54288 | 0:dbad57390bd1 | 4 | * Licensed under the Apache License, Version 2.0 (the License); you may |
ram54288 | 0:dbad57390bd1 | 5 | * not use this file except in compliance with the License. |
ram54288 | 0:dbad57390bd1 | 6 | * You may obtain a copy of the License at |
ram54288 | 0:dbad57390bd1 | 7 | * |
ram54288 | 0:dbad57390bd1 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
ram54288 | 0:dbad57390bd1 | 9 | * |
ram54288 | 0:dbad57390bd1 | 10 | * Unless required by applicable law or agreed to in writing, software |
ram54288 | 0:dbad57390bd1 | 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
ram54288 | 0:dbad57390bd1 | 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
ram54288 | 0:dbad57390bd1 | 13 | * See the License for the specific language governing permissions and |
ram54288 | 0:dbad57390bd1 | 14 | * limitations under the License. |
ram54288 | 0:dbad57390bd1 | 15 | */ |
ram54288 | 0:dbad57390bd1 | 16 | #ifndef M2M_BASE_STUB_H |
ram54288 | 0:dbad57390bd1 | 17 | #define M2M_BASE_STUB_H |
ram54288 | 0:dbad57390bd1 | 18 | |
ram54288 | 0:dbad57390bd1 | 19 | #include "m2mbase.h" |
ram54288 | 0:dbad57390bd1 | 20 | #include "nsdlaccesshelper_stub.h" |
ram54288 | 0:dbad57390bd1 | 21 | static sn_nsdl_static_resource_parameters_s params_static = { |
ram54288 | 0:dbad57390bd1 | 22 | (char*)"", // resource_type_ptr |
ram54288 | 0:dbad57390bd1 | 23 | (char*)"", // interface_description_ptr |
ram54288 | 0:dbad57390bd1 | 24 | (uint8_t*)"", // path |
ram54288 | 0:dbad57390bd1 | 25 | (uint8_t*)"value", // resource |
ram54288 | 0:dbad57390bd1 | 26 | 0, // pathlen |
ram54288 | 0:dbad57390bd1 | 27 | 5, // resourcelen |
ram54288 | 0:dbad57390bd1 | 28 | false, // external_memory_block |
ram54288 | 0:dbad57390bd1 | 29 | SN_GRS_DYNAMIC, // mode |
ram54288 | 0:dbad57390bd1 | 30 | false // free_on_delete |
ram54288 | 0:dbad57390bd1 | 31 | }; |
ram54288 | 0:dbad57390bd1 | 32 | |
ram54288 | 0:dbad57390bd1 | 33 | static sn_nsdl_dynamic_resource_parameters_s params_dynamic = { |
ram54288 | 0:dbad57390bd1 | 34 | __nsdl_c_callback, |
ram54288 | 0:dbad57390bd1 | 35 | ¶ms_static, |
ram54288 | 0:dbad57390bd1 | 36 | {NULL, NULL}, // link |
ram54288 | 0:dbad57390bd1 | 37 | 0, // coap_content_type |
ram54288 | 0:dbad57390bd1 | 38 | M2MBase::PUT_ALLOWED, // access |
ram54288 | 0:dbad57390bd1 | 39 | 0, // registered |
ram54288 | 0:dbad57390bd1 | 40 | false, // publish_uri |
ram54288 | 0:dbad57390bd1 | 41 | false, // free_on_delete |
ram54288 | 0:dbad57390bd1 | 42 | true // observable |
ram54288 | 0:dbad57390bd1 | 43 | }; |
ram54288 | 0:dbad57390bd1 | 44 | |
ram54288 | 0:dbad57390bd1 | 45 | const static M2MBase::lwm2m_parameters params = { |
ram54288 | 0:dbad57390bd1 | 46 | 0, // max_age |
ram54288 | 0:dbad57390bd1 | 47 | 1, // instance_id |
ram54288 | 0:dbad57390bd1 | 48 | 0, // name_id |
ram54288 | 0:dbad57390bd1 | 49 | (char*)"", // name |
ram54288 | 0:dbad57390bd1 | 50 | ¶ms_dynamic, |
ram54288 | 0:dbad57390bd1 | 51 | M2MBase::Resource, // base_type |
ram54288 | 0:dbad57390bd1 | 52 | false // free_on_delete |
ram54288 | 0:dbad57390bd1 | 53 | }; |
ram54288 | 0:dbad57390bd1 | 54 | |
ram54288 | 0:dbad57390bd1 | 55 | //some internal test related stuff |
ram54288 | 0:dbad57390bd1 | 56 | namespace m2mbase_stub |
ram54288 | 0:dbad57390bd1 | 57 | { |
ram54288 | 0:dbad57390bd1 | 58 | extern uint8_t uint8_value; |
ram54288 | 0:dbad57390bd1 | 59 | extern uint16_t uint16_value; |
ram54288 | 0:dbad57390bd1 | 60 | extern uint32_t uint32_value; |
ram54288 | 0:dbad57390bd1 | 61 | extern uint16_t int_value; |
ram54288 | 0:dbad57390bd1 | 62 | extern int32_t name_id_value; |
ram54288 | 0:dbad57390bd1 | 63 | extern const char *string_value; |
ram54288 | 0:dbad57390bd1 | 64 | extern const char *object_instance_name; |
ram54288 | 0:dbad57390bd1 | 65 | extern const char *resource_name; |
ram54288 | 0:dbad57390bd1 | 66 | extern const char *resource_name_inst; |
ram54288 | 0:dbad57390bd1 | 67 | extern bool bool_value; |
ram54288 | 0:dbad57390bd1 | 68 | extern M2MBase::BaseType base_type; |
ram54288 | 0:dbad57390bd1 | 69 | extern M2MBase::Mode mode_value; |
ram54288 | 0:dbad57390bd1 | 70 | extern M2MBase::Operation operation; |
ram54288 | 0:dbad57390bd1 | 71 | extern void *void_value; |
ram54288 | 0:dbad57390bd1 | 72 | extern M2MObservationHandler *observe; |
ram54288 | 0:dbad57390bd1 | 73 | extern M2MReportHandler *report; |
ram54288 | 0:dbad57390bd1 | 74 | extern M2MBase::Observation observation_level_value; |
ram54288 | 0:dbad57390bd1 | 75 | extern bool is_value_updated_function_set; |
ram54288 | 0:dbad57390bd1 | 76 | void clear(); |
ram54288 | 0:dbad57390bd1 | 77 | extern uint8_t* object_token; |
ram54288 | 0:dbad57390bd1 | 78 | extern uint32_t object_token_len; |
ram54288 | 0:dbad57390bd1 | 79 | extern uint8_t* resource_token; |
ram54288 | 0:dbad57390bd1 | 80 | extern uint32_t resource_token_len; |
ram54288 | 0:dbad57390bd1 | 81 | extern uint8_t* object_inst_token; |
ram54288 | 0:dbad57390bd1 | 82 | extern uint32_t object_inst_token_len; |
ram54288 | 0:dbad57390bd1 | 83 | extern sn_nsdl_dynamic_resource_parameters_s *nsdl_resource; |
ram54288 | 0:dbad57390bd1 | 84 | extern bool find_resource; |
ram54288 | 0:dbad57390bd1 | 85 | extern int32_t ret_counter; |
ram54288 | 0:dbad57390bd1 | 86 | } |
ram54288 | 0:dbad57390bd1 | 87 | |
ram54288 | 0:dbad57390bd1 | 88 | #endif // M2M_BASE_STUB_H |
ram54288 | 0:dbad57390bd1 | 89 |