Modules#

_sl_service_function_context_t

Header for the service function module.

License#

Copyright 2021 Silicon Laboratories Inc. www.silabs.com

The licensor of this software is Silicon Laboratories Inc. Your use of this software is governed by the terms of Silicon Labs Master Software License Agreement (MSLA) available at www.silabs.com/about-us/legal/master-software-license-agreement. This software is distributed to you in Source Code format and is governed by the sections of the MSLA applicable to Source Code.

/***************************************************************************/
#ifndef __SL_SERVICE_FUNCTION__
#define __SL_SERVICE_FUNCTION__ 1
#include <stdint.h>
#include <stdbool.h>

#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
#define NOT_MFG_SPECIFIC 0xFFFF
#define SL_CLUSTER_SERVICE_SIDE_SERVER ZCL_DIRECTION_CLIENT_TO_SERVER
#define SL_CLUSTER_SERVICE_SIDE_CLIENT ZCL_DIRECTION_SERVER_TO_CLIENT
#endif // DOXYGEN_SHOULD_SKIP_THIS

// ========== Types.

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum sl_service_opcode_t
#else
typedef uint8_t sl_service_opcode_t;
enum
#endif
{
  SL_SERVICE_FUNCTION_TYPE_ZCL_COMMAND = 0x00,
};

#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
typedef uint32_t sl_service_key_t;
#endif // DOXYGEN_SHOULD_SKIP_THIS

typedef union _sl_service_function_context_t {
  void *data;
} sl_service_function_context_t;

typedef uint32_t (*sl_service_function_t)(sl_service_opcode_t, sl_service_function_context_t*);

#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
typedef struct {
  sl_service_opcode_t type;
  sl_service_key_t key;
  sl_service_key_t subkey;
  sl_service_function_t function;
} sl_service_function_entry_t;

typedef struct _sl_service_function_block_t {
  uint16_t count;
  sl_service_function_entry_t *entries;
  struct _sl_service_function_block_t *next;
} sl_service_function_block_t;

void sl_service_function_register_block(sl_service_function_block_t *block);

uint16_t sl_service_function_entry_count(void);

sl_service_function_entry_t *sl_service_function_get_first_entry(void);

sl_service_function_entry_t *sl_service_function_get_next_entry(sl_service_function_entry_t *current_entry);
#endif // DOXYGEN_SHOULD_SKIP_THIS

#endif // __SL_SERVICE_FUNCTION__

Enumerations#

enum
SL_SERVICE_FUNCTION_TYPE_ZCL_COMMAND = 0x00
}

Operation code: provide the context in which the service function is being called.

Typedefs#

Context that is passed to service function. Depends on actual op code which actual part is used.

typedef uint32_t(*
sl_service_function_t)(sl_service_opcode_t, sl_service_function_context_t *)

Service function signature.

Enumeration Documentation#

sl_service_opcode_t#

sl_service_opcode_t

Operation code: provide the context in which the service function is being called.

Enumerator
SL_SERVICE_FUNCTION_TYPE_ZCL_COMMAND

Definition at line 38 of file app/framework/service-function/sl_service_function.h

Typedef Documentation#

sl_service_function_context_t#

typedef union _sl_service_function_context_t sl_service_function_context_t

Context that is passed to service function. Depends on actual op code which actual part is used.


Definition at line 59 of file app/framework/service-function/sl_service_function.h

sl_service_function_t#

typedef uint32_t(* sl_service_function_t) (sl_service_opcode_t, sl_service_function_context_t *) )(sl_service_opcode_t, sl_service_function_context_t *)

Service function signature.


Definition at line 63 of file app/framework/service-function/sl_service_function.h