mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	bluez5: correct parsing order for HF indicator 2 based battery status
Since "AT+BIND=" was before "AT+BIND=?", the seconds statement was never matched.
This commit is contained in:
		
							parent
							
								
									eff67c3c03
								
							
						
					
					
						commit
						a1777d00e3
					
				
					 1 changed files with 7 additions and 7 deletions
				
			
		| 
						 | 
					@ -813,17 +813,17 @@ static bool rfcomm_hfp_ag(struct spa_source *source, char* buf)
 | 
				
			||||||
			spa_log_debug(backend->log, NAME": RFCOMM receive unsupported VGS gain: %s", buf);
 | 
								spa_log_debug(backend->log, NAME": RFCOMM receive unsupported VGS gain: %s", buf);
 | 
				
			||||||
			rfcomm_send_reply(rfcomm, "ERROR");
 | 
								rfcomm_send_reply(rfcomm, "ERROR");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else if (strncmp(buf, "AT+BIND=", 8) == 0) {
 | 
						} else if (spa_strstartswith(buf, "AT+BIND=?")) {
 | 
				
			||||||
 | 
							rfcomm_send_reply(rfcomm, "+BIND: (2)");
 | 
				
			||||||
 | 
							rfcomm_send_reply(rfcomm, "OK");
 | 
				
			||||||
 | 
						} else if (spa_strstartswith(buf, "AT+BIND?")) {
 | 
				
			||||||
 | 
							rfcomm_send_reply(rfcomm, "+BIND: 2,1");
 | 
				
			||||||
 | 
							rfcomm_send_reply(rfcomm, "OK");
 | 
				
			||||||
 | 
						} else if (spa_strstartswith(buf, "AT+BIND=")) {
 | 
				
			||||||
		// BIND=... should return a comma separated list of indicators and
 | 
							// BIND=... should return a comma separated list of indicators and
 | 
				
			||||||
		// 2 should be among the other numbers telling that battery charge
 | 
							// 2 should be among the other numbers telling that battery charge
 | 
				
			||||||
		// is supported
 | 
							// is supported
 | 
				
			||||||
		rfcomm_send_reply(rfcomm, "OK");
 | 
							rfcomm_send_reply(rfcomm, "OK");
 | 
				
			||||||
	} else if (strncmp(buf, "AT+BIND=?", 9) == 0) {
 | 
					 | 
				
			||||||
		rfcomm_send_reply(rfcomm, "+BIND: (2)");
 | 
					 | 
				
			||||||
		rfcomm_send_reply(rfcomm, "OK");
 | 
					 | 
				
			||||||
	} else if (strncmp(buf, "AT+BIND?", 8) == 0) {
 | 
					 | 
				
			||||||
		rfcomm_send_reply(rfcomm, "+BIND: 2,1");
 | 
					 | 
				
			||||||
		rfcomm_send_reply(rfcomm, "OK");
 | 
					 | 
				
			||||||
	} else if (sscanf(buf, "AT+BIEV=%u,%u", &indicator, &indicator_value) == 2) {
 | 
						} else if (sscanf(buf, "AT+BIEV=%u,%u", &indicator, &indicator_value) == 2) {
 | 
				
			||||||
		if (indicator == SPA_BT_HFP_HF_INDICATOR_BATTERY_LEVEL) {
 | 
							if (indicator == SPA_BT_HFP_HF_INDICATOR_BATTERY_LEVEL) {
 | 
				
			||||||
			// Battery level is reported in range 0-100
 | 
								// Battery level is reported in range 0-100
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue