Skip to content

Commit c82e553

Browse files
committed
Merge branch 'master' into size_optimization
* master: version v1.8.1 Fix for non-compiling unit tests because of m2mconstants.cpp removal. Changing const char* pointers to defines Increasing initial vector size from 4 to 12 Optimization RAM by replacing String usage with const char * Remove direct references to Linux platform implementations Moving release notes from Docs to docs folder. Removing line breaks Conflicts: source/m2mconstants.cpp
2 parents 7404115 + 4fa896a commit c82e553

24 files changed

+272
-379
lines changed

docs/known-issues-mbed-client1511.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@ We’re still very actively building mbed Client and the 15.11 release is a tech
1414

1515
#### Important Note for Windows Users
1616

17-
If you are using this release on Microsoft Windows, please be advised that
18-
because of the way Windows handles filename and paths, you may have problems
19-
if you attempt to use this in a deep directory hierarchy with a long
20-
path name (e.g. `c:\some\very\long\path`). If you experience problems
21-
unpacking or building this release, please try it in a location with a
22-
shorter path before filing a bug. Thanks.
17+
If you are using this release on Microsoft Windows, please be advised that because of the way Windows handles filename and paths, you may have problems if you attempt to use this in a deep directory hierarchy with a long path name (e.g. `c:\some\very\long\path`). If you experience problems unpacking or building this release, please try it in a location with a shorter path before filing a bug. Thanks.
2318

2419
***
2520
### mbed Client API may not be fully interoperable with other LWM2M servers.

mbed-client/m2mconstants.h

+80-84
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121

2222
const int MAX_VALUE_LENGTH = 256;
2323
const int BUFFER_LENGTH = 1152;
24-
extern const String COAP;
25-
extern const String COAPS;
24+
2625
const int32_t MINIMUM_REGISTRATION_TIME = 60; //in seconds
2726
const uint64_t ONE_SECOND_TIMER = 1;
2827
const uint16_t MAX_ALLOWED_STRING_LENGTH = 64;
@@ -38,102 +37,99 @@ const int RETRY_INTERVAL = 5;
3837
#define START_OBSERVATION 0
3938
#define STOP_OBSERVATION 1
4039

40+
#define COAP "coap://"
41+
#define COAPS "coaps://"
4142
// PUT attributes to be checked from server
42-
extern const String EQUAL;
43-
extern const String AMP;
44-
extern const String PMIN;
45-
extern const String PMAX;
46-
extern const String GT;
47-
extern const String LT;
48-
extern const String ST;
49-
extern const String STP;
50-
extern const String CANCEL;
43+
#define EQUAL "="
44+
#define AMP "&"
45+
#define PMIN "pmin"
46+
#define PMAX "pmax"
47+
#define GT "gt"
48+
#define LT "lt"
49+
#define ST_SIZE "st"
50+
#define STP "stp"
51+
#define CANCEL "cancel"
5152

5253
// just a helper for "String default_value = "";" pattern
5354
extern const String EMPTY;
5455

5556
//LWM2MOBJECT NAME/ID
56-
extern const String M2M_SECURITY_ID;
57-
extern const String M2M_SERVER_ID;
58-
extern const String M2M_ACCESS_CONTROL_ID;
59-
extern const String M2M_DEVICE_ID;
60-
61-
extern const String M2M_CONNECTIVITY_MONITOR_ID;
62-
extern const String M2M_FIRMWARE_ID;
63-
extern const String M2M_LOCATION_ID;
64-
extern const String M2M_CONNECTIVITY_STATISTICS_ID;
65-
extern const String RESERVED_ID;
66-
67-
//OBJECT RESOURCE TYPE
68-
extern const String OMA_RESOURCE_TYPE;
57+
#define M2M_SECURITY_ID "0"
58+
#define M2M_SERVER_ID "1"
59+
#define M2M_ACCESS_CONTROL_ID "2"
60+
#define M2M_DEVICE_ID "3"
61+
#define M2M_CONNECTIVITY_MONITOR_ID "4"
62+
#define M2M_FIRMWARE_ID "5"
63+
#define M2M_LOCATION_ID "6"
64+
#define M2M_CONNECTIVITY_STATISTICS_ID "7"
65+
#define RESERVED_ID "8"
66+
67+
//OMA RESOURCE TYPE
68+
#define OMA_RESOURCE_TYPE "" //oma.lwm2m
6969

