MeshX 0.3
This repository provides an implementation for Bluetooth Low Energy (BLE) Mesh network nodes. The project allows you to create BLE mesh nodes that can communicate with each other, enabling the development of smart home solutions or other IoT-based applications.
Loading...
Searching...
No Matches
meshx_onoff_client.h
Go to the documentation of this file.
1
9
10#ifndef __MESHX_ONOFF_CLIENT_H__
11#define __MESHX_ONOFF_CLIENT_H__
12
13#include "meshx_common.h"
14#include "meshx_gen_client.h"
15#include "meshx_control_task.h"
16
17#if CONFIG_ENABLE_GEN_ONOFF_CLIENT
18
19#define MESHX_GEN_ON_OFF_CLI_MSG_SET 0
20#define MESHX_GEN_ON_OFF_CLI_MSG_GET 1
21#define MESHX_GEN_ON_OFF_CLI_MSG_ACK 1
22#define MESHX_GEN_ON_OFF_CLI_MSG_NO_ACK 0
23
27typedef struct relay_client_state
28{
29 uint8_t on_off;
30} meshx_on_off_cli_state_t;
31
38typedef meshx_model_interface_t meshx_onoff_client_model_t;
39
43typedef struct meshx_on_off_cli_el_msg
44{
45 uint8_t err_code;
46 meshx_model_t model;
47 meshx_ctx_t ctx;
48 uint8_t on_off_state;
49}meshx_on_off_cli_el_msg_t;
50
54typedef struct meshx_gen_onoff_send_params
55{
56 uint16_t element_id;
57 meshx_onoff_client_model_t *model;
58 uint16_t opcode;
59 uint16_t addr;
60 uint16_t net_idx;
61 uint16_t app_idx;
62 uint8_t state;
63 uint8_t tid;
64} meshx_gen_onoff_send_params_t;
78meshx_err_t meshx_on_off_client_create(meshx_onoff_client_model_t **p_model, void *p_sig_model);
79
92meshx_err_t meshx_on_off_client_delete(meshx_onoff_client_model_t **p_model);
93
103meshx_err_t meshx_on_off_client_init(void);
104
118meshx_err_t meshx_onoff_client_send_msg(meshx_gen_onoff_send_params_t *params);
119
135meshx_err_t meshx_gen_on_off_state_change_handle(
136 const meshx_on_off_cli_el_msg_t *param,
137 meshx_on_off_cli_state_t *p_prev_state,
138 meshx_on_off_cli_state_t *p_next_state
139);
140
141#endif /* CONFIG_ENABLE_GEN_ONOFF_CLIENT */
142#endif /* __MESHX_ONOFF_CLIENT_H__ */
struct meshx_model meshx_model_t
struct meshx_ctx meshx_ctx_t
Structure to hold context information for BLE Mesh operations.
Common application definitions and includes for BLE Mesh Node.
struct meshx_model_interface meshx_model_interface_t
Header file for the control task in the BLE mesh node application.
meshx_err_t
MeshX Error Codes.
Definition meshx_err.h:39
Implementation of the MeshX generic client model for BLE mesh nodes. This file contains functions for...