mesh: rename configuration client events, send raw data for composition data event

This commit is contained in:
Milanka Ringwald 2019-12-10 10:45:42 +01:00
parent 1937dd5208
commit b0e589ac8a
6 changed files with 105 additions and 224 deletions

View File

@ -2888,7 +2888,7 @@ typedef uint8_t sm_key_t[16];
* @param target_value optional, if value > 0, than remaining_time_ms must be read
* @param remaining_time_ms
*/
#define MESH_SUBEVENT_GENERIC_ON_OFF_STATUS 0x31
#define MESH_SUBEVENT_GENERIC_ON_OFF 0x31
/**
* @format 121224
@ -2899,7 +2899,7 @@ typedef uint8_t sm_key_t[16];
* @param target_value optional, if value > 0, than remaining_time_ms must be read
* @param remaining_time_ms
*/
#define MESH_SUBEVENT_GENERIC_LEVEL_STATUS 0x32
#define MESH_SUBEVENT_GENERIC_LEVEL 0x32
/**
* @format 1222211
@ -2927,7 +2927,7 @@ typedef uint8_t sm_key_t[16];
* @param status
* @param transition_time_gdtt
*/
#define MESH_SUBEVENT_GENERIC_DEFAULT_TRANSITION_TIME_STATUS 0x35
#define MESH_SUBEVENT_GENERIC_DEFAULT_TRANSITION_TIME 0x35
/**
* @format 1211
@ -2936,21 +2936,11 @@ typedef uint8_t sm_key_t[16];
* @param foundation_status
* @param secure_network_beacon_state
*/
#define MESH_SUBEVENT_FOUNDATION_BEACON_STATUS 0x36
#define MESH_SUBEVENT_CONFIGURATION_BEACON 0x36
/**
* @format 121122222
* @param subevent_code
* @param dest
* @param foundation_status
* @param page
* @param cid company identifier assigned by the Bluetooth SIG
* @param pid vendor-assigned product identifier
* @param vid vendor-assigned product version identifier
* @param crpl the minimum number of replay protection list entries in a device
* @param features device features
*/
#define MESH_SUBEVENT_FOUNDATION_COMPOSITION_DATA_STATUS 0x37
// Composition Data has variable of element descriptions, with two lists of model lists
// Use .. getters to access data
#define MESH_SUBEVENT_CONFIGURATION_COMPOSITION_DATA 0x37
/**
* @format 1211
@ -2959,7 +2949,7 @@ typedef uint8_t sm_key_t[16];
* @param foundation_status
* @param default_ttl
*/
#define MESH_SUBEVENT_FOUNDATION_DEFAULT_TTL_STATUS 0x38
#define MESH_SUBEVENT_CONFIGURATION_DEFAULT_TTL 0x38
/**
* @format 1211
@ -2968,7 +2958,7 @@ typedef uint8_t sm_key_t[16];
* @param foundation_status
* @param gatt_proxy_state
*/
#define MESH_SUBEVENT_FOUNDATION_GATT_PROXY_STATUS 0x39
#define MESH_SUBEVENT_CONFIGURATION_GATT_PROXY 0x39
/**
* @format 121111
@ -2979,6 +2969,6 @@ typedef uint8_t sm_key_t[16];
* @param retransmit_count the number of times that packet is transmitted for each packet that is relayed.
* @param retransmit_interval_ms retransmission interval in ms
*/
#define MESH_SUBEVENT_FOUNDATION_RELAY_STATUS 0x40
#define MESH_SUBEVENT_CONFIGURATION_RELAY 0x40
#endif

View File

