mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 22:20:37 +00:00
mesh: add mesh_generic_x_publish_value convenience functions that sends set unacknowledged message to publication address
This commit is contained in:
parent
0fd43b5dcd
commit
8907eb9d57
@ -198,3 +198,12 @@ void mesh_generic_on_off_client_get_value(mesh_model_t *mesh_model, uint16_t des
|
||||
// send as segmented access pdu
|
||||
generic_client_send_message(mesh_access_get_element_address(mesh_model), dest, netkey_index, appkey_index, (mesh_pdu_t *) transport_pdu);
|
||||
}
|
||||
|
||||
void mesh_generic_on_off_client_publish_value(mesh_model_t * mesh_model, uint8_t on_off_value){
|
||||
mesh_publication_model_t * publication_model = mesh_model->publication_model;
|
||||
uint16_t appkey_index = publication_model->appkey_index;
|
||||
mesh_transport_key_t * app_key = mesh_transport_key_get(appkey_index);
|
||||
if (app_key == NULL) return;
|
||||
|
||||
mesh_generic_on_off_client_set_value_unacknowledged(mesh_model, publication_model->address, app_key->netkey_index, appkey_index, on_off_value, 0, 0);
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ const mesh_operation_t * mesh_generic_on_off_client_get_operations(void);
|
||||
void mesh_generic_on_off_client_register_packet_handler(mesh_model_t *mesh_model, btstack_packet_handler_t events_packet_handler);
|
||||
|
||||
/**
|
||||
* @brief Set ON/OFF value
|
||||
* @brief Set ON/OFF value acknowledged
|
||||
* @param mesh_model
|
||||
* @param dest
|
||||
* @param netkey_index
|
||||
@ -68,7 +68,7 @@ void mesh_generic_on_off_client_register_packet_handler(mesh_model_t *mesh_model
|
||||
uint8_t mesh_generic_on_off_client_set_value(mesh_model_t * mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index, uint8_t on_off_value, uint8_t transition_time_gdtt, uint8_t delay_time_gdtt);
|
||||
|
||||
/**
|
||||
* @brief Get present ON/OFF value
|
||||
* @brief Set ON/OFF value unacknowledged
|
||||
* @param mesh_model
|
||||
* @param dest
|
||||
* @param netkey_index
|
||||
@ -89,6 +89,13 @@ uint8_t mesh_generic_on_off_client_set_value_unacknowledged(mesh_model_t * mesh_
|
||||
*/
|
||||
void mesh_generic_on_off_client_get_value(mesh_model_t *mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index);
|
||||
|
||||
/**
|
||||
* @brief Publish on_off value by sending an unacknowledged set message to the publish destination
|
||||
* @param mesh_model
|
||||
* @param on_off_value
|
||||
*/
|
||||
void mesh_generic_on_off_client_publish_value(mesh_model_t * mesh_model, uint8_t on_off_value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
|
@ -291,3 +291,9 @@ void mesh_generic_level_client_get_value(mesh_model_t *mesh_model, uint16_t dest
|
||||
// }
|
||||
|
||||
|
||||
void mesh_generic_level_client_publish_value(mesh_model_t * mesh_model, int16_t level_value){
|
||||
mesh_publication_model_t * publication_model = mesh_model->publication_model;
|
||||
uint16_t appkey_index = publication_model->appkey_index;
|
||||
mesh_transport_key_t * app_key = mesh_transport_key_get(appkey_index);
|
||||
mesh_generic_level_client_set_value_unacknowledged(mesh_model, publication_model->address, app_key->netkey_index, appkey_index, level_value, 0, 0);
|
||||
}
|
||||
|
@ -89,6 +89,12 @@ uint8_t mesh_generic_level_client_set_value_unacknowledged(mesh_model_t * mesh_m
|
||||
*/
|
||||
void mesh_generic_level_client_get_value(mesh_model_t *mesh_model, uint16_t dest, uint16_t netkey_index, uint16_t appkey_index);
|
||||
|
||||
/**
|
||||
* @brief Publish level value by sending an unacknowledged set message to the publish destination
|
||||
* @param mesh_model
|
||||
* @param level_value
|
||||
*/
|
||||
void mesh_generic_level_client_publish_value(mesh_model_t * mesh_model, int16_t level_value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
|
Loading…
x
Reference in New Issue
Block a user