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.
Fork of mbed-client by
m2mconstants.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 M2MCONSTANTS_H 00017 #define M2MCONSTANTS_H 00018 00019 #include <stdint.h> 00020 #include "m2mconfig.h" 00021 00022 const int MAX_VALUE_LENGTH = 256; 00023 const int BUFFER_LENGTH = 1152; 00024 extern const String COAP; 00025 extern const String COAPS; 00026 const int32_t MINIMUM_REGISTRATION_TIME = 60; //in seconds 00027 const uint64_t ONE_SECOND_TIMER = 1; 00028 const uint16_t MAX_ALLOWED_STRING_LENGTH = 64; 00029 const uint16_t OPTIMUM_LIFETIME = 3600; 00030 const uint16_t REDUCE_LIFETIME = 900; 00031 const float REDUCTION_FACTOR = 0.75f; 00032 00033 const int RETRY_COUNT = 2; 00034 const int RETRY_INTERVAL = 5; 00035 00036 // values per: draft-ietf-core-observe-16 00037 // OMA LWM2M CR ref. 00038 #define START_OBSERVATION 0 00039 #define STOP_OBSERVATION 1 00040 00041 // PUT attributes to be checked from server 00042 extern const String EQUAL; 00043 extern const String AMP; 00044 extern const String PMIN; 00045 extern const String PMAX; 00046 extern const String GT; 00047 extern const String LT; 00048 extern const String ST; 00049 extern const String STP; 00050 extern const String CANCEL; 00051 00052 //LWM2MOBJECT NAME/ID 00053 extern const String M2M_SECURITY_ID; 00054 extern const String M2M_SERVER_ID; 00055 extern const String M2M_ACCESS_CONTROL_ID; 00056 extern const String M2M_DEVICE_ID; 00057 00058 extern const String M2M_CONNECTIVITY_MONITOR_ID; 00059 extern const String M2M_FIRMWARE_ID; 00060 extern const String M2M_LOCATION_ID; 00061 extern const String M2M_CONNECTIVITY_STATISTICS_ID; 00062 extern const String RESERVED_ID; 00063 00064 //OBJECT RESOURCE TYPE 00065 extern const String OMA_RESOURCE_TYPE; 00066 00067 //DEVICE RESOURCES 00068 extern const String DEVICE_MANUFACTURER; 00069 extern const String DEVICE_DEVICE_TYPE; 00070 extern const String DEVICE_MODEL_NUMBER; 00071 extern const String DEVICE_SERIAL_NUMBER; 00072 extern const String DEVICE_HARDWARE_VERSION; 00073 extern const String DEVICE_FIRMWARE_VERSION; 00074 extern const String DEVICE_SOFTWARE_VERSION; 00075 extern const String DEVICE_REBOOT; 00076 extern const String DEVICE_FACTORY_RESET; 00077 extern const String DEVICE_AVAILABLE_POWER_SOURCES; 00078 extern const String DEVICE_POWER_SOURCE_VOLTAGE; 00079 extern const String DEVICE_POWER_SOURCE_CURRENT; 00080 extern const String DEVICE_BATTERY_LEVEL; 00081 extern const String DEVICE_BATTERY_STATUS; 00082 extern const String DEVICE_MEMORY_FREE; 00083 extern const String DEVICE_MEMORY_TOTAL; 00084 extern const String DEVICE_ERROR_CODE; 00085 extern const String DEVICE_RESET_ERROR_CODE; 00086 extern const String DEVICE_CURRENT_TIME; 00087 extern const String DEVICE_UTC_OFFSET; 00088 extern const String DEVICE_TIMEZONE; 00089 extern const String DEVICE_SUPPORTED_BINDING_MODE; 00090 00091 extern const String BINDING_MODE_UDP; 00092 extern const String BINDING_MODE_UDP_QUEUE; 00093 extern const String BINDING_MODE_SMS; 00094 extern const String BINDING_MODE_SMS_QUEUE; 00095 00096 extern const String ERROR_CODE_VALUE; 00097 00098 00099 00100 //SECURITY RESOURCES 00101 extern const String SECURITY_M2M_SERVER_URI; 00102 extern const String SECURITY_BOOTSTRAP_SERVER; 00103 extern const String SECURITY_SECURITY_MODE; 00104 extern const String SECURITY_PUBLIC_KEY; 00105 extern const String SECURITY_SERVER_PUBLIC_KEY; 00106 extern const String SECURITY_SECRET_KEY; 00107 extern const String SECURITY_SMS_SECURITY_MODE; 00108 extern const String SECURITY_SMS_BINDING_KEY; 00109 extern const String SECURITY_SMS_BINDING_SECRET_KEY; 00110 extern const String SECURITY_M2M_SERVER_SMS_NUMBER; 00111 extern const String SECURITY_SHORT_SERVER_ID; 00112 extern const String SECURITY_CLIENT_HOLD_OFF_TIME; 00113 00114 //SERVER RESOURCES 00115 extern const String SERVER_SHORT_SERVER_ID; 00116 extern const String SERVER_LIFETIME; 00117 extern const String SERVER_DEFAULT_MIN_PERIOD; 00118 extern const String SERVER_DEFAULT_MAX_PERIOD; 00119 extern const String SERVER_DISABLE; 00120 extern const String SERVER_DISABLE_TIMEOUT; 00121 extern const String SERVER_NOTIFICATION_STORAGE; 00122 extern const String SERVER_BINDING; 00123 extern const String SERVER_REGISTRATION_UPDATE; 00124 00125 //FIRMWARE RESOURCES 00126 extern const String FIRMWARE_PACKAGE; 00127 extern const String FIRMWARE_PACKAGE_URI; 00128 extern const String FIRMWARE_UPDATE; 00129 extern const String FIRMWARE_STATE; 00130 extern const String FIRMWARE_UPDATE_SUPPORTED_OBJECTS; 00131 extern const String FIRMWARE_UPDATE_RESULT; 00132 extern const String FIRMWARE_PACKAGE_NAME; 00133 extern const String FIRMWARE_PACKAGE_VERSION; 00134 00135 // TLV serializer / deserializer 00136 const uint8_t TYPE_RESOURCE = 0xC0; 00137 const uint8_t TYPE_MULTIPLE_RESOURCE = 0x80; 00138 const uint8_t TYPE_RESOURCE_INSTANCE = 0x40; 00139 const uint8_t TYPE_OBJECT_INSTANCE = 0x0; 00140 00141 const uint8_t ID8 = 0x0; 00142 const uint8_t ID16 = 0x20; 00143 00144 const uint8_t LENGTH8 = 0x08; 00145 const uint8_t LENGTH16 = 0x10; 00146 const uint8_t LENGTH24 = 0x18; 00147 00148 const uint8_t COAP_CONTENT_OMA_TLV_TYPE = 99; 00149 const uint8_t COAP_CONTENT_OMA_JSON_TYPE = 100; 00150 const uint8_t COAP_CONTENT_OMA_OPAQUE_TYPE = 42; 00151 00152 const uint16_t MAX_UNINT_16_COUNT = 65535; 00153 00154 #endif // M2MCONSTANTS_H
Generated on Tue Jul 12 2022 18:06:59 by
1.7.2
