This interface enables an application to be statically embedded within the LWM2M Client and interact with its resources. More...
Go to the source code of this file.
Classes | |
struct | AwaFactoryBootstrapInfo |
Information required to bootstrap the client daemon from a factory configuration. More... | |
Macros | |
#define | BOOTSTRAP_CONFIG_SERVER_URI_SIZE |
Maximum size in characters of Server URI string. More... | |
#define | BOOTSTRAP_CONFIG_PUBLIC_KEY_SIZE |
Maximum size in bytes of Public Key / Identity opaque value. More... | |
#define | BOOTSTRAP_CONFIG_SERVER_KEY_SIZE |
Maximum size in bytes of Server Key opaque value. More... | |
#define | BOOTSTRAP_CONFIG_SECRET_KEY_SIZE |
Maximum size in bytes of Secret Key opaque value. More... | |
#define | BOOTSTRAP_CONFIG_BINDING_SIZE |
Maximum length in characters of Binding string. More... | |
Typedefs | |
typedef struct _AwaStaticClient | AwaStaticClient |
Represents an Awa Static Client context, holding the necessary information to initialise the client daemon, define objects and resources, and handle callbacks. More... | |
typedef AwaResult(* | AwaStaticClientHandler) (AwaStaticClient *client, AwaOperation operation, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID, AwaResourceID resourceID, AwaResourceInstanceID resourceInstanceID, void **dataPointer, size_t *dataSize, bool *changed) |
A user-specified callback handler for a LWM2M Operation on the specified /O/I/R/i path to an LWM2M entity that will be called whenever a management server performs a LWM2M operation on the specified client, allowing full control of the operation on the target entity as well as the return code to be sent back to the server that performed the operation. More... | |
Functions | |
AwaStaticClient * | AwaStaticClient_New (void) |
Allocate and return a pointer to a new Awa Static Client. More... | |
AwaContentType | AwaStaticClient_GetDefaultContentType (void) |
Retrieve default content type to use when a request doesn't specify via accept header a preferred content type. More... | |
void | AwaStaticClient_SetDefaultContentType (AwaContentType contentType) |
Set the default content type to use when a request doesn't specify via accept header a preferred content type. More... | |
AwaError | AwaStaticClient_SetLogLevel (AwaLogLevel level) |
Set the client log level. More... | |
AwaError | AwaStaticClient_SetEndPointName (AwaStaticClient *client, const char *endPointName) |
Set the client endpoint name. More... | |
AwaError | AwaStaticClient_SetCoAPListenAddressPort (AwaStaticClient *client, const char *address, int port) |
Set the address and port to listen on for incoming CoAP packets. More... | |
AwaError | AwaStaticClient_SetBootstrapServerURI (AwaStaticClient *client, const char *bootstrapServerURI) |
Set the network location of a trusted LWM2M Bootstrap server, in the URI format: "coap://[address]:[port]". More... | |
AwaError | AwaStaticClient_SetFactoryBootstrapInformation (AwaStaticClient *client, const AwaFactoryBootstrapInfo *factoryBootstrapInformation) |
Configure factory bootstrap by supplying LWM2M Server Bootstrap Information to register with a LWM2M server. More... | |
void | AwaStaticClient_SetCertificate (AwaStaticClient *client, const uint8_t *certificate, int certificateLength, AwaCertificateFormat format) |
Configure default certificate to use when Awa Static Client connects to a secure Server/Bootstrap. More... | |
void | AwaStaticClient_SetPSK (AwaStaticClient *client, const char *identity, const uint8_t *key, int keyLength) |
Configure default PSK to use when Awa Static Client connects to a secure Server/Bootstrap. More... | |
AwaError | AwaStaticClient_SetApplicationContext (AwaStaticClient *client, void *context) |
Set a user-specified application context which is accessible to any defined callback handler owned by the Awa Static Client with AwaStaticClient_GetApplicationContext. More... | |
void * | AwaStaticClient_GetApplicationContext (AwaStaticClient *client) |
Retrieve a user-specified application context as a void pointer. More... | |
AwaClientRegistrationStatus | AwaStaticClient_GetRegistrationStatus (AwaStaticClient *client) |
Retrieve register status for the Awa Static Client. More... | |
AwaError | AwaStaticClient_Init (AwaStaticClient *client) |
Initialise an Awa Static client. More... | |
void | AwaStaticClient_Free (AwaStaticClient **client) |
Free an Awa Static Client. More... | |
AwaError | AwaStaticClient_DefineObject (AwaStaticClient *client, AwaObjectID objectID, const char *objectName, uint16_t minimumInstances, uint16_t maximumInstances) |
Define a new custom LWM2M object. More... | |
AwaError | AwaStaticClient_SetObjectOperationHandler (AwaStaticClient *client, AwaObjectID objectID, AwaStaticClientHandler handler) |
Set the Object Operation handler function, to be called by the LWM2M Client when object instances are created or deleted. More... | |
AwaError | AwaStaticClient_DefineResource (AwaStaticClient *client, AwaObjectID objectID, AwaResourceID resourceID, const char *resourceName, AwaResourceType resourceType, uint16_t minimumInstances, uint16_t maximumInstances, AwaResourceOperations operations) |
Define a new resource as part of a defined object. More... | |
AwaError | AwaStaticClient_SetResourceOperationHandler (AwaStaticClient *client, AwaObjectID objectID, AwaResourceID resourceID, AwaStaticClientHandler handler) |
Set a user-specified callback handler that will be called whenever a LWM2M operation on the resource is performed. More... | |
AwaError | AwaStaticClient_SetResourceStorageWithPointer (AwaStaticClient *client, AwaObjectID objectID, AwaResourceID resourceID, void *dataPointer, size_t dataElementSize, size_t dataStepSize) |
Set a resource's storage with a pointer to the resource's data, leaving handling of the resource to the LWM2M Client. More... | |
AwaError | AwaStaticClient_SetResourceStorageWithPointerArray (AwaStaticClient *client, AwaObjectID objectID, AwaResourceID resourceID, void *dataPointers[], size_t dataElementSize) |
Set a resource's storage with an array of pointers to non-contiguous data, where each piece of data stores the resource for a single instance of its object. More... | |
int | AwaStaticClient_Process (AwaStaticClient *client) |
Process the Awa Static Client. More... | |
const void * | AwaStaticClient_GetResourceInstancePointer (AwaStaticClient *client, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID, AwaResourceID resourceID, AwaResourceInstanceID resourceInstanceID, size_t *resourceSize) |
Retrieve a pointer to a resource instance's data, when defined with AwaStaticClient_SetResourceStorageWithPointer or AwaStaticClient_SetResourceStorageWithPointerArray. More... | |
AwaError | AwaStaticClient_CreateResource (AwaStaticClient *client, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID, AwaResourceID resourceID) |
Create an optional resource within the specified object instance. More... | |
AwaError | AwaStaticClient_DeleteResource (AwaStaticClient *client, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID, AwaResourceID resourceID) |
Delete an optional resource within the specified object instance. More... | |
AwaError | AwaStaticClient_CreateObjectInstance (AwaStaticClient *client, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID) |
Create an object instance within the specified object. More... | |
AwaError | AwaStaticClient_DeleteObjectInstance (AwaStaticClient *client, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID) |
Delete an object instance within the specified object. More... | |
AwaError | AwaStaticClient_ResourceChanged (AwaStaticClient *client, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID, AwaResourceID resourceID) |
Mark the specified resource as changed, in order for the Awa Static Client to send notifications to all LWM2M servers observing that resource. More... | |
AwaError | AwaStaticClient_ObjectInstanceChanged (AwaStaticClient *client, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID) |
Mark the specified object instance as changed, in order for the Awa Static Client to send notifications to all LWM2M servers observing that object instance. More... | |
This interface enables an application to be statically embedded within the LWM2M Client and interact with its resources.
The Client hosts resources within a data model based on Objects, Object Instances and Resources. Please consult the LWM2M specification for details of this model.
A Management Application may interact with the Client via LWM2M, accessing the same resources. Therefore it is essential that both the Client Application and Management Application are aware of the same data model and have definitions for the same objects and resources.
It is recommended that OMA registered IDs are used for objects that conform to registered LWM2M objects such as IPSO objects.
#define BOOTSTRAP_CONFIG_SERVER_URI_SIZE |
Maximum size in characters of Server URI string.
#define BOOTSTRAP_CONFIG_PUBLIC_KEY_SIZE |
Maximum size in bytes of Public Key / Identity opaque value.
#define BOOTSTRAP_CONFIG_SERVER_KEY_SIZE |
Maximum size in bytes of Server Key opaque value.
#define BOOTSTRAP_CONFIG_SECRET_KEY_SIZE |
Maximum size in bytes of Secret Key opaque value.
#define BOOTSTRAP_CONFIG_BINDING_SIZE |
Maximum length in characters of Binding string.
typedef struct _AwaStaticClient AwaStaticClient |
Represents an Awa Static Client context, holding the necessary information to initialise the client daemon, define objects and resources, and handle callbacks.
typedef AwaResult(* AwaStaticClientHandler) (AwaStaticClient *client, AwaOperation operation, AwaObjectID objectID, AwaObjectInstanceID objectInstanceID, AwaResourceID resourceID, AwaResourceInstanceID resourceInstanceID, void **dataPointer, size_t *dataSize, bool *changed) |
A user-specified callback handler for a LWM2M Operation on the specified /O/I/R/i path to an LWM2M entity that will be called whenever a management server performs a LWM2M operation on the specified client, allowing full control of the operation on the target entity as well as the return code to be sent back to the server that performed the operation.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | operation | The requested operation to perform on the entity. |
[in] | objectID | Identifies the object for which the query is targeted. |
[in] | objectInstanceID | Identifies the object instance for which the query is targeted, or AWA_INVALID_ID if the request is on an object. |
[in] | resourceID | Identifies the resource for which the query is targeted, or AWA_INVALID_ID if the request is on an object instance or object. |
[in] | resourceInstanceID | Identifies the resource instance for which the query is targeted, or AWA_INVALID_ID if the request is on a single-instance resource, object instance or object. |
[in,out] | dataPointer | A pointer to a void pointer containing data for the requested resource to be read or modified. |
[in,out] | dataSize | A pointer to an unsigned integer containing the length of the requested resource. |
[out] | changed | Set by the handler to indicate whether the resource's value has been changed by the handler If set to true, a notification will be sent when possible to any observers of the target object, object instance or resource. |
enum AwaOperation |
Supported operations for resource and object handlers defined with AwaStaticClient_DefineResource.
enum AwaSecurityMode |
Supported LWM2M security modes.
See the LWM2M specification for details.
enum AwaResult |
Supported result codes for handler callbacks.
AwaStaticClient* AwaStaticClient_New | ( | void | ) |
Allocate and return a pointer to a new Awa Static Client.
The new client can be used to define custom objects, resources and callback handlers, and respond to LWM2M operations.
The Awa Static Client is owned by the caller and should eventually be freed with AwaStaticClient_Free.
AwaContentType AwaStaticClient_GetDefaultContentType | ( | void | ) |
Retrieve default content type to use when a request doesn't specify via accept header a preferred content type.
The default is initially AwaContentType_ApplicationPlainText.
void AwaStaticClient_SetDefaultContentType | ( | AwaContentType | contentType | ) |
Set the default content type to use when a request doesn't specify via accept header a preferred content type.
[in] | contentType | The default contentType eg AwaContentType_ApplicationOmaLwm2mTLV. |
AwaError AwaStaticClient_SetLogLevel | ( | AwaLogLevel | level | ) |
Set the client log level.
This function is not tied to an AwaStaticClient and has global effect. Only messages with level equal to or less than the current log level will be displayed in the log.
This function can be called at any time.
[in] | level | A valid log level. |
AwaError AwaStaticClient_SetEndPointName | ( | AwaStaticClient * | client, |
const char * | endPointName | ||
) |
Set the client endpoint name.
This is the unique ID used to identify the client from any server the client has registered with.
This function must be called, and before calling AwaStaticClient_Init.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | endPointName | The unique endpoint name to identify this client. |
AwaError AwaStaticClient_SetCoAPListenAddressPort | ( | AwaStaticClient * | client, |
const char * | address, | ||
int | port | ||
) |
Set the address and port to listen on for incoming CoAP packets.
IPv4 and IPv6 addresses are valid. It must be the address of a local interface. Only local DNS names are valid.
Address "Any" (0.0.0.0
for IPv4, ::
for IPv6) is valid.
This function must be called, and before calling AwaStaticClient_Init.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | address | IP address to listen on. |
[in] | port | Port number to listen on. |
AwaError AwaStaticClient_SetBootstrapServerURI | ( | AwaStaticClient * | client, |
const char * | bootstrapServerURI | ||
) |
Set the network location of a trusted LWM2M Bootstrap server, in the URI format: "coap://[address]:[port]".
The client will connect to the bootstrap server to obtain the LWM2M Server Bootstrap Information.
[address] can be an IPv4 or IPv6 address, or a resolvable DNS name.
This function must be called, and before calling AwaStaticClient_Init.
If AwaStaticClient_SetFactoryBootstrapInformation is called, bootstrapServerURI is ignored. However if the factory bootstrap information results in a failed registration, bootstrapServerURI will be used to do a client-initiated bootstrap.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | bootstrapServerURI | Network location of bootstrap server. |
AwaError AwaStaticClient_SetFactoryBootstrapInformation | ( | AwaStaticClient * | client, |
const AwaFactoryBootstrapInfo * | factoryBootstrapInformation | ||
) |
Configure factory bootstrap by supplying LWM2M Server Bootstrap Information to register with a LWM2M server.
This function is optional. It should only be called after AwaStaticClient_Init and before AwaStaticClient_Process.
It may be called multiple times to set additional LWM2M servers.
If this factory bootstrap information results in a failed registration, bootstrapServerURI set by AwaStaticClient_SetBootstrapServerURI will be used to do a client-initiated bootstrap.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | factoryBootstrapInformation | A pointer to valid Factory Bootstrap information. |
void AwaStaticClient_SetCertificate | ( | AwaStaticClient * | client, |
const uint8_t * | certificate, | ||
int | certificateLength, | ||
AwaCertificateFormat | format | ||
) |
Configure default certificate to use when Awa Static Client connects to a secure Server/Bootstrap.
This function is optional. It should only be called after AwaStaticClient_Init and before AwaStaticClient_Process.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | certificate | A pointer to a certificate which is in format. |
[in] | certificateLength | Size of certificate. |
[in] | format | Whether certificate is in either ASN1 or PEM format. |
void AwaStaticClient_SetPSK | ( | AwaStaticClient * | client, |
const char * | identity, | ||
const uint8_t * | key, | ||
int | keyLength | ||
) |
Configure default PSK to use when Awa Static Client connects to a secure Server/Bootstrap.
This function is optional. It should only be called after AwaStaticClient_Init and before AwaStaticClient_Process.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | identity | A pointer to a NULL terminated string to identify client key. |
[in] | key | A pointer to shared key. |
[in] | keyLength | Size of key |
AwaError AwaStaticClient_SetApplicationContext | ( | AwaStaticClient * | client, |
void * | context | ||
) |
Set a user-specified application context which is accessible to any defined callback handler owned by the Awa Static Client with AwaStaticClient_GetApplicationContext.
The handler should cast this pointer to the correct type.
This function can be called at any time.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | context | A pointer to user-specified data. |
void* AwaStaticClient_GetApplicationContext | ( | AwaStaticClient * | client | ) |
Retrieve a user-specified application context as a void pointer.
This pointer is associated with the Awa Static Client with AwaStaticClient_SetApplicationContext. The returned pointer should be cast to the correct type.
This function can be called at any time.
[in] | client | A pointer to a valid Awa Static Client. |
AwaClientRegistrationStatus AwaStaticClient_GetRegistrationStatus | ( | AwaStaticClient * | client | ) |
Retrieve register status for the Awa Static Client.
This function should only be called after AwaStaticClient_Init.
[in] | client | A pointer to a valid Awa Static Client. |
AwaError AwaStaticClient_Init | ( | AwaStaticClient * | client | ) |
Initialise an Awa Static client.
This function can only be called once all information required for the client to connect to a LWM2M server has been set.
This function should only be called once for each Awa Static Client.
Before calling this function, the following functions must be called:
After calling this function, the following functions may be called before calling AwaStaticClient_Process:
[in] | client | A pointer to a valid Awa Static Client. |
void AwaStaticClient_Free | ( | AwaStaticClient ** | client | ) |
Free an Awa Static Client.
This function will close any connected sockets and free any allocated memory.
The pointer will be set to NULL. Copies of the pointer to the Awa Static Client should not be used after this call.
[in,out] | client | A pointer to an Awa Static Client pointer that will be set to NULL. |
AwaError AwaStaticClient_DefineObject | ( | AwaStaticClient * | client, |
AwaObjectID | objectID, | ||
const char * | objectName, | ||
uint16_t | minimumInstances, | ||
uint16_t | maximumInstances | ||
) |
Define a new custom LWM2M object.
By default, the LWM2M Client will handle instance operations such as delete and create. Use AwaStaticClient_SetObjectOperationHandler to override this default behaviour with a specified handler.
This function may only be called after a successful call to AwaStaticClient_Init.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | objectName | A human-friendly name for the new object. |
[in] | objectID | An ID that uniquely identifies the object. |
[in] | minimumInstances | The minimum number of instances of this object that must exist at any time. Must be less than or equal to maximumInstances. |
[in] | maximumInstances | The maximum number of instances of this object that must exist at any time. Must be greater than zero. |
AwaError AwaStaticClient_SetObjectOperationHandler | ( | AwaStaticClient * | client, |
AwaObjectID | objectID, | ||
AwaStaticClientHandler | handler | ||
) |
Set the Object Operation handler function, to be called by the LWM2M Client when object instances are created or deleted.
The target object must be defined with AwaStaticClient_DefineObject.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | objectID | An ID that uniquely identifies the defined object for which the handler will be associated. |
[in] | handler | A user-specified callback handler. |
AwaError AwaStaticClient_DefineResource | ( | AwaStaticClient * | client, |
AwaObjectID | objectID, | ||
AwaResourceID | resourceID, | ||
const char * | resourceName, | ||
AwaResourceType | resourceType, | ||
uint16_t | minimumInstances, | ||
uint16_t | maximumInstances, | ||
AwaResourceOperations | operations | ||
) |
Define a new resource as part of a defined object.
By default, the LWM2M Client will handle resource operations. Use AwaStaticClient_SetResourceOperationHandler, AwaStaticClient_SetResourceStorageWithPointer or AwaStaticClient_SetResourceStorageWithPointerArray to configure whether operations are handled by the user, or directed to operate on static memory.
This function may only be called after a successful call to AwaStaticClient_Init, and the target object must be defined.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | resourceName | A human-friendly name for the new resource. |
[in] | objectID | An ID that uniquely identifies the defined object which will contain the new resource. |
[in] | resourceID | An ID that uniquely identifies the new resource within the object. |
[in] | resourceType | The type of the new resource. |
[in] | minimumInstances | The minimum number of instances of this resource that must exist at any time. Must be less than or equal to maximumInstances. |
[in] | maximumInstances | The maximum number of instances of this resource that must exist at any time. Must be greater than zero. |
[in] | operations | The allowed LWM2M operations on the new resource. |
AwaError AwaStaticClient_SetResourceOperationHandler | ( | AwaStaticClient * | client, |
AwaObjectID | objectID, | ||
AwaResourceID | resourceID, | ||
AwaStaticClientHandler | handler | ||
) |
Set a user-specified callback handler that will be called whenever a LWM2M operation on the resource is performed.
The target resource must be defined with AwaStaticClient_DefineResource before this function is called.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | objectID | An ID that uniquely identifies the defined object that contains the defined resource. |
[in] | resourceID | An ID that uniquely identifies the defined resource within the object. |
[in] | handler | A user-specified callback handler. |
AwaError AwaStaticClient_SetResourceStorageWithPointer | ( | AwaStaticClient * | client, |
AwaObjectID | objectID, | ||
AwaResourceID | resourceID, | ||
void * | dataPointer, | ||
size_t | dataElementSize, | ||
size_t | dataStepSize | ||
) |
Set a resource's storage with a pointer to the resource's data, leaving handling of the resource to the LWM2M Client.
The resource's value within any of its instances may be directly modified at any time, however AwaStaticClient_ResourceChanged should be called to allow notifications to be sent to any observing LWM2M servers.
The target resource must be defined with AwaStaticClient_DefineResource before this function is called.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | objectID | An ID that uniquely identifies the defined object that contains the defined resource. |
[in] | resourceID | An ID that uniquely identifies the defined resource within the object. |
[in] | dataPointer | A pointer to the resource's data. |
[in] | dataElementSize | The size in bytes of the resource's data. Must be greater than or equal to 1. |
[in] | dataStepSize | The step size in bytes between the resource's data per object instance. |
AwaError AwaStaticClient_SetResourceStorageWithPointerArray | ( | AwaStaticClient * | client, |
AwaObjectID | objectID, | ||
AwaResourceID | resourceID, | ||
void * | dataPointers[], | ||
size_t | dataElementSize | ||
) |
Set a resource's storage with an array of pointers to non-contiguous data, where each piece of data stores the resource for a single instance of its object.
Handling of the resource is left to the LWM2M Client. The resource's value within any of its instances may be directly modified at any time, however AwaStaticClient_ResourceChanged should be called to allow notifications to be sent to any observing LWM2M servers.
The target resource must be defined with AwaStaticClient_DefineResource before this function is called.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | objectID | An ID that uniquely identifies the defined object that contains the defined resource. |
[in] | resourceID | An ID that uniquely identifies the defined resource within the object. |
[in] | dataPointers | An array of pointers, each containing the location of the resource's data for a single object instance. |
[in] | dataElementSize | The size in bytes of the resource's data. Must be greater than or equal to 1. |
int AwaStaticClient_Process | ( | AwaStaticClient * | client | ) |
Process the Awa Static Client.
This is the main process function which in turn processes the LWM2M Client core, updating the LWM2M state machine, handling any incoming CoAP messages, and sending notifications and registration updates to servers.
A successful call to AwaStaticClient_Init must precede a call to this function.
This function needs to be called regularly, usually as part of a loop, and returns the time to wait before calling again.
[in] | client | A pointer to a valid Awa Static Client. |
const void* AwaStaticClient_GetResourceInstancePointer | ( | AwaStaticClient * | client, |
AwaObjectID | objectID, | ||
AwaObjectInstanceID | objectInstanceID, | ||
AwaResourceID | resourceID, | ||
AwaResourceInstanceID | resourceInstanceID, | ||
size_t * | resourceSize | ||
) |
Retrieve a pointer to a resource instance's data, when defined with AwaStaticClient_SetResourceStorageWithPointer or AwaStaticClient_SetResourceStorageWithPointerArray.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | objectID | The ID of the object for the specified resource instance. |
[in] | objectInstanceID | The ID of the object instance for the specified resource instance. |
[in] | resourceID | The ID of the resource for the specified resource instance. |
[in] | resourceInstanceID | The ID of the resource instance. |
[out] | resourceSize | The size of the resource instance. |
AwaError AwaStaticClient_CreateResource | ( | AwaStaticClient * | client, |
AwaObjectID | objectID, | ||
AwaObjectInstanceID | objectInstanceID, | ||
AwaResourceID | resourceID | ||
) |
Create an optional resource within the specified object instance.
For a resource registered with a handler this will invoke a callback with the AwaOperation_CreateResource.
For a resource registered by pointer this will create the resource. For a multi-instance resource, the number of resource instances created will be the maximum defined.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | objectID | The ID of the object for the specified resource. |
[in] | objectInstanceID | The ID of the object instance for the specified resource. |
[in] | resourceID | The ID of the optional resource to create. |
AwaError AwaStaticClient_DeleteResource | ( | AwaStaticClient * | client, |
AwaObjectID | objectID, | ||
AwaObjectInstanceID | objectInstanceID, | ||
AwaResourceID | resourceID | ||
) |
Delete an optional resource within the specified object instance.
For a resource registered with a handler this will invoke a callback with the AwaOperation_DeleteResource.
For a resource registered by pointer this will delete the resource.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | objectID | The ID of the object for the specified resource. |
[in] | objectInstanceID | The ID of the object instance for the specified resource. |
[in] | resourceID | The ID of the optional resource to delete. |
AwaError AwaStaticClient_CreateObjectInstance | ( | AwaStaticClient * | client, |
AwaObjectID | objectID, | ||
AwaObjectInstanceID | objectInstanceID | ||
) |
Create an object instance within the specified object.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | objectID | The ID of the object for the specified object instance. |
[in] | objectInstanceID | The ID of the object instance to create. |
AwaError AwaStaticClient_DeleteObjectInstance | ( | AwaStaticClient * | client, |
AwaObjectID | objectID, | ||
AwaObjectInstanceID | objectInstanceID | ||
) |
Delete an object instance within the specified object.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | objectID | The ID of the object for the specified object instance. |
[in] | objectInstanceID | The ID of the object instance to delete. |
AwaError AwaStaticClient_ResourceChanged | ( | AwaStaticClient * | client, |
AwaObjectID | objectID, | ||
AwaObjectInstanceID | objectInstanceID, | ||
AwaResourceID | resourceID | ||
) |
Mark the specified resource as changed, in order for the Awa Static Client to send notifications to all LWM2M servers observing that resource.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | objectID | The ID of the object containing the specified resource. |
[in] | objectInstanceID | The ID of the object instance containing the specified resource. |
[in] | resourceID | The ID of the resource to mark as changed. |
AwaError AwaStaticClient_ObjectInstanceChanged | ( | AwaStaticClient * | client, |
AwaObjectID | objectID, | ||
AwaObjectInstanceID | objectInstanceID | ||
) |
Mark the specified object instance as changed, in order for the Awa Static Client to send notifications to all LWM2M servers observing that object instance.
This function should also be called when a resource is created or deleted in an object instance.
[in] | client | A pointer to a valid Awa Static Client. |
[in] | objectID | The ID of the object for the specified object instance. |
[in] | objectInstanceID | The ID of the object instance to mark as changed. |