mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-25 15:41:00 +00:00
mesh: rename configuration client events, send raw data for composition data event
This commit is contained in:
parent
1937dd5208
commit
b0e589ac8a
@ -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 target_value optional, if value > 0, than remaining_time_ms must be read
|
||||||
* @param remaining_time_ms
|
* @param remaining_time_ms
|
||||||
*/
|
*/
|
||||||
#define MESH_SUBEVENT_GENERIC_ON_OFF_STATUS 0x31
|
#define MESH_SUBEVENT_GENERIC_ON_OFF 0x31
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @format 121224
|
* @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 target_value optional, if value > 0, than remaining_time_ms must be read
|
||||||
* @param remaining_time_ms
|
* @param remaining_time_ms
|
||||||
*/
|
*/
|
||||||
#define MESH_SUBEVENT_GENERIC_LEVEL_STATUS 0x32
|
#define MESH_SUBEVENT_GENERIC_LEVEL 0x32
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @format 1222211
|
* @format 1222211
|
||||||
@ -2927,7 +2927,7 @@ typedef uint8_t sm_key_t[16];
|
|||||||
* @param status
|
* @param status
|
||||||
* @param transition_time_gdtt
|
* @param transition_time_gdtt
|
||||||
*/
|
*/
|
||||||
#define MESH_SUBEVENT_GENERIC_DEFAULT_TRANSITION_TIME_STATUS 0x35
|
#define MESH_SUBEVENT_GENERIC_DEFAULT_TRANSITION_TIME 0x35
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @format 1211
|
* @format 1211
|
||||||
@ -2936,21 +2936,11 @@ typedef uint8_t sm_key_t[16];
|
|||||||
* @param foundation_status
|
* @param foundation_status
|
||||||
* @param secure_network_beacon_state
|
* @param secure_network_beacon_state
|
||||||
*/
|
*/
|
||||||
#define MESH_SUBEVENT_FOUNDATION_BEACON_STATUS 0x36
|
#define MESH_SUBEVENT_CONFIGURATION_BEACON 0x36
|
||||||
|
|
||||||
/**
|
// Composition Data has variable of element descriptions, with two lists of model lists
|
||||||
* @format 121122222
|
// Use .. getters to access data
|
||||||
* @param subevent_code
|
#define MESH_SUBEVENT_CONFIGURATION_COMPOSITION_DATA 0x37
|
||||||
* @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
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @format 1211
|
* @format 1211
|
||||||
@ -2959,7 +2949,7 @@ typedef uint8_t sm_key_t[16];
|
|||||||
* @param foundation_status
|
* @param foundation_status
|
||||||
* @param default_ttl
|
* @param default_ttl
|
||||||
*/
|
*/
|
||||||
#define MESH_SUBEVENT_FOUNDATION_DEFAULT_TTL_STATUS 0x38
|
#define MESH_SUBEVENT_CONFIGURATION_DEFAULT_TTL 0x38
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @format 1211
|
* @format 1211
|
||||||
@ -2968,7 +2958,7 @@ typedef uint8_t sm_key_t[16];
|
|||||||
* @param foundation_status
|
* @param foundation_status
|
||||||
* @param gatt_proxy_state
|
* @param gatt_proxy_state
|
||||||
*/
|
*/
|
||||||
#define MESH_SUBEVENT_FOUNDATION_GATT_PROXY_STATUS 0x39
|
#define MESH_SUBEVENT_CONFIGURATION_GATT_PROXY 0x39
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @format 121111
|
* @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_count the number of times that packet is transmitted for each packet that is relayed.
|
||||||
* @param retransmit_interval_ms retransmission interval in ms
|
* @param retransmit_interval_ms retransmission interval in ms
|
||||||
*/
|
*/
|
||||||
#define MESH_SUBEVENT_FOUNDATION_RELAY_STATUS 0x40
|
#define MESH_SUBEVENT_CONFIGURATION_RELAY 0x40
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -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
|
* @param event packet
|
||||||
* @return dest
|
* @return dest
|
||||||
* @note: btstack_type 2
|
* @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);
|
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
|
* @param event packet
|
||||||
* @return status
|
* @return status
|
||||||
* @note: btstack_type 1
|
* @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];
|
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
|
* @param event packet
|
||||||
* @return present_value
|
* @return present_value
|
||||||
* @note: btstack_type 1
|
* @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];
|
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
|
* @param event packet
|
||||||
* @return target_value
|
* @return target_value
|
||||||
* @note: btstack_type 1
|
* @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];
|
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
|
* @param event packet
|
||||||
* @return remaining_time_ms
|
* @return remaining_time_ms
|
||||||
* @note: btstack_type 4
|
* @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);
|
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
|
* @param event packet
|
||||||
* @return dest
|
* @return dest
|
||||||
* @note: btstack_type 2
|
* @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);
|
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
|
* @param event packet
|
||||||
* @return status
|
* @return status
|
||||||
* @note: btstack_type 1
|
* @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];
|
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
|
* @param event packet
|
||||||
* @return present_value
|
* @return present_value
|
||||||
* @note: btstack_type 2
|
* @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);
|
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
|
* @param event packet
|
||||||
* @return target_value
|
* @return target_value
|
||||||
* @note: btstack_type 2
|
* @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);
|
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
|
* @param event packet
|
||||||
* @return remaining_time_ms
|
* @return remaining_time_ms
|
||||||
* @note: btstack_type 4
|
* @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);
|
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
|
* @param event packet
|
||||||
* @return dest
|
* @return dest
|
||||||
* @note: btstack_type 2
|
* @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);
|
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
|
* @param event packet
|
||||||
* @return status
|
* @return status
|
||||||
* @note: btstack_type 1
|
* @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];
|
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
|
* @param event packet
|
||||||
* @return transition_time_gdtt
|
* @return transition_time_gdtt
|
||||||
* @note: btstack_type 1
|
* @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];
|
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
|
* @param event packet
|
||||||
* @return dest
|
* @return dest
|
||||||
* @note: btstack_type 2
|
* @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);
|
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
|
* @param event packet
|
||||||
* @return foundation_status
|
* @return foundation_status
|
||||||
* @note: btstack_type 1
|
* @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];
|
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
|
* @param event packet
|
||||||
* @return secure_network_beacon_state
|
* @return secure_network_beacon_state
|
||||||
* @note: btstack_type 1
|
* @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];
|
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
|
* @param event packet
|
||||||
* @return dest
|
* @return dest
|
||||||
* @note: btstack_type 2
|
* @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);
|
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
|
* @param event packet
|
||||||
* @return foundation_status
|
* @return foundation_status
|
||||||
* @note: btstack_type 1
|
* @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];
|
return event[5];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief Get field page from event MESH_SUBEVENT_FOUNDATION_COMPOSITION_DATA_STATUS
|
* @brief Get field default_ttl from event MESH_SUBEVENT_CONFIGURATION_DEFAULT_TTL
|
||||||
* @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
|
|
||||||
* @param event packet
|
* @param event packet
|
||||||
* @return default_ttl
|
* @return default_ttl
|
||||||
* @note: btstack_type 1
|
* @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];
|
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
|
* @param event packet
|
||||||
* @return dest
|
* @return dest
|
||||||
* @note: btstack_type 2
|
* @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);
|
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
|
* @param event packet
|
||||||
* @return foundation_status
|
* @return foundation_status
|
||||||
* @note: btstack_type 1
|
* @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];
|
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
|
* @param event packet
|
||||||
* @return gatt_proxy_state
|
* @return gatt_proxy_state
|
||||||
* @note: btstack_type 1
|
* @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];
|
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
|
* @param event packet
|
||||||
* @return dest
|
* @return dest
|
||||||
* @note: btstack_type 2
|
* @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);
|
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
|
* @param event packet
|
||||||
* @return foundation_status
|
* @return foundation_status
|
||||||
* @note: btstack_type 1
|
* @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];
|
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
|
* @param event packet
|
||||||
* @return relay
|
* @return relay
|
||||||
* @note: btstack_type 1
|
* @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];
|
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
|
* @param event packet
|
||||||
* @return retransmit_count
|
* @return retransmit_count
|
||||||
* @note: btstack_type 1
|
* @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];
|
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
|
* @param event packet
|
||||||
* @return retransmit_interval_ms
|
* @return retransmit_interval_ms
|
||||||
* @note: btstack_type 1
|
* @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];
|
return event[8];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,94 +230,58 @@ uint8_t mesh_configuration_client_send_relay_set(mesh_model_t * mesh_model, uint
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Model Operations
|
// Model Operations
|
||||||
static void mesh_configuration_client_beacon_status_handler(mesh_model_t *mesh_model, 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
|
||||||
|
|
||||||
|
// 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];
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
|
||||||
|
|
||||||
|
(*mesh_model->model_packet_handler)(HCI_EVENT_PACKET, 0, event, pos);
|
||||||
|
mesh_access_message_processed(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_state_t parser;
|
||||||
mesh_access_parser_init(&parser, (mesh_pdu_t*) pdu);
|
mesh_access_parser_init(&parser, (mesh_pdu_t*) pdu);
|
||||||
|
|
||||||
uint8_t beacon_status = mesh_access_parser_get_u8(&parser);
|
uint8_t value = mesh_access_parser_get_u8(&parser);
|
||||||
|
|
||||||
uint8_t event[7] = {HCI_EVENT_MESH_META, 5, MESH_SUBEVENT_FOUNDATION_BEACON_STATUS};
|
uint8_t event[7] = {HCI_EVENT_MESH_META, 5, subevent_type};
|
||||||
int pos = 3;
|
int pos = 3;
|
||||||
// dest
|
// dest
|
||||||
little_endian_store_16(event, pos, mesh_pdu_src(pdu));
|
little_endian_store_16(event, pos, mesh_pdu_src(pdu));
|
||||||
pos += 2;
|
pos += 2;
|
||||||
event[pos++] = ERROR_CODE_SUCCESS;
|
event[pos++] = ERROR_CODE_SUCCESS;
|
||||||
event[pos++] = beacon_status;
|
event[pos++] = value;
|
||||||
|
|
||||||
(*mesh_model->model_packet_handler)(HCI_EVENT_PACKET, 0, event, pos);
|
(*mesh_model->model_packet_handler)(HCI_EVENT_PACKET, 0, event, pos);
|
||||||
mesh_access_message_processed(pdu);
|
mesh_access_message_processed(pdu);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mesh_configuration_client_composition_data_status_handler(mesh_model_t *mesh_model, mesh_pdu_t * pdu){
|
static void mesh_configuration_client_beacon_status_handler(mesh_model_t *mesh_model, mesh_pdu_t * pdu){
|
||||||
mesh_access_parser_state_t parser;
|
mesh_configuration_client_handle_uint8_value(mesh_model, pdu, MESH_SUBEVENT_CONFIGURATION_BEACON);
|
||||||
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);
|
|
||||||
|
|
||||||
// TODO: list of element descriptions, see Table 4.4
|
|
||||||
|
|
||||||
uint8_t event[17] = {HCI_EVENT_MESH_META, 5, MESH_SUBEVENT_FOUNDATION_COMPOSITION_DATA_STATUS};
|
|
||||||
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;
|
|
||||||
|
|
||||||
(*mesh_model->model_packet_handler)(HCI_EVENT_PACKET, 0, event, pos);
|
|
||||||
mesh_access_message_processed(pdu);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mesh_configuration_client_default_ttl_handler(mesh_model_t *mesh_model, mesh_pdu_t * pdu){
|
static void mesh_configuration_client_default_ttl_handler(mesh_model_t *mesh_model, mesh_pdu_t * pdu){
|
||||||
mesh_access_parser_state_t parser;
|
mesh_configuration_client_handle_uint8_value(mesh_model, pdu, MESH_SUBEVENT_CONFIGURATION_DEFAULT_TTL);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mesh_configuration_client_gatt_proxy_handler(mesh_model_t *mesh_model, mesh_pdu_t * pdu){
|
static void mesh_configuration_client_gatt_proxy_handler(mesh_model_t *mesh_model, mesh_pdu_t * pdu){
|
||||||
mesh_access_parser_state_t parser;
|
mesh_configuration_client_handle_uint8_value(mesh_model, pdu, MESH_SUBEVENT_CONFIGURATION_GATT_PROXY);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mesh_configuration_client_relay_handler(mesh_model_t *mesh_model, mesh_pdu_t * pdu){
|
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 relay = mesh_access_parser_get_u8(&parser);
|
||||||
uint8_t retransmition = 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;
|
int pos = 3;
|
||||||
// dest
|
// dest
|
||||||
little_endian_store_16(event, pos, mesh_pdu_src(pdu));
|
little_endian_store_16(event, pos, mesh_pdu_src(pdu));
|
||||||
@ -342,11 +306,11 @@ static void mesh_configuration_client_relay_handler(mesh_model_t *mesh_model, me
|
|||||||
}
|
}
|
||||||
|
|
||||||
const static mesh_operation_t mesh_configuration_client_model_operations[] = {
|
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_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_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_GATT_PROXY_STATUS, 1, mesh_configuration_client_gatt_proxy_handler },
|
||||||
{ MESH_FOUNDATION_OPERATION_RELAY_STATUS, 2, mesh_configuration_client_relay_handler },
|
{ MESH_FOUNDATION_OPERATION_RELAY_STATUS, 2, mesh_configuration_client_relay_handler },
|
||||||
{ 0, 0, NULL }
|
{ 0, 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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 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;
|
int pos = 3;
|
||||||
// dest
|
// dest
|
||||||
little_endian_store_16(event, pos, mesh_pdu_src(pdu));
|
little_endian_store_16(event, pos, mesh_pdu_src(pdu));
|
||||||
|
@ -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);
|
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;
|
int pos = 3;
|
||||||
// dest
|
// dest
|
||||||
|
@ -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);
|
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;
|
int pos = 3;
|
||||||
// dest
|
// dest
|
||||||
little_endian_store_16(event, pos, mesh_pdu_src(pdu));
|
little_endian_store_16(event, pos, mesh_pdu_src(pdu));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user