client-c  0.8.1
kaa_user.h File Reference

Endpoint-to-user association management for Kaa C SDK. More...

#include <stdbool.h>
#include "kaa_error.h"
#include "kaa_defaults.h"
#include "platform/ext_user_callback.h"
+ Include dependency graph for kaa_user.h:

Go to the source code of this file.

Macros

#define KAA_USER_MANAGER_T
 Kaa user manager structure. More...
 

Typedefs

typedef struct kaa_user_manager_t kaa_user_manager_t
 

Functions

kaa_error_t kaa_user_manager_attach_to_user (kaa_user_manager_t *self, const char *user_external_id, const char *access_token, const char *user_verifier_token)
 Attaches the endpoint to a user entity. The user verification is carried out by the default verifier. More...
 
bool kaa_user_manager_is_attached_to_user (kaa_user_manager_t *self)
 Checks if current endpoint is attached to user. More...
 
kaa_error_t kaa_user_manager_set_attachment_listeners (kaa_user_manager_t *self, const kaa_attachment_status_listeners_t *listeners)
 Sets callback functions to receive notifications when the endpoint gets attached or detached to (from) user. More...
 
kaa_error_t kaa_user_manager_attach_endpoint (kaa_user_manager_t *self, const char *endpoint_access_token, kaa_endpoint_status_listener_t *listener)
 Attaches external endpoint by its access token. More...
 
kaa_error_t kaa_user_manager_detach_endpoint (kaa_user_manager_t *self, const kaa_endpoint_id_p endpoint_hash_key, kaa_endpoint_status_listener_t *listener)
 Detaches external endpoint by its access token. More...
 

Detailed Description

Endpoint-to-user association management for Kaa C SDK.

Copyright 2014-2016 CyberVision, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Manages endpoint's association with a user entity in Kaa.

Definition in file kaa_user.h.

Macro Definition Documentation

#define KAA_USER_MANAGER_T

Kaa user manager structure.

Definition at line 43 of file kaa_user.h.

Typedef Documentation

Definition at line 44 of file kaa_user.h.

Function Documentation

kaa_error_t kaa_user_manager_attach_endpoint ( kaa_user_manager_t self,
const char *  endpoint_access_token,
kaa_endpoint_status_listener_t listener 
)

Attaches external endpoint by its access token.

Parameters
[in]selfThe user manager instance.
[in]endpoint_access_tokenNull-terminated string representing endpoint access token.
Returns
Error code.
kaa_error_t kaa_user_manager_attach_to_user ( kaa_user_manager_t self,
const char *  user_external_id,
const char *  access_token,
const char *  user_verifier_token 
)

Attaches the endpoint to a user entity. The user verification is carried out by the default verifier.

Use this function to request attachment of the endpoint to a user entity using the specified external authentication credentials. Only endpoints associated with the same user entity can exchange events.

Parameters
[in]selfThe user manager instance.
[in]user_external_idNull-terminated string representing external user ID.
[in]user_access_tokenNull-terminated string representing external access token.
Returns
Error code. Attaches the endpoint to a user entity. The user verification is carried out by the specified verifier.

Use this function to request attachment of the endpoint to a user entity using the specified external authentication credentials. Only endpoints associated with the same user entity can exchange events.

Parameters
[in]selfThe user manager instance.
[in]user_external_idNull-terminated string representing external user ID.
[in]user_access_tokenNull-terminated string representing external access token.
[in]user_verifier_tokenNull-terminated string representing user verifier token.
Returns
Error code.
kaa_error_t kaa_user_manager_detach_endpoint ( kaa_user_manager_t self,
const kaa_endpoint_id_p  endpoint_hash_key,
kaa_endpoint_status_listener_t listener 
)

Detaches external endpoint by its access token.

Parameters
[in]selfThe user manager instance.
[in]endpoint_hash_keyUnique endpoint id.
Returns
Error code.
bool kaa_user_manager_is_attached_to_user ( kaa_user_manager_t self)

Checks if current endpoint is attached to user.

Parameters
[in]selfThe user manager instance.
Return values
TRUEThe endpoint is attached to user
FALSEOtherwise
kaa_error_t kaa_user_manager_set_attachment_listeners ( kaa_user_manager_t self,
const kaa_attachment_status_listeners_t listeners 
)

Sets callback functions to receive notifications when the endpoint gets attached or detached to (from) user.

Parameters
[in]selfThe user manager instance.
[in]listenersA filled in kaa_attachment_status_listeners_t structure.
Returns
Error code.