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

« Back to documentation index

Show/hide line numbers m2mserver_stub.cpp Source File

m2mserver_stub.cpp

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 #include "m2mserver_stub.h"
00017 
00018 uint32_t m2mserver_stub::int_value;
00019 bool m2mserver_stub::bool_value;
00020 M2MResource* m2mserver_stub::resource;
00021 
00022 void m2mserver_stub::clear()
00023 {
00024     int_value = 0;
00025     bool_value = false;
00026     resource = NULL;
00027 }
00028 
00029 M2MServer::M2MServer()
00030 : M2MObject("1", "1")
00031 {
00032 }
00033 
00034 M2MServer::~M2MServer()
00035 {
00036 }
00037 
00038 M2MResource* M2MServer::create_resource(ServerResource, uint32_t)
00039 {
00040     return m2mserver_stub::resource;
00041 }
00042 
00043 M2MResource* M2MServer::create_resource(ServerResource)
00044 {
00045     return m2mserver_stub::resource;
00046 }
00047 
00048 bool M2MServer::delete_resource(ServerResource)
00049 {
00050     return m2mserver_stub::bool_value;
00051 }
00052 
00053 bool M2MServer::set_resource_value(ServerResource,
00054                                    const String &)
00055 {
00056     return m2mserver_stub::bool_value;
00057 }
00058 
00059 bool M2MServer::set_resource_value(ServerResource,
00060                                    uint32_t)
00061 {
00062     return m2mserver_stub::bool_value;
00063 }
00064 
00065 String M2MServer::resource_value_string(ServerResource) const
00066 {
00067     return String("");
00068 }
00069 
00070 
00071 uint32_t M2MServer::resource_value_int(ServerResource) const
00072 {
00073     return m2mserver_stub::int_value;
00074 }
00075 
00076 bool M2MServer::is_resource_present(ServerResource) const
00077 {
00078     return m2mserver_stub::bool_value;
00079 }
00080 
00081 uint16_t M2MServer::total_resource_count() const
00082 {
00083     return (uint16_t)m2mserver_stub::int_value;
00084 }