7070
//DEVICE RESOURCES
71-
extern const String DEVICE_MANUFACTURER;
72-
extern const String DEVICE_DEVICE_TYPE;
73-
extern const String DEVICE_MODEL_NUMBER;
74-
extern const String DEVICE_SERIAL_NUMBER;
75-
extern const String DEVICE_HARDWARE_VERSION;
76-
extern const String DEVICE_FIRMWARE_VERSION;
77-
extern const String DEVICE_SOFTWARE_VERSION;
78-
extern const String DEVICE_REBOOT;
79-
extern const String DEVICE_FACTORY_RESET;
80-
extern const String DEVICE_AVAILABLE_POWER_SOURCES;
81-
extern const String DEVICE_POWER_SOURCE_VOLTAGE;
82-
extern const String DEVICE_POWER_SOURCE_CURRENT;
83-
extern const String DEVICE_BATTERY_LEVEL;
84-
extern const String DEVICE_BATTERY_STATUS;
85-
extern const String DEVICE_MEMORY_FREE;
86-
extern const String DEVICE_MEMORY_TOTAL;
87-
extern const String DEVICE_ERROR_CODE;
88-
extern const String DEVICE_RESET_ERROR_CODE;
89-
extern const String DEVICE_CURRENT_TIME;
90-
extern const String DEVICE_UTC_OFFSET;
91-
extern const String DEVICE_TIMEZONE;
92-
extern const String DEVICE_SUPPORTED_BINDING_MODE;
93-
94-
extern const String BINDING_MODE_UDP;
95-
extern const String BINDING_MODE_UDP_QUEUE;
96-
extern const String BINDING_MODE_SMS;
97-
extern const String BINDING_MODE_SMS_QUEUE;
98-
99-
extern const String ERROR_CODE_VALUE;
100-
101-
71+
#define DEVICE_MANUFACTURER "0"
72+
#define DEVICE_DEVICE_TYPE "17"
73+
#define DEVICE_MODEL_NUMBER "1"
74+
#define DEVICE_SERIAL_NUMBER "2"
75+
#define DEVICE_HARDWARE_VERSION "18"
76+
#define DEVICE_FIRMWARE_VERSION "3"
77+
#define DEVICE_SOFTWARE_VERSION "19"
78+
#define DEVICE_REBOOT "4"
79+
#define DEVICE_FACTORY_RESET "5"
80+
#define DEVICE_AVAILABLE_POWER_SOURCES "6"
81+
#define DEVICE_POWER_SOURCE_VOLTAGE "7"
82+
#define DEVICE_POWER_SOURCE_CURRENT "8"
83+
#define DEVICE_BATTERY_LEVEL "9"
84+
#define DEVICE_BATTERY_STATUS "20"
85+
#define DEVICE_MEMORY_FREE "10"
86+
#define DEVICE_MEMORY_TOTAL "21"
87+
#define DEVICE_ERROR_CODE "11"
88+
#define DEVICE_RESET_ERROR_CODE "12"
89+
#define DEVICE_CURRENT_TIME "13"
90+
#define DEVICE_UTC_OFFSET "14"
91+
#define DEVICE_TIMEZONE "15"
92+
#define DEVICE_SUPPORTED_BINDING_MODE "16"
93+
#define BINDING_MODE_UDP "U"
94+
#define BINDING_MODE_UDP_QUEUE "UQ"
95+
#define BINDING_MODE_SMS "S"
96+
#define BINDING_MODE_SMS_QUEUE "SQ"
97+
#define ERROR_CODE_VALUE "0"
10298

10399
//SECURITY RESOURCES
104-
extern const String SECURITY_M2M_SERVER_URI;
105-
extern const String SECURITY_BOOTSTRAP_SERVER;
106-
extern const String SECURITY_SECURITY_MODE;
107-
extern const String SECURITY_PUBLIC_KEY;
108-
extern const String SECURITY_SERVER_PUBLIC_KEY;
109-
extern const String SECURITY_SECRET_KEY;
110-
extern const String SECURITY_SMS_SECURITY_MODE;
111-
extern const String SECURITY_SMS_BINDING_KEY;
112-
extern const String SECURITY_SMS_BINDING_SECRET_KEY;
113-
extern const String SECURITY_M2M_SERVER_SMS_NUMBER;
114-
extern const String SECURITY_SHORT_SERVER_ID;
115-
extern const String SECURITY_CLIENT_HOLD_OFF_TIME;
100+
#define SECURITY_M2M_SERVER_URI "0"
101+
#define SECURITY_BOOTSTRAP_SERVER "1"
102+
#define SECURITY_SECURITY_MODE "2"
103+
#define SECURITY_PUBLIC_KEY "3"
104+
#define SECURITY_SERVER_PUBLIC_KEY "4"
105+
#define SECURITY_SECRET_KEY "5"
106+
#define SECURITY_SMS_SECURITY_MODE "6"
107+
#define SECURITY_SMS_BINDING_KEY "7"
108+
#define SECURITY_SMS_BINDING_SECRET_KEY "8"
109+
#define SECURITY_M2M_SERVER_SMS_NUMBER "9"
110+
#define SECURITY_SHORT_SERVER_ID "10"
111+
#define SECURITY_CLIENT_HOLD_OFF_TIME "11"
116112