@ -7825,94 +7825,94 @@ static inline uint16_t mesh_subevent_message_not_acknowledged_get_dest(const uin
}
/**
* @brief Get field dest from event MESH_SUBEVENT_GENERIC_ON_OFF_STATUS
* @brief Get field dest from event MESH_SUBEVENT_GENERIC_ON_OFF
* @param event packet
* @return dest
* @note: btstack_type 2
*/
static inline uint16_t mesh_subevent_generic_on_off_status_get_dest(const uint8_t * event){
static inline uint16_t mesh_subevent_generic_on_off_get_dest(const uint8_t * event){
return little_endian_read_16(event, 3);
}
/**
* @brief Get field status from event MESH_SUBEVENT_GENERIC_ON_OFF_STATUS
* @brief Get field status from event MESH_SUBEVENT_GENERIC_ON_OFF
* @param event packet
* @return status
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_generic_on_off_status_get_status(const uint8_t * event){
static inline uint8_t mesh_subevent_generic_on_off_get_status(const uint8_t * event){
return event[5];
}
/**
* @brief Get field present_value from event MESH_SUBEVENT_GENERIC_ON_OFF_STATUS
* @brief Get field present_value from event MESH_SUBEVENT_GENERIC_ON_OFF
* @param event packet
* @return present_value
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_generic_on_off_status_get_present_value(const uint8_t * event){
static inline uint8_t mesh_subevent_generic_on_off_get_present_value(const uint8_t * event){
return event[6];
}
/**
* @brief Get field target_value from event MESH_SUBEVENT_GENERIC_ON_OFF_STATUS
* @brief Get field target_value from event MESH_SUBEVENT_GENERIC_ON_OFF
* @param event packet
* @return target_value
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_generic_on_off_status_get_target_value(const uint8_t * event){
static inline uint8_t mesh_subevent_generic_on_off_get_target_value(const uint8_t * event){
return event[7];
}
/**
* @brief Get field remaining_time_ms from event MESH_SUBEVENT_GENERIC_ON_OFF_STATUS
* @brief Get field remaining_time_ms from event MESH_SUBEVENT_GENERIC_ON_OFF
* @param event packet
* @return remaining_time_ms
* @note: btstack_type 4
*/
static inline uint32_t mesh_subevent_generic_on_off_status_get_remaining_time_ms(const uint8_t * event){
static inline uint32_t mesh_subevent_generic_on_off_get_remaining_time_ms(const uint8_t * event){
return little_endian_read_32(event, 8);
}
/**
* @brief Get field dest from event MESH_SUBEVENT_GENERIC_LEVEL_STATUS
* @brief Get field dest from event MESH_SUBEVENT_GENERIC_LEVEL
* @param event packet
* @return dest
* @note: btstack_type 2
*/
static inline uint16_t mesh_subevent_generic_level_status_get_dest(const uint8_t * event){
static inline uint16_t mesh_subevent_generic_level_get_dest(const uint8_t * event){
return little_endian_read_16(event, 3);
}
/**
* @brief Get field status from event MESH_SUBEVENT_GENERIC_LEVEL_STATUS
* @brief Get field status from event MESH_SUBEVENT_GENERIC_LEVEL
* @param event packet
* @return status
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_generic_level_status_get_status(const uint8_t * event){
static inline uint8_t mesh_subevent_generic_level_get_status(const uint8_t * event){
return event[5];
}
/**
* @brief Get field present_value from event MESH_SUBEVENT_GENERIC_LEVEL_STATUS
* @brief Get field present_value from event MESH_SUBEVENT_GENERIC_LEVEL
* @param event packet
* @return present_value
* @note: btstack_type 2
*/
static inline uint16_t mesh_subevent_generic_level_status_get_present_value(const uint8_t * event){
static inline uint16_t mesh_subevent_generic_level_get_present_value(const uint8_t * event){
return little_endian_read_16(event, 6);
}
/**
* @brief Get field target_value from event MESH_SUBEVENT_GENERIC_LEVEL_STATUS
* @brief Get field target_value from event MESH_SUBEVENT_GENERIC_LEVEL
* @param event packet
* @return target_value
* @note: btstack_type 2
*/
static inline uint16_t mesh_subevent_generic_level_status_get_target_value(const uint8_t * event){
static inline uint16_t mesh_subevent_generic_level_get_target_value(const uint8_t * event){
return little_endian_read_16(event, 8);
}
/**
* @brief Get field remaining_time_ms from event MESH_SUBEVENT_GENERIC_LEVEL_STATUS
* @brief Get field remaining_time_ms from event MESH_SUBEVENT_GENERIC_LEVEL
* @param event packet
* @return remaining_time_ms
* @note: btstack_type 4
*/
static inline uint32_t mesh_subevent_generic_level_status_get_remaining_time_ms(const uint8_t * event){
static inline uint32_t mesh_subevent_generic_level_get_remaining_time_ms(const uint8_t * event){
return little_endian_read_32(event, 10);
}
@ -7982,233 +7982,160 @@ static inline uint8_t mesh_subevent_health_attention_timer_changed_get_element_i
}
/**
* @brief Get field dest from event MESH_SUBEVENT_GENERIC_DEFAULT_TRANSITION_TIME_STATUS
* @brief Get field dest from event MESH_SUBEVENT_GENERIC_DEFAULT_TRANSITION_TIME
* @param event packet
* @return dest
* @note: btstack_type 2
*/
static inline uint16_t mesh_subevent_generic_default_transition_time_status_get_dest(const uint8_t * event){
static inline uint16_t mesh_subevent_generic_default_transition_time_get_dest(const uint8_t * event){
return little_endian_read_16(event, 3);
}
/**
* @brief Get field status from event MESH_SUBEVENT_GENERIC_DEFAULT_TRANSITION_TIME_STATUS
* @brief Get field status from event MESH_SUBEVENT_GENERIC_DEFAULT_TRANSITION_TIME
* @param event packet
* @return status
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_generic_default_transition_time_status_get_status(const uint8_t * event){
static inline uint8_t mesh_subevent_generic_default_transition_time_get_status(const uint8_t * event){
return event[5];
}
/**
* @brief Get field transition_time_gdtt from event MESH_SUBEVENT_GENERIC_DEFAULT_TRANSITION_TIME_STATUS
* @brief Get field transition_time_gdtt from event MESH_SUBEVENT_GENERIC_DEFAULT_TRANSITION_TIME
* @param event packet
* @return transition_time_gdtt
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_generic_default_transition_time_status_get_transition_time_gdtt(const uint8_t * event){
static inline uint8_t mesh_subevent_generic_default_transition_time_get_transition_time_gdtt(const uint8_t * event){
return event[6];
}
/**
* @brief Get field dest from event MESH_SUBEVENT_FOUNDATION_BEACON_STATUS
* @brief Get field dest from event MESH_SUBEVENT_CONFIGURATION_BEACON
* @param event packet
* @return dest
* @note: btstack_type 2
*/
static inline uint16_t mesh_subevent_foundation_beacon_status_get_dest(const uint8_t * event){
static inline uint16_t mesh_subevent_configuration_beacon_get_dest(const uint8_t * event){
return little_endian_read_16(event, 3);
}
/**
* @brief Get field foundation_status from event MESH_SUBEVENT_FOUNDATION_BEACON_STATUS
* @brief Get field foundation_status from event MESH_SUBEVENT_CONFIGURATION_BEACON
* @param event packet
* @return foundation_status
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_foundation_beacon_status_get_foundation_status(const uint8_t * event){
static inline uint8_t mesh_subevent_configuration_beacon_get_foundation_status(const uint8_t * event){
return event[5];
}
/**
* @brief Get field secure_network_beacon_state from event MESH_SUBEVENT_FOUNDATION_BEACON_STATUS
* @brief Get field secure_network_beacon_state from event MESH_SUBEVENT_CONFIGURATION_BEACON
* @param event packet
* @return secure_network_beacon_state
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_foundation_beacon_status_get_secure_network_beacon_state(const uint8_t * event){
static inline uint8_t mesh_subevent_configuration_beacon_get_secure_network_beacon_state(const uint8_t * event){
return event[6];
}
/**
* @brief Get field dest from event MESH_SUBEVENT_FOUNDATION_COMPOSITION_DATA_STATUS
* @brief Get field dest from event MESH_SUBEVENT_CONFIGURATION_DEFAULT_TTL
* @param event packet
* @return dest
* @note: btstack_type 2
*/
static inline uint16_t mesh_subevent_foundation_composition_data_status_get_dest(const uint8_t * event){
static inline uint16_t mesh_subevent_configuration_default_ttl_get_dest(const uint8_t * event){
return little_endian_read_16(event, 3);
}
/**
* @brief Get field foundation_status from event MESH_SUBEVENT_FOUNDATION_COMPOSITION_DATA_STATUS
* @brief Get field foundation_status from event MESH_SUBEVENT_CONFIGURATION_DEFAULT_TTL
* @param event packet
* @return foundation_status
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_foundation_composition_data_status_get_foundation_status(const uint8_t * event){
static inline uint8_t mesh_subevent_configuration_default_ttl_get_foundation_status(const uint8_t * event){
return event[5];
}
/**
* @brief Get field page from event MESH_SUBEVENT_FOUNDATION_COMPOSITION_DATA_STATUS
* @param event packet
* @return page
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_foundation_composition_data_status_get_page(const uint8_t * event){
return event[6];
}
/**
* @brief Get field cid from event MESH_SUBEVENT_FOUNDATION_COMPOSITION_DATA_STATUS
* @param event packet
* @return cid
* @note: btstack_type 2
*/
static inline uint16_t mesh_subevent_foundation_composition_data_status_get_cid(const uint8_t * event){
return little_endian_read_16(event, 7);
}
/**
* @brief Get field pid from event MESH_SUBEVENT_FOUNDATION_COMPOSITION_DATA_STATUS
* @param event packet
* @return pid
* @note: btstack_type 2
*/
static inline uint16_t mesh_subevent_foundation_composition_data_status_get_pid(const uint8_t * event){
return little_endian_read_16(event, 9);
}
/**
* @brief Get field vid from event MESH_SUBEVENT_FOUNDATION_COMPOSITION_DATA_STATUS
* @param event packet
* @return vid
* @note: btstack_type 2
*/
static inline uint16_t mesh_subevent_foundation_composition_data_status_get_vid(const uint8_t * event){
return little_endian_read_16(event, 11);
}
/**
* @brief Get field crpl from event MESH_SUBEVENT_FOUNDATION_COMPOSITION_DATA_STATUS
* @param event packet
* @return crpl
* @note: btstack_type 2
*/
static inline uint16_t mesh_subevent_foundation_composition_data_status_get_crpl(const uint8_t * event){
return little_endian_read_16(event, 13);
}
/**
* @brief Get field features from event MESH_SUBEVENT_FOUNDATION_COMPOSITION_DATA_STATUS
* @param event packet
* @return features
* @note: btstack_type 2
*/
static inline uint16_t mesh_subevent_foundation_composition_data_status_get_features(const uint8_t * event){
return little_endian_read_16(event, 15);
}
/**
* @brief Get field dest from event MESH_SUBEVENT_FOUNDATION_DEFAULT_TTL_STATUS
* @param event packet
* @return dest
* @note: btstack_type 2
*/
static inline uint16_t mesh_subevent_foundation_default_ttl_status_get_dest(const uint8_t * event){
return little_endian_read_16(event, 3);
}
/**
* @brief Get field foundation_status from event MESH_SUBEVENT_FOUNDATION_DEFAULT_TTL_STATUS
* @param event packet
* @return foundation_status
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_foundation_default_ttl_status_get_foundation_status(const uint8_t * event){
return event[5];
}
/**
* @brief Get field default_ttl from event MESH_SUBEVENT_FOUNDATION_DEFAULT_TTL_STATUS
* @brief Get field default_ttl from event MESH_SUBEVENT_CONFIGURATION_DEFAULT_TTL
* @param event packet
* @return default_ttl
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_foundation_default_ttl_status_get_default_ttl(const uint8_t * event){
static inline uint8_t mesh_subevent_configuration_default_ttl_get_default_ttl(const uint8_t * event){
return event[6];
}
/**
* @brief Get field dest from event MESH_SUBEVENT_FOUNDATION_GATT_PROXY_STATUS
* @brief Get field dest from event MESH_SUBEVENT_CONFIGURATION_GATT_PROXY
* @param event packet
* @return dest
* @note: btstack_type 2
*/
static inline uint16_t mesh_subevent_foundation_gatt_proxy_status_get_dest(const uint8_t * event){
static inline uint16_t mesh_subevent_configuration_gatt_proxy_get_dest(const uint8_t * event){
return little_endian_read_16(event, 3);
}
/**
* @brief Get field foundation_status from event MESH_SUBEVENT_FOUNDATION_GATT_PROXY_STATUS
* @brief Get field foundation_status from event MESH_SUBEVENT_CONFIGURATION_GATT_PROXY
* @param event packet
* @return foundation_status
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_foundation_gatt_proxy_status_get_foundation_status(const uint8_t * event){
static inline uint8_t mesh_subevent_configuration_gatt_proxy_get_foundation_status(const uint8_t * event){
return event[5];
}
/**
* @brief Get field gatt_proxy_state from event MESH_SUBEVENT_FOUNDATION_GATT_PROXY_STATUS
* @brief Get field gatt_proxy_state from event MESH_SUBEVENT_CONFIGURATION_GATT_PROXY
* @param event packet
* @return gatt_proxy_state
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_foundation_gatt_proxy_status_get_gatt_proxy_state(const uint8_t * event){
static inline uint8_t mesh_subevent_configuration_gatt_proxy_get_gatt_proxy_state(const uint8_t * event){
return event[6];
}
/**
* @brief Get field dest from event MESH_SUBEVENT_FOUNDATION_RELAY_STATUS
* @brief Get field dest from event MESH_SUBEVENT_CONFIGURATION_RELAY
* @param event packet
* @return dest
* @note: btstack_type 2
*/
static inline uint16_t mesh_subevent_foundation_relay_status_get_dest(const uint8_t * event){
static inline uint16_t mesh_subevent_configuration_relay_get_dest(const uint8_t * event){
return little_endian_read_16(event, 3);
}
/**
* @brief Get field foundation_status from event MESH_SUBEVENT_FOUNDATION_RELAY_STATUS
* @brief Get field foundation_status from event MESH_SUBEVENT_CONFIGURATION_RELAY
* @param event packet
* @return foundation_status
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_foundation_relay_status_get_foundation_status(const uint8_t * event){
static inline uint8_t mesh_subevent_configuration_relay_get_foundation_status(const uint8_t * event){
return event[5];
}
/**
* @brief Get field relay from event MESH_SUBEVENT_FOUNDATION_RELAY_STATUS
* @brief Get field relay from event MESH_SUBEVENT_CONFIGURATION_RELAY
* @param event packet
* @return relay
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_foundation_relay_status_get_relay(const uint8_t * event){
static inline uint8_t mesh_subevent_configuration_relay_get_relay(const uint8_t * event){
return event[6];
}
/**
* @brief Get field retransmit_count from event MESH_SUBEVENT_FOUNDATION_RELAY_STATUS
* @brief Get field retransmit_count from event MESH_SUBEVENT_CONFIGURATION_RELAY
* @param event packet
* @return retransmit_count
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_foundation_relay_status_get_retransmit_count(const uint8_t * event){
static inline uint8_t mesh_subevent_configuration_relay_get_retransmit_count(const uint8_t * event){
return event[7];
}
/**
* @brief Get field retransmit_interval_ms from event MESH_SUBEVENT_FOUNDATION_RELAY_STATUS
* @brief Get field retransmit_interval_ms from event MESH_SUBEVENT_CONFIGURATION_RELAY
* @param event packet
* @return retransmit_interval_ms
* @note: btstack_type 1
*/
static inline uint8_t mesh_subevent_foundation_relay_status_get_retransmit_interval_ms(const uint8_t * event){
static inline uint8_t mesh_subevent_configuration_relay_get_retransmit_interval_ms(const uint8_t * event){
return event[8];
}

View File

@ -230,94 +230,58 @@ uint8_t mesh_configuration_client_send_relay_set(mesh_model_t * mesh_model, uint
}
// Model Operations
static void mesh_configuration_client_beacon_status_handler(mesh_model_t *mesh_model, mesh_pdu_t * pdu){
mesh_access_parser_state_t parser;
mesh_access_parser_init(&parser, (mesh_pdu_t*) pdu);
static void mesh_configuration_client_composition_data_status_handler(mesh_model_t *mesh_model, mesh_pdu_t * pdu){
// Composition Data has variable of element descriptions, with two lists of model lists
// Pass raw data to application but provide convenient setters instead of parsing pdu here
uint8_t beacon_status = mesh_access_parser_get_u8(&parser);
// reuse part of the mesh_network_t / mesh_transport_t struct to create event without memcpy or allocation
uint8_t * data = mesh_pdu_data(pdu);
uint8_t * event = &data[-6];
uint8_t event[7] = {HCI_EVENT_MESH_META, 5, MESH_SUBEVENT_FOUNDATION_BEACON_STATUS};
int pos = 3;
// TODO: list of element descriptions, see Table 4.4
int pos = 0;
event[pos++] = HCI_EVENT_MESH_META;
// Composite Data might be larger than 251 bytes - in this case only lower 8 bit are stored here. packet size is correct
event[pos++] = (uint8_t) (6 + mesh_pdu_len(pdu));
event[pos++] = MESH_SUBEVENT_CONFIGURATION_COMPOSITION_DATA;
// dest
little_endian_store_16(event, pos, mesh_pdu_src(pdu));
pos += 2;
event[pos++] = ERROR_CODE_SUCCESS;
event[pos++] = beacon_status;
(*mesh_model->model_packet_handler)(HCI_EVENT_PACKET, 0, event, pos);
mesh_access_message_processed(pdu);
}
static void mesh_configuration_client_composition_data_status_handler(mesh_model_t *mesh_model, mesh_pdu_t * pdu){
static inline void mesh_configuration_client_handle_uint8_value(mesh_model_t *mesh_model, mesh_pdu_t * pdu, uint8_t subevent_type){
mesh_access_parser_state_t parser;
mesh_access_parser_init(&parser, (mesh_pdu_t*) pdu);
uint8_t page = mesh_access_parser_get_u8(&parser);
uint16_t cid = mesh_access_parser_get_u16(&parser);
uint16_t pid = mesh_access_parser_get_u16(&parser);
uint16_t vid = mesh_access_parser_get_u16(&parser);
uint16_t crpl = mesh_access_parser_get_u16(&parser);
uint16_t features = mesh_access_parser_get_u16(&parser);
uint8_t value = mesh_access_parser_get_u8(&parser);
// TODO: list of element descriptions, see Table 4.4
uint8_t event[17] = {HCI_EVENT_MESH_META, 5, MESH_SUBEVENT_FOUNDATION_COMPOSITION_DATA_STATUS};
uint8_t event[7] = {HCI_EVENT_MESH_META, 5, subevent_type};
int pos = 3;
// dest
little_endian_store_16(event, pos, mesh_pdu_src(pdu));
pos += 2;
event[pos++] = ERROR_CODE_SUCCESS;
event[pos++] = page;
little_endian_store_16(event, pos, cid);
pos += 2;
little_endian_store_16(event, pos, pid);
pos += 2;
little_endian_store_16(event, pos, vid);
pos += 2;
little_endian_store_16(event, pos, crpl);
pos += 2;
little_endian_store_16(event, pos, features);
pos += 2;
event[pos++] = value;
(*mesh_model->model_packet_handler)(HCI_EVENT_PACKET, 0, event, pos);
mesh_access_message_processed(pdu);
}
static void mesh_configuration_client_beacon_status_handler(mesh_model_t *mesh_model, mesh_pdu_t * pdu){
mesh_configuration_client_handle_uint8_value(mesh_model, pdu, MESH_SUBEVENT_CONFIGURATION_BEACON);
}
static void mesh_configuration_client_default_ttl_handler(mesh_model_t *mesh_model, mesh_pdu_t * pdu){
mesh_access_parser_state_t parser;
mesh_access_parser_init(&parser, (mesh_pdu_t*) pdu);
uint8_t default_ttl = mesh_access_parser_get_u8(&parser);
uint8_t event[7] = {HCI_EVENT_MESH_META, 5, MESH_SUBEVENT_FOUNDATION_DEFAULT_TTL_STATUS};
int pos = 3;
// dest
little_endian_store_16(event, pos, mesh_pdu_src(pdu));
pos += 2;
event[pos++] = ERROR_CODE_SUCCESS;
event[pos++] = default_ttl;
(*mesh_model->model_packet_handler)(HCI_EVENT_PACKET, 0, event, pos);
mesh_access_message_processed(pdu);
mesh_configuration_client_handle_uint8_value(mesh_model, pdu, MESH_SUBEVENT_CONFIGURATION_DEFAULT_TTL);
}
static void mesh_configuration_client_gatt_proxy_handler(mesh_model_t *mesh_model, mesh_pdu_t * pdu){
mesh_access_parser_state_t parser;
mesh_access_parser_init(&parser, (mesh_pdu_t*) pdu);
uint8_t gatt_proxy_state = mesh_access_parser_get_u8(&parser);
uint8_t event[7] = {HCI_EVENT_MESH_META, 5, MESH_SUBEVENT_FOUNDATION_GATT_PROXY_STATUS};
int pos = 3;
// dest
little_endian_store_16(event, pos, mesh_pdu_src(pdu));
pos += 2;
event[pos++] = ERROR_CODE_SUCCESS;
event[pos++] = gatt_proxy_state;
(*mesh_model->model_packet_handler)(HCI_EVENT_PACKET, 0, event, pos);
mesh_access_message_processed(pdu);
mesh_configuration_client_handle_uint8_value(mesh_model, pdu, MESH_SUBEVENT_CONFIGURATION_GATT_PROXY);
}
static void mesh_configuration_client_relay_handler(mesh_model_t *mesh_model, mesh_pdu_t * pdu){
@ -327,7 +291,7 @@ static void mesh_configuration_client_relay_handler(mesh_model_t *mesh_model, me
uint8_t relay = mesh_access_parser_get_u8(&parser);
uint8_t retransmition = mesh_access_parser_get_u8(&parser);
uint8_t event[9] = {HCI_EVENT_MESH_META, 5, MESH_SUBEVENT_FOUNDATION_RELAY_STATUS};
uint8_t event[9] = {HCI_EVENT_MESH_META, 5, MESH_SUBEVENT_CONFIGURATION_RELAY};
int pos = 3;
// dest
little_endian_store_16(event, pos, mesh_pdu_src(pdu));
@ -343,7 +307,7 @@ static void mesh_configuration_client_relay_handler(mesh_model_t *mesh_model, me
const static mesh_operation_t mesh_configuration_client_model_operations[] = {
{ MESH_FOUNDATION_OPERATION_BEACON_STATUS, 1, mesh_configuration_client_beacon_status_handler },
{ MESH_FOUNDATION_OPERATION_COMPOSITION_DATA_STATUS, 1, mesh_configuration_client_composition_data_status_handler },
{ MESH_FOUNDATION_OPERATION_COMPOSITION_DATA_STATUS, 10, mesh_configuration_client_composition_data_status_handler },
{ MESH_FOUNDATION_OPERATION_DEFAULT_TTL_STATUS, 1, mesh_configuration_client_default_ttl_handler },
{ MESH_FOUNDATION_OPERATION_GATT_PROXY_STATUS, 1, mesh_configuration_client_gatt_proxy_handler },
{ MESH_FOUNDATION_OPERATION_RELAY_STATUS, 2, mesh_configuration_client_relay_handler },

View File

@ -127,7 +127,7 @@ static void generic_default_transition_time_status_handler(mesh_model_t *mesh_mo
uint8_t transition_time_gdtt = mesh_access_parser_get_u8(&parser);
uint8_t event[7] = {HCI_EVENT_MESH_META, 5, MESH_SUBEVENT_GENERIC_DEFAULT_TRANSITION_TIME_STATUS};
uint8_t event[7] = {HCI_EVENT_MESH_META, 5, MESH_SUBEVENT_GENERIC_DEFAULT_TRANSITION_TIME};
int pos = 3;
// dest
little_endian_store_16(event, pos, mesh_pdu_src(pdu));

View File

@ -230,7 +230,7 @@ static void generic_level_status_handler(mesh_model_t *mesh_model, mesh_pdu_t *
remaining_time_gdtt = mesh_access_parser_get_u8(&parser);
}
uint8_t event[14] = {HCI_EVENT_MESH_META, 12, MESH_SUBEVENT_GENERIC_LEVEL_STATUS};
uint8_t event[14] = {HCI_EVENT_MESH_META, 12, MESH_SUBEVENT_GENERIC_LEVEL};
int pos = 3;
// dest

View File

@ -155,7 +155,7 @@ static void generic_on_off_status_handler(mesh_model_t *mesh_model, mesh_pdu_t *
remaining_time_gdtt = mesh_access_parser_get_u8(&parser);
}
uint8_t event[12] = {HCI_EVENT_MESH_META, 10, MESH_SUBEVENT_GENERIC_ON_OFF_STATUS};
uint8_t event[12] = {HCI_EVENT_MESH_META, 10, MESH_SUBEVENT_GENERIC_ON_OFF};
int pos = 3;
// dest
little_endian_store_16(event, pos, mesh_pdu_src(pdu));