mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	fixes
This commit is contained in:
		| @@ -232,7 +232,11 @@ class BLEEvent { | ||||
|   const BLEScanResult &scan_result() const { return event_.gap.scan_result; } | ||||
|   esp_bt_status_t scan_complete_status() const { return event_.gap.scan_complete.status; } | ||||
|   esp_bt_status_t adv_complete_status() const { return event_.gap.adv_complete.status; } | ||||
|   const esp_ble_gap_cb_param_t::ble_read_rssi_cmpl_evt_param &read_rssi_complete() const { | ||||
|   const struct { | ||||
|     esp_bt_status_t status; | ||||
|     int8_t rssi; | ||||
|     esp_bd_addr_t remote_addr; | ||||
|   } & read_rssi_complete() const { | ||||
|     return event_.gap.read_rssi_complete; | ||||
|   } | ||||
|   const esp_ble_sec_t &security() const { return event_.gap.security; } | ||||
| @@ -390,8 +394,11 @@ class BLEEvent { | ||||
|   } | ||||
| }; | ||||
|  | ||||
| // Verify the gap_event union hasn't grown beyond expected size | ||||
| static_assert(sizeof(BLEEvent::gap_event) <= 80, "gap_event union has grown beyond 80 bytes"); | ||||
| // Verify the gap_event struct hasn't grown beyond expected size | ||||
| // Note: gap_event is a nested struct type, not directly accessible as BLEEvent::gap_event | ||||
| // We check the size through the union member instead | ||||
| static_assert(offsetof(BLEEvent, event_.gap) + sizeof(((BLEEvent *) 0)->event_.gap) <= 80, | ||||
|               "gap_event struct has grown beyond 80 bytes"); | ||||
|  | ||||
| // Verify esp_ble_sec_t fits within our union | ||||
| static_assert(sizeof(esp_ble_sec_t) <= 73, "esp_ble_sec_t is larger than BLEScanResult"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user