File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
include/zephyr/bluetooth/classic
subsys/bluetooth/host/classic Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -736,6 +736,17 @@ int bt_hfp_ag_roaming_status(struct bt_hfp_ag *ag, uint8_t status);
736
736
*/
737
737
int bt_hfp_ag_battery_level (struct bt_hfp_ag * ag , uint8_t level );
738
738
739
+ /** @brief Set service availability
740
+ *
741
+ * Set service availability.
742
+ *
743
+ * @param ag HFP AG object.
744
+ * @param available service availability
745
+ *
746
+ * @return 0 in case of success or negative value in case of error.
747
+ */
748
+ int bt_hfp_ag_service_availability (struct bt_hfp_ag * ag , bool available );
749
+
739
750
#ifdef __cplusplus
740
751
}
741
752
#endif
Original file line number Diff line number Diff line change @@ -4698,3 +4698,29 @@ int bt_hfp_ag_battery_level(struct bt_hfp_ag *ag, uint8_t level)
4698
4698
4699
4699
return err ;
4700
4700
}
4701
+
4702
+ int bt_hfp_ag_service_availability (struct bt_hfp_ag * ag , bool available )
4703
+ {
4704
+ int err ;
4705
+
4706
+ LOG_DBG ("" );
4707
+
4708
+ if (ag == NULL ) {
4709
+ return - EINVAL ;
4710
+ }
4711
+
4712
+ hfp_ag_lock (ag );
4713
+ if (ag -> state != BT_HFP_CONNECTED ) {
4714
+ hfp_ag_unlock (ag );
4715
+ return - ENOTCONN ;
4716
+ }
4717
+ hfp_ag_unlock (ag );
4718
+
4719
+ err = hfp_ag_update_indicator (ag , BT_HFP_AG_SERVICE_IND ,
4720
+ available ? 1 : 0 , NULL , NULL );
4721
+ if (err ) {
4722
+ LOG_ERR ("Fail to set service availability err :(%d)" , err );
4723
+ }
4724
+
4725
+ return err ;
4726
+ }
You can’t perform that action at this time.
0 commit comments