Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MAX44000 PWM_Tone_Library nexpaq_mdk
Fork of LED_Demo by
mbedclient.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 __MBED_CLIENT_H__ 00017 #define __MBED_CLIENT_H__ 00018 00019 #undef SIXLOWPAN_INTERFACE 00020 00021 #include "mbed-client/m2minterfaceobserver.h" 00022 00023 #ifndef TARGET_LIKE_LINUX 00024 #include "mbed/DigitalOut.h" 00025 #endif 00026 00027 00028 //#define BOOTSTRAP_ENABLED 00029 00030 class M2MDevice; 00031 class M2MSecurity; 00032 class M2MObject; 00033 00034 class MbedClient: public M2MInterfaceObserver { 00035 public: 00036 MbedClient(); 00037 00038 ~MbedClient(); 00039 00040 bool create_interface(); 00041 00042 bool bootstrap_successful(); 00043 00044 bool register_successful(); 00045 00046 bool unregister_successful(); 00047 00048 bool registration_update_successful(); 00049 00050 M2MSecurity* create_bootstrap_object(bool useSecureConnection); 00051 00052 M2MSecurity* create_register_object(bool useSecureConnection); 00053 00054 void test_bootstrap(M2MSecurity *security); 00055 00056 M2MDevice* create_device_object(); 00057 00058 void execute_function(void *argument); 00059 00060 M2MObject* create_generic_object(); 00061 00062 void update_resource(); 00063 00064 void test_register(M2MObjectList object_list); 00065 00066 void set_register_object(M2MSecurity *®ister_object); 00067 00068 void test_update_register(); 00069 00070 void test_unregister(); 00071 00072 //Callback from mbed client stack when the bootstrap 00073 // is successful, it returns the mbed Device Server object 00074 // which will be used for registering the resources to 00075 // mbed Device server. 00076 void bootstrap_done(M2MSecurity *server_object); 00077 00078 //Callback from mbed client stack when the registration 00079 // is successful, it returns the mbed Device Server object 00080 // to which the resources are registered and registered objects. 00081 void object_registered(M2MSecurity */*security_object*/, const M2MServer &/*server_object*/); 00082 00083 //Callback from mbed client stack when the unregistration 00084 // is successful, it returns the mbed Device Server object 00085 // to which the resources were unregistered. 00086 void object_unregistered(M2MSecurity */*server_object*/); 00087 00088 void registration_updated(M2MSecurity */*security_object*/, const M2MServer & /*server_object*/); 00089 00090 //Callback from mbed client stack if any error is encountered 00091 // during any of the LWM2M operations. Error type is passed in 00092 // the callback. 00093 void error(M2MInterface::Error error); 00094 00095 //Callback from mbed client stack if any value has changed 00096 // during PUT operation. Object and its type is passed in 00097 // the callback. 00098 void value_updated(M2MBase *base, M2MBase::BaseType type); 00099 00100 private: 00101 00102 #ifndef TARGET_LIKE_LINUX 00103 mbed::DigitalOut _led; 00104 #endif 00105 M2MInterface *_interface; 00106 M2MSecurity *_security; 00107 M2MSecurity *_register_security; 00108 M2MDevice *_device; 00109 M2MObject *_object; 00110 bool _bootstrapped; 00111 bool _error; 00112 bool _registered; 00113 bool _unregistered; 00114 bool _registration_updated; 00115 int _value; 00116 }; 00117 00118 00119 00120 #endif //__MBED_CLIENT_H__
Generated on Tue Jul 12 2022 12:28:43 by
