7 years, 11 months ago.

Mbed Client - M2MDevice registration

Hi All,

I can't understand how to registrate a M2MDevice to my cloud (if you look in your dash board you have devices which should be some how registrate). In example we have next code:

M2MDevice* create_device_object() { M2MDevice *device = M2MInterfaceFactory::create_device(); if (device) { device->create_resource(M2MDevice::Manufacturer, _device.Manufacturer); device->create_resource(M2MDevice::DeviceType, _device.Type); device->create_resource(M2MDevice::ModelNumber, _device.ModelNumber); device->create_resource(M2MDevice::SerialNumber, _device.SerialNumber);

device->set_operation(M2MBase::POST_ALLOWED); device->set_register_uri(true); } return device; } How this code can registrate a device with Manufacture name ...? If you look to create_resource function this will registrate only device_id:

_device_instance->create_dynamic_resource(device_id, OMA_RESOURCE_TYPE, M2MResourceInstance::STRING, true); but no info about manufacturea for example. In my opinion this code create only memory leaks and registrate device_id to server.

BR

Be the first to answer this question.