16 #ifndef M2M_INTERFACE_H 17 #define M2M_INTERFACE_H 23 #include "sn_coap_protocol.h" 24 #include "nsdl-c/sn_nsdl_lib.h" 37 typedef Vector<M2MObject *> M2MObjectList;
38 typedef Vector<M2MBase *> M2MBaseList;
41 typedef enum request_error_e {
42 FAILED_TO_SEND_MSG = 0,
43 FAILED_TO_ALLOCATE_MEMORY = 1,
44 ERROR_NOT_REGISTERED = 2
47 typedef request_error_e get_data_req_error_e;
48 typedef request_error_t get_data_req_error_t;
109 SecureConnectionFailed,
111 UnregistrationFailed,
113 FailedToStoreCredentials,
114 FailedToReadCredentials
127 UDP_SMS_QUEUE = 0x07,
152 #ifndef MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE 174 #endif //MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE 231 const uint32_t lifetime = 0) = 0;
245 const uint32_t lifetime = 0) = 0;
359 const uint16_t payload_len,
360 uint8_t *payload_ptr,
362 get_data_error_cb error_cb,
381 virtual void pause() = 0;
389 virtual void alert() = 0;
403 virtual uint16_t stagger_wait_time(
bool boostrap)
const = 0;
410 virtual void set_cid_value(
const uint8_t *data_ptr,
const size_t data_len) = 0;
413 #endif // M2M_INTERFACE_H virtual void post_data_request(const char *uri, const bool async, const uint16_t payload_len, uint8_t *payload_ptr, get_data_cb data_cb, get_data_error_cb error_cb, void *context)=0
Sends the CoAP POST request to the server. Uri path to the data. In async mode application must cal...
Definition: m2mobject.h:35
Definition: m2mserver.h:31
virtual void set_entropy_callback(entropy_cb callback)=0
Sets the function callback that is called by mbed Client to provide an entropy source from an applica...
virtual void update_registration(M2MSecurity *security_object, const uint32_t lifetime=0)=0
Updates or refreshes the client's registration on the LWM2M server.
virtual bool set_uri_query_parameters(const char *uri_query_params)=0
Set custom uri query paramaters used in LWM2M registration. Uri query params. Parameters must be in ...
virtual void finish_bootstrap()=0
Finishes bootstrap in cases where client will be the one to finish it.
virtual void register_object(M2MSecurity *security_object, const M2MBaseList &list, bool full_registration=false)=0
Initiates the registration of a provided security object to the corresponding LWM2M server...
Definition: m2minterfaceobserver.h:32
virtual void set_queue_sleep_handler(callback_handler handler)=0
Sets the function that is called for indicating that the client is going to sleep when the binding mo...
virtual M2MServer * get_m2mserver() const =0
Returns M2MServer handle.
virtual const char * error_description() const =0
Return error description for the latest error code.
Definition: functionpointer.h:27
virtual nsdl_s * get_nsdl_handle() const =0
Get ndsl handle.
BindingMode
An enum defining different kinds of binding modes handled for client operations.
Definition: m2minterface.h:121
Definition: m2msecurity.h:31
virtual void get_data_request(DownloadType type, const char *uri, const size_t offset, const bool async, get_data_cb, get_data_error_cb, void *context)=0
Sends the CoAP GET request to the server. Download type. Uri path to the data. Data offset...
virtual void update_domain(const String &domain)=0
Updates the domain name.
NetworkStack
An enum defining different kinds of network stacks that can be used by mbed Client.
Definition: m2minterface.h:138
virtual void pause()=0
Pauses client's timed functionality and closes network connection to the Cloud. After successful call...
virtual void update_endpoint(const String &name)=0
Updates the endpoint name.
virtual void set_random_number_callback(random_number_cb callback)=0
Sets the function callback that is called by mbed Client to fetch a random number from an application...
virtual void set_cid_value(const uint8_t *data_ptr, const size_t data_len)=0
Internal test function. Set CID for current tls session.
Header for function pointer classes.
virtual void alert()=0
Sets client into an alert mode.
virtual const String internal_endpoint_name() const =0
Return internal endpoint name.
virtual void set_platform_network_handler(void *handler=NULL)=0
Sets the network interface handler that is used by mbed Client to connect to a network over IP...
Definition: m2minterface.h:88
virtual void unregister_object(M2MSecurity *security_object=NULL)=0
Unregisters the registered object from the LWM2M server.
Definition: m2mconfig.h:113
File defining all system build time configuration used by mbed-client.
void(* request_data_cb)(const uint8_t *buffer, size_t buffer_size, size_t total_size, bool last_block, void *context)
A callback function to receive data from GET request. Transfer is completed once total size equals to...
Definition: m2minterface.h:61
virtual void bootstrap(M2MSecurity *security_object)=0
Initiates bootstrapping of the client with the provided Bootstrap Server information. NOTE: This API is not supported for developers!!
void(* request_error_cb)(request_error_t error_code, void *context)
A callback function to receive errors from GET transfer.
Definition: m2minterface.h:73
virtual void cancel_bootstrap()=0
Cancels an ongoing bootstrapping operation of the client. If the client has already successfully boot...
Error
An enum defining different kinds of errors that can occur during various client operations.
Definition: m2minterface.h:96
virtual bool remove_object(M2MBase *base)=0
Removes an object from M2MInterface. Does not call delete on the object though.