joey shelton / LED_Demo

Dependencies:   MAX44000 PWM_Tone_Library nexpaq_mdk

Fork of LED_Demo by Maxim nexpaq

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers m2mconstants.h Source File

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 
00025 const int32_t MINIMUM_REGISTRATION_TIME = 60; //in seconds
00026 const uint64_t ONE_SECOND_TIMER = 1;
00027 const uint16_t MAX_ALLOWED_STRING_LENGTH = 64;
00028 const uint16_t OPTIMUM_LIFETIME = 3600;
00029 const uint16_t REDUCE_LIFETIME = 900;
00030 const float REDUCTION_FACTOR = 0.75f;
00031 
00032 // values per: draft-ietf-core-observe-16
00033 // OMA LWM2M CR ref.
00034 #define START_OBSERVATION 0
00035 #define STOP_OBSERVATION 1
00036 
00037 #define COAP "coap://"
00038 #define COAPS  "coaps://"
00039 #define BOOTSTRAP_URI "bs"
00040 // PUT attributes to be checked from server
00041 #define EQUAL  "="
00042 #define AMP  "&"
00043 #define PMIN  "pmin"
00044 #define PMAX  "pmax"
00045 #define GT  "gt"
00046 #define LT  "lt"
00047 #define ST_SIZE  "st"
00048 #define STP  "stp"
00049 #define CANCEL  "cancel"
00050 
00051 // just a helper for "String default_value = "";" pattern
00052 extern const String EMPTY;
00053 
00054 //LWM2MOBJECT NAME/ID
00055 #define M2M_SECURITY_ID  "0"
00056 #define M2M_SERVER_ID  "1"
00057 #define M2M_ACCESS_CONTROL_ID  "2"
00058 #define M2M_DEVICE_ID  "3"
00059 #define M2M_CONNECTIVITY_MONITOR_ID  "4"
00060 #define M2M_FIRMWARE_ID  "5"
00061 #define M2M_LOCATION_ID  "6"
00062 #define M2M_CONNECTIVITY_STATISTICS_ID  "7"
00063 #define RESERVED_ID  "8"
00064 
00065 //OMA RESOURCE TYPE
00066 #define OMA_RESOURCE_TYPE  "" //oma.lwm2m
00067 
00068 //DEVICE RESOURCES
00069 #define DEVICE_MANUFACTURER  "0"
00070 #define DEVICE_DEVICE_TYPE  "17"
00071 #define DEVICE_MODEL_NUMBER  "1"
00072 #define DEVICE_SERIAL_NUMBER  "2"
00073 #define DEVICE_HARDWARE_VERSION  "18"
00074 #define DEVICE_FIRMWARE_VERSION  "3"
00075 #define DEVICE_SOFTWARE_VERSION  "19"
00076 #define DEVICE_REBOOT  "4"
00077 #define DEVICE_FACTORY_RESET  "5"
00078 #define DEVICE_AVAILABLE_POWER_SOURCES  "6"
00079 #define DEVICE_POWER_SOURCE_VOLTAGE  "7"
00080 #define DEVICE_POWER_SOURCE_CURRENT  "8"
00081 #define DEVICE_BATTERY_LEVEL  "9"
00082 #define DEVICE_BATTERY_STATUS  "20"
00083 #define DEVICE_MEMORY_FREE  "10"
00084 #define DEVICE_MEMORY_TOTAL  "21"
00085 #define DEVICE_ERROR_CODE  "11"
00086 #define DEVICE_RESET_ERROR_CODE  "12"
00087 #define DEVICE_CURRENT_TIME  "13"
00088 #define DEVICE_UTC_OFFSET  "14"
00089 #define DEVICE_TIMEZONE  "15"
00090 #define DEVICE_SUPPORTED_BINDING_MODE  "16"
00091 #define BINDING_MODE_UDP  "U"
00092 #define BINDING_MODE_UDP_QUEUE  "UQ"
00093 #define BINDING_MODE_SMS  "S"
00094 #define BINDING_MODE_SMS_QUEUE  "SQ"
00095 #define ERROR_CODE_VALUE  "0"
00096 
00097 //SECURITY RESOURCES
00098 #define SECURITY_M2M_SERVER_URI  "0"
00099 #define SECURITY_BOOTSTRAP_SERVER  "1"
00100 #define SECURITY_SECURITY_MODE  "2"
00101 #define SECURITY_PUBLIC_KEY  "3"
00102 #define SECURITY_SERVER_PUBLIC_KEY  "4"
00103 #define SECURITY_SECRET_KEY  "5"
00104 #define SECURITY_SMS_SECURITY_MODE  "6"
00105 #define SECURITY_SMS_BINDING_KEY  "7"
00106 #define SECURITY_SMS_BINDING_SECRET_KEY  "8"
00107 #define SECURITY_M2M_SERVER_SMS_NUMBER  "9"
00108 #define SECURITY_SHORT_SERVER_ID  "10"
00109 #define SECURITY_CLIENT_HOLD_OFF_TIME  "11"
00110 
00111 //SERVER RESOURCES
00112 #define SERVER_SHORT_SERVER_ID  "0"
00113 #define SERVER_LIFETIME  "1"
00114 #define SERVER_DEFAULT_MIN_PERIOD  "2"
00115 #define SERVER_DEFAULT_MAX_PERIOD  "3"
00116 #define SERVER_DISABLE  "4"
00117 #define SERVER_DISABLE_TIMEOUT  "5"
00118 #define SERVER_NOTIFICATION_STORAGE  "6"
00119 #define SERVER_BINDING  "7"
00120 #define SERVER_REGISTRATION_UPDATE  "8"
00121 
00122 //FIRMWARE RESOURCES
00123 #define FIRMWARE_PACKAGE  "0"
00124 #define FIRMWARE_PACKAGE_URI  "1"
00125 #define FIRMWARE_UPDATE  "2"
00126 #define FIRMWARE_STATE  "3"
00127 #define FIRMWARE_UPDATE_SUPPORTED_OBJECTS  "4"
00128 #define FIRMWARE_UPDATE_RESULT  "5"
00129 #define FIRMWARE_PACKAGE_NAME  "6"
00130 #define FIRMWARE_PACKAGE_VERSION  "7"
00131 
00132 // TLV serializer / deserializer
00133 const uint8_t TYPE_RESOURCE = 0xC0;
00134 const uint8_t TYPE_MULTIPLE_RESOURCE = 0x80;
00135 const uint8_t TYPE_RESOURCE_INSTANCE = 0x40;
00136 const uint8_t TYPE_OBJECT_INSTANCE = 0x0;
00137 
00138 const uint8_t ID8 = 0x0;
00139 const uint8_t ID16 = 0x20;
00140 
00141 const uint8_t LENGTH8 = 0x08;
00142 const uint8_t LENGTH16 = 0x10;
00143 const uint8_t LENGTH24 = 0x18;
00144 
00145 const uint8_t COAP_CONTENT_OMA_TLV_TYPE = 99;
00146 const uint8_t COAP_CONTENT_OMA_JSON_TYPE = 100;
00147 const uint8_t COAP_CONTENT_OMA_OPAQUE_TYPE = 42;
00148 
00149 const uint16_t MAX_UNINT_16_COUNT = 65535;
00150 
00151 #endif // M2MCONSTANTS_H