117113
//SERVER RESOURCES
118-
extern const String SERVER_SHORT_SERVER_ID;
119-
extern const String SERVER_LIFETIME;
120-
extern const String SERVER_DEFAULT_MIN_PERIOD;
121-
extern const String SERVER_DEFAULT_MAX_PERIOD;
122-
extern const String SERVER_DISABLE;
123-
extern const String SERVER_DISABLE_TIMEOUT;
124-
extern const String SERVER_NOTIFICATION_STORAGE;
125-
extern const String SERVER_BINDING;
126-
extern const String SERVER_REGISTRATION_UPDATE;
114+
#define SERVER_SHORT_SERVER_ID "0"
115+
#define SERVER_LIFETIME "1"
116+
#define SERVER_DEFAULT_MIN_PERIOD "2"
117+
#define SERVER_DEFAULT_MAX_PERIOD "3"
118+
#define SERVER_DISABLE "4"
119+
#define SERVER_DISABLE_TIMEOUT "5"
120+
#define SERVER_NOTIFICATION_STORAGE "6"
121+
#define SERVER_BINDING "7"
122+
#define SERVER_REGISTRATION_UPDATE "8"
127123

128124
//FIRMWARE RESOURCES
129-
extern const String FIRMWARE_PACKAGE;
130-
extern const String FIRMWARE_PACKAGE_URI;
131-
extern const String FIRMWARE_UPDATE;
132-
extern const String FIRMWARE_STATE;
133-
extern const String FIRMWARE_UPDATE_SUPPORTED_OBJECTS;
134-
extern const String FIRMWARE_UPDATE_RESULT;
135-
extern const String FIRMWARE_PACKAGE_NAME;
136-
extern const String FIRMWARE_PACKAGE_VERSION;
125+
#define FIRMWARE_PACKAGE "0"
126+
#define FIRMWARE_PACKAGE_URI "1"
127+
#define FIRMWARE_UPDATE "2"
128+
#define FIRMWARE_STATE "3"
129+
#define FIRMWARE_UPDATE_SUPPORTED_OBJECTS "4"
130+
#define FIRMWARE_UPDATE_RESULT "5"
131+
#define FIRMWARE_PACKAGE_NAME "6"
132+
#define FIRMWARE_PACKAGE_VERSION "7"
137133

138134
// TLV serializer / deserializer
139135
const uint8_t TYPE_RESOURCE = 0xC0;

mbed-client/m2mdevice.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ friend class M2MInterfaceFactory;
230230
M2MResourceInstance* get_resource_instance(DeviceResource dev_res,
231231
uint16_t instance_id) const;
232232

233-
static const String& resource_name(DeviceResource resource);
233+
static const String resource_name(DeviceResource resource);
234234

235235
bool check_value_range(DeviceResource resource, const int64_t value) const;
236236

mbed-client/m2mfirmware.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ friend class M2MInterfaceFactory;
212212

213213
M2MResource* get_resource(FirmwareResource resource) const;
214214

215-
static const String& resource_name(FirmwareResource resource);
215+
static const String resource_name(FirmwareResource resource);
216216

217217
void create_mandatory_resources();
218218

mbed-client/m2mvector.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class Vector
157157
}
158158

159159
enum {
160-
MORE_SIZE = 32
160+
MORE_SIZE = 12
161161
};
162162

163163
private:

module.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mbed-client",
3-
"version": "1.8.0",
3+
"version": "1.8.1",
44
"description": "mbed Client C++ API",
55
"keywords": [],
66
"author": "Yogesh Pande <[email protected]>",

source/m2mconstants.cpp

-114
This file was deleted.

0 commit comments

Comments
 (0)