[PR] CONTFIG.TXT in FAT View [mynewt-core]

2024-04-26 Thread via GitHub


kasjer opened a new pull request, #3210:
URL: https://github.com/apache/mynewt-core/pull/3210

   This adds file with contents of sys/config variables visible in FAT view
   
   Signed-off-by: Jerzy Kasenberg 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



(mynewt-newt) branch master updated: Don't panic in case of other error types in NewtUsage

2024-04-26 Thread jerzy
This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git


The following commit(s) were added to refs/heads/master by this push:
 new 1686c678 Don't panic in case of other error types in NewtUsage
1686c678 is described below

commit 1686c67862d9c13a433f1ae11979dc5b0043832a
Author: Michal Gorecki 
AuthorDate: Mon Apr 15 16:48:08 2024 +0200

Don't panic in case of other error types in NewtUsage

It does not make sense to panic before printing error
---
 newt/cli/util.go | 2 --
 1 file changed, 2 deletions(-)

diff --git a/newt/cli/util.go b/newt/cli/util.go
index 75f60282..ccbb0bc4 100644
--- a/newt/cli/util.go
+++ b/newt/cli/util.go
@@ -50,8 +50,6 @@ func NewtUsage(cmd *cobra.Command, err error) {
log.Debugf("%+v", err)
} else if ne, ok := err.(*util.NewtError); ok {
log.Debugf("%s", ne.StackTrace)
-   } else {
-   panic(fmt.Sprintf("unexpected error type: %T", err))
}
 
fmt.Fprintf(os.Stderr, "Error: %s\n", err.Error())



Re: [PR] Don't panic in case of other error types in NewtUsage [mynewt-newt]

2024-04-26 Thread via GitHub


kasjer merged PR #553:
URL: https://github.com/apache/mynewt-newt/pull/553


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[PR] hw/bsp: Add support for WeAct STM32G431 board [mynewt-core]

2024-04-26 Thread via GitHub


kasjer opened a new pull request, #3209:
URL: https://github.com/apache/mynewt-core/pull/3209

   This adds support for chip STM32G431 board with just one area for bootloader.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Add Broadcast Audio Scan Service [mynewt-nimble]

2024-04-26 Thread via GitHub


MariuszSkamra commented on code in PR #1691:
URL: https://github.com/apache/mynewt-nimble/pull/1691#discussion_r1580855182


##
nimble/host/audio/services/bass/include/services/bass/ble_audio_svc_bass.h:
##
@@ -0,0 +1,466 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_SVC_BASS_
+#define H_BLE_AUDIO_SVC_BASS_
+
+#include 
+#include "audio/ble_audio.h"
+#include "syscfg/syscfg.h"
+
+/**
+ * @file ble_audio_svc_bass.h
+ *
+ * @brief Bluetooth LE Audio BAS Service
+ *
+ * This header file provides the public API for interacting with the BASS 
package.
+ *
+ * @defgroup ble_audio_svc_bass Bluetooth LE Audio BASS package
+ * @ingroup bt_host
+ * @{
+ *
+ * This package implements BASS service. Receiver states can be modified with 
setter functions
+ * or GATT writes to Control Point characteristic. Operations on Control Point 
like Add Source or
+ * Modify Source can be accepted or rejected by application by registering 
accept function callback.
+ * Accessing Control Point characteristic, or Successful modification or 
Receiver State will lead to
+ * emission of one of BLE_SVC_AUDIO_BASS events.
+ *
+ */
+
+/** BLE AUDIO BASS Maximum Subgroup Number */
+#define BLE_SVC_AUDIO_BASS_SUB_NUM_MAX \
+MYNEWT_VAL(BLE_SVC_AUDIO_BASS_SUB_NUM_MAX)
+
+/** BLE AUDIO BASS characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_UUID160x184F
+
+/** BLE AUDIO BASS Control Point characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BASS_CP0x2BC7
+
+/** BLE AUDIO BASS Broadcast Receiver State characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BROADCAST_RECEIVE_STATE0x2BC8
+
+/** BLE AUDIO BASS Add Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_ADD_SOURCE  0x01
+
+/** BLE AUDIO BASS Modify Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_MODIFY_SOURCE   0x02
+
+/** BLE AUDIO BASS Remove Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_REMOVE_SOURCE   0x03
+
+/** BLE AUDIO BASS Error: OP Code not supported */
+#define BLE_SVC_AUDIO_BASS_ERR_OPCODE_NOT_SUPPORTED  0x80
+
+/** BLE AUDIO BASS Error: Invalid Source ID */
+#define BLE_SVC_AUDIO_BASS_ERR_INVALID_SOURCE_ID 0x81
+
+/** BLE AUDIO BASS Encryption States */
+enum ble_svc_audio_bass_big_enc {
+/** BLE AUDIO BASS BIG Encryption: Not Encrypted */
+BLE_SVC_AUDIO_BASS_BIG_ENC_NOT_ENCRYPTED,
+
+/** BLE AUDIO BASS BIG Encryption: Broadcast Code Required */
+BLE_SVC_AUDIO_BASS_BIG_ENC_BROADCAST_CODE_REQ,
+
+/** BLE AUDIO BASS BIG Encryption: Decrypting */
+BLE_SVC_AUDIO_BASS_BIG_ENC_DECRYPTING,
+
+/** BLE AUDIO BASS BIG Encryption: Bad Code */
+BLE_SVC_AUDIO_BASS_BIG_ENC_BAD_CODE
+};
+
+/** BLE AUDIO BASS PA Sync parameters, valid fo Modify Source operation */
+enum ble_svc_audio_bass_pa_sync {
+/** BLE AUDIO BASS PA Sync: Do not synchronize to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_DO_NOT_SYNC,
+
+/** BLE AUDIO BASS PA Sync: Synchronize to PA – PAST available */
+BLE_SVC_AUDIO_BASS_PA_SYNC_SYNC_PAST_AVAILABLE,
+
+/** BLE AUDIO BASS PA Sync: Synchronize to PA – PAST not available */
+BLE_SVC_AUDIO_BASS_PA_SYNC_SYNC_PAST_NOT_AVAILABLE,
+
+/**
+ * BLE AUDIO BASS PA Sync: reserved for future use.
+ * This shall be always last value in this enum
+ */
+BLE_SVC_AUDIO_BASS_PA_SYNC_RFU
+};
+
+/** BLE AUDIO BASS Broadcast Receiver: PA Sync States */
+enum ble_svc_audio_bass_pa_sync_state {
+/** BLE AUDIO BASS PA Sync State: Not synchronized to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_NOT_SYNCED,
+
+/** BLE AUDIO BASS PA Sync State: SyncInfo Request */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNC_INFO_REQ,
+
+/** BLE AUDIO BASS PA Sync State: Synchronized to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNCED,
+
+/** BLE AUDIO BASS PA Sync State: Failed to synchronize to PAA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNCED_FAILED,
+
+/** BLE AUDIO BASS PA Sync State: No PAST */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_NO_PAST
+};
+
+/** BLE AUDIO 

Re: [PR] nimble/host: Add Broadcast Audio Scan Service [mynewt-nimble]

2024-04-26 Thread via GitHub


MariuszSkamra commented on code in PR #1691:
URL: https://github.com/apache/mynewt-nimble/pull/1691#discussion_r1580855182


##
nimble/host/audio/services/bass/include/services/bass/ble_audio_svc_bass.h:
##
@@ -0,0 +1,466 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_SVC_BASS_
+#define H_BLE_AUDIO_SVC_BASS_
+
+#include 
+#include "audio/ble_audio.h"
+#include "syscfg/syscfg.h"
+
+/**
+ * @file ble_audio_svc_bass.h
+ *
+ * @brief Bluetooth LE Audio BAS Service
+ *
+ * This header file provides the public API for interacting with the BASS 
package.
+ *
+ * @defgroup ble_audio_svc_bass Bluetooth LE Audio BASS package
+ * @ingroup bt_host
+ * @{
+ *
+ * This package implements BASS service. Receiver states can be modified with 
setter functions
+ * or GATT writes to Control Point characteristic. Operations on Control Point 
like Add Source or
+ * Modify Source can be accepted or rejected by application by registering 
accept function callback.
+ * Accessing Control Point characteristic, or Successful modification or 
Receiver State will lead to
+ * emission of one of BLE_SVC_AUDIO_BASS events.
+ *
+ */
+
+/** BLE AUDIO BASS Maximum Subgroup Number */
+#define BLE_SVC_AUDIO_BASS_SUB_NUM_MAX \
+MYNEWT_VAL(BLE_SVC_AUDIO_BASS_SUB_NUM_MAX)
+
+/** BLE AUDIO BASS characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_UUID160x184F
+
+/** BLE AUDIO BASS Control Point characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BASS_CP0x2BC7
+
+/** BLE AUDIO BASS Broadcast Receiver State characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BROADCAST_RECEIVE_STATE0x2BC8
+
+/** BLE AUDIO BASS Add Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_ADD_SOURCE  0x01
+
+/** BLE AUDIO BASS Modify Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_MODIFY_SOURCE   0x02
+
+/** BLE AUDIO BASS Remove Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_REMOVE_SOURCE   0x03
+
+/** BLE AUDIO BASS Error: OP Code not supported */
+#define BLE_SVC_AUDIO_BASS_ERR_OPCODE_NOT_SUPPORTED  0x80
+
+/** BLE AUDIO BASS Error: Invalid Source ID */
+#define BLE_SVC_AUDIO_BASS_ERR_INVALID_SOURCE_ID 0x81
+
+/** BLE AUDIO BASS Encryption States */
+enum ble_svc_audio_bass_big_enc {
+/** BLE AUDIO BASS BIG Encryption: Not Encrypted */
+BLE_SVC_AUDIO_BASS_BIG_ENC_NOT_ENCRYPTED,
+
+/** BLE AUDIO BASS BIG Encryption: Broadcast Code Required */
+BLE_SVC_AUDIO_BASS_BIG_ENC_BROADCAST_CODE_REQ,
+
+/** BLE AUDIO BASS BIG Encryption: Decrypting */
+BLE_SVC_AUDIO_BASS_BIG_ENC_DECRYPTING,
+
+/** BLE AUDIO BASS BIG Encryption: Bad Code */
+BLE_SVC_AUDIO_BASS_BIG_ENC_BAD_CODE
+};
+
+/** BLE AUDIO BASS PA Sync parameters, valid fo Modify Source operation */
+enum ble_svc_audio_bass_pa_sync {
+/** BLE AUDIO BASS PA Sync: Do not synchronize to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_DO_NOT_SYNC,
+
+/** BLE AUDIO BASS PA Sync: Synchronize to PA – PAST available */
+BLE_SVC_AUDIO_BASS_PA_SYNC_SYNC_PAST_AVAILABLE,
+
+/** BLE AUDIO BASS PA Sync: Synchronize to PA – PAST not available */
+BLE_SVC_AUDIO_BASS_PA_SYNC_SYNC_PAST_NOT_AVAILABLE,
+
+/**
+ * BLE AUDIO BASS PA Sync: reserved for future use.
+ * This shall be always last value in this enum
+ */
+BLE_SVC_AUDIO_BASS_PA_SYNC_RFU
+};
+
+/** BLE AUDIO BASS Broadcast Receiver: PA Sync States */
+enum ble_svc_audio_bass_pa_sync_state {
+/** BLE AUDIO BASS PA Sync State: Not synchronized to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_NOT_SYNCED,
+
+/** BLE AUDIO BASS PA Sync State: SyncInfo Request */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNC_INFO_REQ,
+
+/** BLE AUDIO BASS PA Sync State: Synchronized to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNCED,
+
+/** BLE AUDIO BASS PA Sync State: Failed to synchronize to PAA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNCED_FAILED,
+
+/** BLE AUDIO BASS PA Sync State: No PAST */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_NO_PAST
+};
+
+/** BLE AUDIO 

Re: [PR] nimble/host: Add Broadcast Audio Scan Service [mynewt-nimble]

2024-04-26 Thread via GitHub


KKopyscinski commented on code in PR #1691:
URL: https://github.com/apache/mynewt-nimble/pull/1691#discussion_r1580854491


##
nimble/host/audio/services/bass/include/services/bass/ble_audio_svc_bass.h:
##
@@ -0,0 +1,455 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_SVC_BASS_
+#define H_BLE_AUDIO_SVC_BASS_
+
+#include 
+#include "audio/ble_audio.h"
+#include "syscfg/syscfg.h"
+
+/**
+ * @file ble_audio_svc_bass.h
+ *
+ * @brief Bluetooth LE Audio BAS Service
+ *
+ * This header file provides the public API for interacting with the BASS 
package.
+ *
+ * @defgroup ble_audio_svc_bass Bluetooth LE Audio BASS package
+ * @ingroup bt_host
+ * @{
+ *
+ * This package implements BASS service. Receiver states can be modified with 
setter functions
+ * or GATT writes to Control Point characteristic. Operations on Control Point 
like Add Source or
+ * Modify Source can be accepted or rejected by application by registering 
accept function callback.
+ * Accessing Control Point characteristic, or Successful modification or 
Receiver State will lead to
+ * emission of one of BLE_SVC_AUDIO_BASS events.
+ *
+ */
+
+/** BLE AUDIO BASS Maximum Subgroup Number */
+#define BLE_SVC_AUDIO_BASS_SUB_NUM_MAX \
+MYNEWT_VAL(BLE_SVC_AUDIO_BASS_SUB_NUM_MAX)
+
+/** BLE AUDIO BASS characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_UUID160x184F
+
+/** BLE AUDIO BASS Control Point characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BASS_CP0x2BC7
+
+/** BLE AUDIO BASS Broadcast Receiver State characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BROADCAST_RECEIVE_STATE0x2BC8
+
+/** Value of not assigned Source ID of Receiver State */
+#define BLE_SVC_AUDIO_BASS_RECEIVE_STATE_SRC_ID_NONE 0xFF
+
+/** BLE AUDIO BASS Add Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_ADD_SOURCE  0x01
+
+/** BLE AUDIO BASS Modify Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_MODIFY_SOURCE   0x02
+
+/** BLE AUDIO BASS Remove Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_REMOVE_SOURCE   0x03
+
+/** BLE AUDIO BASS Error: OP Code not supported */
+#define BLE_SVC_AUDIO_BASS_ERR_OPCODE_NOT_SUPPORTED  0x80
+
+/** BLE AUDIO BASS Error: Invalid Source ID */
+#define BLE_SVC_AUDIO_BASS_ERR_INVALID_SOURCE_ID 0x81
+
+/** BLE AUDIO BASS Encryption States */
+enum ble_svc_audio_bass_big_enc {
+/** BLE AUDIO BASS BIG Encryption: Not Encrypted */
+BLE_SVC_AUDIO_BASS_BIG_ENC_NOT_ENCRYPTED,
+
+/** BLE AUDIO BASS BIG Encryption: Broadcast Code Required */
+BLE_SVC_AUDIO_BASS_BIG_ENC_BROADCAST_CODE_REQ,
+
+/** BLE AUDIO BASS BIG Encryption: Decrypting */
+BLE_SVC_AUDIO_BASS_BIG_ENC_DECRYPTING,
+
+/** BLE AUDIO BASS BIG Encryption: Bad Code */
+BLE_SVC_AUDIO_BASS_BIG_ENC_BAD_CODE
+};
+
+/** BLE AUDIO BASS PA Sync parameters, valid fo Modify Source operation */
+enum ble_svc_audio_bass_pa_sync {
+/** BLE AUDIO BASS PA Sync: Do not synchronize to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_DO_NOT_SYNC,
+
+/** BLE AUDIO BASS PA Sync: Synchronize to PA – PAST available */
+BLE_SVC_AUDIO_BASS_PA_SYNC_SYNC_PAST_AVAILABLE,
+
+/** BLE AUDIO BASS PA Sync: Synchronize to PA – PAST not available */
+BLE_SVC_AUDIO_BASS_PA_SYNC_SYNC_PAST_NOT_AVAILABLE,
+
+/**
+ * BLE AUDIO BASS PA Sync: reserved for future use.
+ * This shall be always last value in this enum
+ */
+BLE_SVC_AUDIO_BASS_PA_SYNC_RFU
+};
+
+/** BLE AUDIO BASS Broadcast Receiver: PA Sync States */
+enum ble_svc_audio_bass_pa_sync_state {
+/** BLE AUDIO BASS PA Sync State: Not synchronized to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_NOT_SYNCED,
+
+/** BLE AUDIO BASS PA Sync State: SyncInfo Request */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNC_INFO_REQ,
+
+/** BLE AUDIO BASS PA Sync State: Synchronized to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNCED,
+
+/** BLE AUDIO BASS PA Sync State: Failed to synchronize to PAA */
+

Re: [PR] nimble/host: Add Broadcast Audio Scan Service [mynewt-nimble]

2024-04-26 Thread via GitHub


MariuszSkamra commented on code in PR #1691:
URL: https://github.com/apache/mynewt-nimble/pull/1691#discussion_r1580853083


##
nimble/host/audio/services/bass/include/services/bass/ble_audio_svc_bass.h:
##
@@ -0,0 +1,455 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_SVC_BASS_
+#define H_BLE_AUDIO_SVC_BASS_
+
+#include 
+#include "audio/ble_audio.h"
+#include "syscfg/syscfg.h"
+
+/**
+ * @file ble_audio_svc_bass.h
+ *
+ * @brief Bluetooth LE Audio BAS Service
+ *
+ * This header file provides the public API for interacting with the BASS 
package.
+ *
+ * @defgroup ble_audio_svc_bass Bluetooth LE Audio BASS package
+ * @ingroup bt_host
+ * @{
+ *
+ * This package implements BASS service. Receiver states can be modified with 
setter functions
+ * or GATT writes to Control Point characteristic. Operations on Control Point 
like Add Source or
+ * Modify Source can be accepted or rejected by application by registering 
accept function callback.
+ * Accessing Control Point characteristic, or Successful modification or 
Receiver State will lead to
+ * emission of one of BLE_SVC_AUDIO_BASS events.
+ *
+ */
+
+/** BLE AUDIO BASS Maximum Subgroup Number */
+#define BLE_SVC_AUDIO_BASS_SUB_NUM_MAX \
+MYNEWT_VAL(BLE_SVC_AUDIO_BASS_SUB_NUM_MAX)
+
+/** BLE AUDIO BASS characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_UUID160x184F
+
+/** BLE AUDIO BASS Control Point characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BASS_CP0x2BC7
+
+/** BLE AUDIO BASS Broadcast Receiver State characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BROADCAST_RECEIVE_STATE0x2BC8
+
+/** Value of not assigned Source ID of Receiver State */
+#define BLE_SVC_AUDIO_BASS_RECEIVE_STATE_SRC_ID_NONE 0xFF
+
+/** BLE AUDIO BASS Add Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_ADD_SOURCE  0x01
+
+/** BLE AUDIO BASS Modify Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_MODIFY_SOURCE   0x02
+
+/** BLE AUDIO BASS Remove Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_REMOVE_SOURCE   0x03
+
+/** BLE AUDIO BASS Error: OP Code not supported */
+#define BLE_SVC_AUDIO_BASS_ERR_OPCODE_NOT_SUPPORTED  0x80
+
+/** BLE AUDIO BASS Error: Invalid Source ID */
+#define BLE_SVC_AUDIO_BASS_ERR_INVALID_SOURCE_ID 0x81
+
+/** BLE AUDIO BASS Encryption States */
+enum ble_svc_audio_bass_big_enc {
+/** BLE AUDIO BASS BIG Encryption: Not Encrypted */
+BLE_SVC_AUDIO_BASS_BIG_ENC_NOT_ENCRYPTED,
+
+/** BLE AUDIO BASS BIG Encryption: Broadcast Code Required */
+BLE_SVC_AUDIO_BASS_BIG_ENC_BROADCAST_CODE_REQ,
+
+/** BLE AUDIO BASS BIG Encryption: Decrypting */
+BLE_SVC_AUDIO_BASS_BIG_ENC_DECRYPTING,
+
+/** BLE AUDIO BASS BIG Encryption: Bad Code */
+BLE_SVC_AUDIO_BASS_BIG_ENC_BAD_CODE
+};
+
+/** BLE AUDIO BASS PA Sync parameters, valid fo Modify Source operation */
+enum ble_svc_audio_bass_pa_sync {
+/** BLE AUDIO BASS PA Sync: Do not synchronize to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_DO_NOT_SYNC,
+
+/** BLE AUDIO BASS PA Sync: Synchronize to PA – PAST available */
+BLE_SVC_AUDIO_BASS_PA_SYNC_SYNC_PAST_AVAILABLE,
+
+/** BLE AUDIO BASS PA Sync: Synchronize to PA – PAST not available */
+BLE_SVC_AUDIO_BASS_PA_SYNC_SYNC_PAST_NOT_AVAILABLE,
+
+/**
+ * BLE AUDIO BASS PA Sync: reserved for future use.
+ * This shall be always last value in this enum
+ */
+BLE_SVC_AUDIO_BASS_PA_SYNC_RFU
+};
+
+/** BLE AUDIO BASS Broadcast Receiver: PA Sync States */
+enum ble_svc_audio_bass_pa_sync_state {
+/** BLE AUDIO BASS PA Sync State: Not synchronized to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_NOT_SYNCED,
+
+/** BLE AUDIO BASS PA Sync State: SyncInfo Request */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNC_INFO_REQ,
+
+/** BLE AUDIO BASS PA Sync State: Synchronized to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNCED,
+
+/** BLE AUDIO BASS PA Sync State: Failed to synchronize to PAA */
+

Re: [PR] nimble/host: Add Broadcast Audio Scan Service [mynewt-nimble]

2024-04-26 Thread via GitHub


MariuszSkamra commented on code in PR #1691:
URL: https://github.com/apache/mynewt-nimble/pull/1691#discussion_r1580851817


##
nimble/host/audio/services/bass/include/services/bass/ble_audio_svc_bass.h:
##
@@ -0,0 +1,455 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_SVC_BASS_
+#define H_BLE_AUDIO_SVC_BASS_
+
+#include 
+#include "audio/ble_audio.h"
+#include "syscfg/syscfg.h"
+
+/**
+ * @file ble_audio_svc_bass.h
+ *
+ * @brief Bluetooth LE Audio BAS Service
+ *
+ * This header file provides the public API for interacting with the BASS 
package.
+ *
+ * @defgroup ble_audio_svc_bass Bluetooth LE Audio BASS package
+ * @ingroup bt_host
+ * @{
+ *
+ * This package implements BASS service. Receiver states can be modified with 
setter functions
+ * or GATT writes to Control Point characteristic. Operations on Control Point 
like Add Source or
+ * Modify Source can be accepted or rejected by application by registering 
accept function callback.
+ * Accessing Control Point characteristic, or Successful modification or 
Receiver State will lead to
+ * emission of one of BLE_SVC_AUDIO_BASS events.
+ *
+ */
+
+/** BLE AUDIO BASS Maximum Subgroup Number */
+#define BLE_SVC_AUDIO_BASS_SUB_NUM_MAX \
+MYNEWT_VAL(BLE_SVC_AUDIO_BASS_SUB_NUM_MAX)
+
+/** BLE AUDIO BASS characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_UUID160x184F
+
+/** BLE AUDIO BASS Control Point characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BASS_CP0x2BC7
+
+/** BLE AUDIO BASS Broadcast Receiver State characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BROADCAST_RECEIVE_STATE0x2BC8
+
+/** Value of not assigned Source ID of Receiver State */
+#define BLE_SVC_AUDIO_BASS_RECEIVE_STATE_SRC_ID_NONE 0xFF
+
+/** BLE AUDIO BASS Add Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_ADD_SOURCE  0x01
+
+/** BLE AUDIO BASS Modify Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_MODIFY_SOURCE   0x02
+
+/** BLE AUDIO BASS Remove Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_REMOVE_SOURCE   0x03
+
+/** BLE AUDIO BASS Error: OP Code not supported */
+#define BLE_SVC_AUDIO_BASS_ERR_OPCODE_NOT_SUPPORTED  0x80
+
+/** BLE AUDIO BASS Error: Invalid Source ID */
+#define BLE_SVC_AUDIO_BASS_ERR_INVALID_SOURCE_ID 0x81
+
+/** BLE AUDIO BASS Encryption States */
+enum ble_svc_audio_bass_big_enc {
+/** BLE AUDIO BASS BIG Encryption: Not Encrypted */
+BLE_SVC_AUDIO_BASS_BIG_ENC_NOT_ENCRYPTED,
+
+/** BLE AUDIO BASS BIG Encryption: Broadcast Code Required */
+BLE_SVC_AUDIO_BASS_BIG_ENC_BROADCAST_CODE_REQ,
+
+/** BLE AUDIO BASS BIG Encryption: Decrypting */
+BLE_SVC_AUDIO_BASS_BIG_ENC_DECRYPTING,
+
+/** BLE AUDIO BASS BIG Encryption: Bad Code */
+BLE_SVC_AUDIO_BASS_BIG_ENC_BAD_CODE
+};
+
+/** BLE AUDIO BASS PA Sync parameters, valid fo Modify Source operation */
+enum ble_svc_audio_bass_pa_sync {
+/** BLE AUDIO BASS PA Sync: Do not synchronize to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_DO_NOT_SYNC,
+
+/** BLE AUDIO BASS PA Sync: Synchronize to PA – PAST available */
+BLE_SVC_AUDIO_BASS_PA_SYNC_SYNC_PAST_AVAILABLE,
+
+/** BLE AUDIO BASS PA Sync: Synchronize to PA – PAST not available */
+BLE_SVC_AUDIO_BASS_PA_SYNC_SYNC_PAST_NOT_AVAILABLE,
+
+/**
+ * BLE AUDIO BASS PA Sync: reserved for future use.
+ * This shall be always last value in this enum
+ */
+BLE_SVC_AUDIO_BASS_PA_SYNC_RFU
+};
+
+/** BLE AUDIO BASS Broadcast Receiver: PA Sync States */
+enum ble_svc_audio_bass_pa_sync_state {
+/** BLE AUDIO BASS PA Sync State: Not synchronized to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_NOT_SYNCED,
+
+/** BLE AUDIO BASS PA Sync State: SyncInfo Request */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNC_INFO_REQ,
+
+/** BLE AUDIO BASS PA Sync State: Synchronized to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNCED,
+
+/** BLE AUDIO BASS PA Sync State: Failed to synchronize to PAA */
+

Re: [PR] nimble/host: Add Broadcast Audio Scan Service [mynewt-nimble]

2024-04-26 Thread via GitHub


KKopyscinski commented on code in PR #1691:
URL: https://github.com/apache/mynewt-nimble/pull/1691#discussion_r1580673305


##
nimble/host/audio/services/bass/include/services/bass/ble_audio_svc_bass.h:
##
@@ -0,0 +1,455 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_SVC_BASS_
+#define H_BLE_AUDIO_SVC_BASS_
+
+#include 
+#include "audio/ble_audio.h"
+#include "syscfg/syscfg.h"
+
+/**
+ * @file ble_audio_svc_bass.h
+ *
+ * @brief Bluetooth LE Audio BAS Service
+ *
+ * This header file provides the public API for interacting with the BASS 
package.
+ *
+ * @defgroup ble_audio_svc_bass Bluetooth LE Audio BASS package
+ * @ingroup bt_host
+ * @{
+ *
+ * This package implements BASS service. Receiver states can be modified with 
setter functions
+ * or GATT writes to Control Point characteristic. Operations on Control Point 
like Add Source or
+ * Modify Source can be accepted or rejected by application by registering 
accept function callback.
+ * Accessing Control Point characteristic, or Successful modification or 
Receiver State will lead to
+ * emission of one of BLE_SVC_AUDIO_BASS events.
+ *
+ */
+
+/** BLE AUDIO BASS Maximum Subgroup Number */
+#define BLE_SVC_AUDIO_BASS_SUB_NUM_MAX \
+MYNEWT_VAL(BLE_SVC_AUDIO_BASS_SUB_NUM_MAX)
+
+/** BLE AUDIO BASS characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_UUID160x184F
+
+/** BLE AUDIO BASS Control Point characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BASS_CP0x2BC7
+
+/** BLE AUDIO BASS Broadcast Receiver State characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BROADCAST_RECEIVE_STATE0x2BC8
+
+/** Value of not assigned Source ID of Receiver State */
+#define BLE_SVC_AUDIO_BASS_RECEIVE_STATE_SRC_ID_NONE 0xFF

Review Comment:
   Okay, and `BLE_SVC_AUDIO_BASS_RECEIVE_BIS_SYNC_STATE_ANY` is unused - I'll 
remove it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Add Broadcast Audio Scan Service [mynewt-nimble]

2024-04-26 Thread via GitHub


MariuszSkamra commented on code in PR #1691:
URL: https://github.com/apache/mynewt-nimble/pull/1691#discussion_r1580638550


##
nimble/host/audio/services/bass/include/services/bass/ble_audio_svc_bass.h:
##
@@ -0,0 +1,455 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_SVC_BASS_
+#define H_BLE_AUDIO_SVC_BASS_
+
+#include 
+#include "audio/ble_audio.h"
+#include "syscfg/syscfg.h"
+
+/**
+ * @file ble_audio_svc_bass.h
+ *
+ * @brief Bluetooth LE Audio BAS Service
+ *
+ * This header file provides the public API for interacting with the BASS 
package.
+ *
+ * @defgroup ble_audio_svc_bass Bluetooth LE Audio BASS package
+ * @ingroup bt_host
+ * @{
+ *
+ * This package implements BASS service. Receiver states can be modified with 
setter functions
+ * or GATT writes to Control Point characteristic. Operations on Control Point 
like Add Source or
+ * Modify Source can be accepted or rejected by application by registering 
accept function callback.
+ * Accessing Control Point characteristic, or Successful modification or 
Receiver State will lead to
+ * emission of one of BLE_SVC_AUDIO_BASS events.
+ *
+ */
+
+/** BLE AUDIO BASS Maximum Subgroup Number */
+#define BLE_SVC_AUDIO_BASS_SUB_NUM_MAX \
+MYNEWT_VAL(BLE_SVC_AUDIO_BASS_SUB_NUM_MAX)
+
+/** BLE AUDIO BASS characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_UUID160x184F
+
+/** BLE AUDIO BASS Control Point characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BASS_CP0x2BC7
+
+/** BLE AUDIO BASS Broadcast Receiver State characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BROADCAST_RECEIVE_STATE0x2BC8
+
+/** Value of not assigned Source ID of Receiver State */
+#define BLE_SVC_AUDIO_BASS_RECEIVE_STATE_SRC_ID_NONE 0xFF
+
+/** BLE AUDIO BASS Add Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_ADD_SOURCE  0x01
+
+/** BLE AUDIO BASS Modify Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_MODIFY_SOURCE   0x02
+
+/** BLE AUDIO BASS Remove Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_REMOVE_SOURCE   0x03
+
+/** BLE AUDIO BASS Error: OP Code not supported */
+#define BLE_SVC_AUDIO_BASS_ERR_OPCODE_NOT_SUPPORTED  0x80
+
+/** BLE AUDIO BASS Error: Invalid Source ID */
+#define BLE_SVC_AUDIO_BASS_ERR_INVALID_SOURCE_ID 0x81
+
+/** BLE AUDIO BASS Encryption States */
+enum ble_svc_audio_bass_big_enc {
+/** BLE AUDIO BASS BIG Encryption: Not Encrypted */
+BLE_SVC_AUDIO_BASS_BIG_ENC_NOT_ENCRYPTED,
+
+/** BLE AUDIO BASS BIG Encryption: Broadcast Code Required */
+BLE_SVC_AUDIO_BASS_BIG_ENC_BROADCAST_CODE_REQ,
+
+/** BLE AUDIO BASS BIG Encryption: Decrypting */
+BLE_SVC_AUDIO_BASS_BIG_ENC_DECRYPTING,
+
+/** BLE AUDIO BASS BIG Encryption: Bad Code */
+BLE_SVC_AUDIO_BASS_BIG_ENC_BAD_CODE
+};
+
+/** BLE AUDIO BASS PA Sync parameters, valid fo Modify Source operation */
+enum ble_svc_audio_bass_pa_sync {
+/** BLE AUDIO BASS PA Sync: Do not synchronize to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_DO_NOT_SYNC,
+
+/** BLE AUDIO BASS PA Sync: Synchronize to PA – PAST available */
+BLE_SVC_AUDIO_BASS_PA_SYNC_SYNC_PAST_AVAILABLE,
+
+/** BLE AUDIO BASS PA Sync: Synchronize to PA – PAST not available */
+BLE_SVC_AUDIO_BASS_PA_SYNC_SYNC_PAST_NOT_AVAILABLE,
+
+/**
+ * BLE AUDIO BASS PA Sync: reserved for future use.
+ * This shall be always last value in this enum
+ */
+BLE_SVC_AUDIO_BASS_PA_SYNC_RFU
+};
+
+/** BLE AUDIO BASS Broadcast Receiver: PA Sync States */
+enum ble_svc_audio_bass_pa_sync_state {
+/** BLE AUDIO BASS PA Sync State: Not synchronized to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_NOT_SYNCED,
+
+/** BLE AUDIO BASS PA Sync State: SyncInfo Request */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNC_INFO_REQ,
+
+/** BLE AUDIO BASS PA Sync State: Synchronized to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNCED,
+
+/** BLE AUDIO BASS PA Sync State: Failed to synchronize to PAA */
+

Re: [PR] nimble/host: Add Broadcast Audio Scan Service [mynewt-nimble]

2024-04-26 Thread via GitHub


KKopyscinski commented on code in PR #1691:
URL: https://github.com/apache/mynewt-nimble/pull/1691#discussion_r1580631455


##
nimble/host/audio/services/bass/include/services/bass/ble_audio_svc_bass.h:
##
@@ -0,0 +1,455 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_SVC_BASS_
+#define H_BLE_AUDIO_SVC_BASS_
+
+#include 
+#include "audio/ble_audio.h"
+#include "syscfg/syscfg.h"
+
+/**
+ * @file ble_audio_svc_bass.h
+ *
+ * @brief Bluetooth LE Audio BAS Service
+ *
+ * This header file provides the public API for interacting with the BASS 
package.
+ *
+ * @defgroup ble_audio_svc_bass Bluetooth LE Audio BASS package
+ * @ingroup bt_host
+ * @{
+ *
+ * This package implements BASS service. Receiver states can be modified with 
setter functions
+ * or GATT writes to Control Point characteristic. Operations on Control Point 
like Add Source or
+ * Modify Source can be accepted or rejected by application by registering 
accept function callback.
+ * Accessing Control Point characteristic, or Successful modification or 
Receiver State will lead to
+ * emission of one of BLE_SVC_AUDIO_BASS events.
+ *
+ */
+
+/** BLE AUDIO BASS Maximum Subgroup Number */
+#define BLE_SVC_AUDIO_BASS_SUB_NUM_MAX \
+MYNEWT_VAL(BLE_SVC_AUDIO_BASS_SUB_NUM_MAX)
+
+/** BLE AUDIO BASS characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_UUID160x184F
+
+/** BLE AUDIO BASS Control Point characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BASS_CP0x2BC7
+
+/** BLE AUDIO BASS Broadcast Receiver State characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BROADCAST_RECEIVE_STATE0x2BC8
+
+/** Value of not assigned Source ID of Receiver State */
+#define BLE_SVC_AUDIO_BASS_RECEIVE_STATE_SRC_ID_NONE 0xFF
+
+/** BLE AUDIO BASS Add Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_ADD_SOURCE  0x01
+
+/** BLE AUDIO BASS Modify Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_MODIFY_SOURCE   0x02
+
+/** BLE AUDIO BASS Remove Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_REMOVE_SOURCE   0x03
+
+/** BLE AUDIO BASS Error: OP Code not supported */
+#define BLE_SVC_AUDIO_BASS_ERR_OPCODE_NOT_SUPPORTED  0x80
+
+/** BLE AUDIO BASS Error: Invalid Source ID */
+#define BLE_SVC_AUDIO_BASS_ERR_INVALID_SOURCE_ID 0x81
+
+/** BLE AUDIO BASS Encryption States */
+enum ble_svc_audio_bass_big_enc {
+/** BLE AUDIO BASS BIG Encryption: Not Encrypted */
+BLE_SVC_AUDIO_BASS_BIG_ENC_NOT_ENCRYPTED,
+
+/** BLE AUDIO BASS BIG Encryption: Broadcast Code Required */
+BLE_SVC_AUDIO_BASS_BIG_ENC_BROADCAST_CODE_REQ,
+
+/** BLE AUDIO BASS BIG Encryption: Decrypting */
+BLE_SVC_AUDIO_BASS_BIG_ENC_DECRYPTING,
+
+/** BLE AUDIO BASS BIG Encryption: Bad Code */
+BLE_SVC_AUDIO_BASS_BIG_ENC_BAD_CODE
+};
+
+/** BLE AUDIO BASS PA Sync parameters, valid fo Modify Source operation */
+enum ble_svc_audio_bass_pa_sync {
+/** BLE AUDIO BASS PA Sync: Do not synchronize to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_DO_NOT_SYNC,
+
+/** BLE AUDIO BASS PA Sync: Synchronize to PA – PAST available */
+BLE_SVC_AUDIO_BASS_PA_SYNC_SYNC_PAST_AVAILABLE,
+
+/** BLE AUDIO BASS PA Sync: Synchronize to PA – PAST not available */
+BLE_SVC_AUDIO_BASS_PA_SYNC_SYNC_PAST_NOT_AVAILABLE,
+
+/**
+ * BLE AUDIO BASS PA Sync: reserved for future use.
+ * This shall be always last value in this enum
+ */
+BLE_SVC_AUDIO_BASS_PA_SYNC_RFU
+};
+
+/** BLE AUDIO BASS Broadcast Receiver: PA Sync States */
+enum ble_svc_audio_bass_pa_sync_state {
+/** BLE AUDIO BASS PA Sync State: Not synchronized to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_NOT_SYNCED,
+
+/** BLE AUDIO BASS PA Sync State: SyncInfo Request */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNC_INFO_REQ,
+
+/** BLE AUDIO BASS PA Sync State: Synchronized to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNCED,
+
+/** BLE AUDIO BASS PA Sync State: Failed to synchronize to PAA */
+

Re: [PR] nimble/host: Add Broadcast Audio Scan Service [mynewt-nimble]

2024-04-26 Thread via GitHub


MariuszSkamra commented on code in PR #1691:
URL: https://github.com/apache/mynewt-nimble/pull/1691#discussion_r1580576584


##
nimble/host/audio/services/bass/include/services/bass/ble_audio_svc_bass.h:
##
@@ -0,0 +1,455 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_SVC_BASS_
+#define H_BLE_AUDIO_SVC_BASS_
+
+#include 
+#include "audio/ble_audio.h"
+#include "syscfg/syscfg.h"
+
+/**
+ * @file ble_audio_svc_bass.h
+ *
+ * @brief Bluetooth LE Audio BAS Service
+ *
+ * This header file provides the public API for interacting with the BASS 
package.
+ *
+ * @defgroup ble_audio_svc_bass Bluetooth LE Audio BASS package
+ * @ingroup bt_host
+ * @{
+ *
+ * This package implements BASS service. Receiver states can be modified with 
setter functions
+ * or GATT writes to Control Point characteristic. Operations on Control Point 
like Add Source or
+ * Modify Source can be accepted or rejected by application by registering 
accept function callback.
+ * Accessing Control Point characteristic, or Successful modification or 
Receiver State will lead to
+ * emission of one of BLE_SVC_AUDIO_BASS events.
+ *
+ */
+
+/** BLE AUDIO BASS Maximum Subgroup Number */
+#define BLE_SVC_AUDIO_BASS_SUB_NUM_MAX \
+MYNEWT_VAL(BLE_SVC_AUDIO_BASS_SUB_NUM_MAX)
+
+/** BLE AUDIO BASS characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_UUID160x184F
+
+/** BLE AUDIO BASS Control Point characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BASS_CP0x2BC7
+
+/** BLE AUDIO BASS Broadcast Receiver State characteristic UUID */
+#define BLE_SVC_AUDIO_BASS_CHR_UUID16_BROADCAST_RECEIVE_STATE0x2BC8
+
+/** Value of not assigned Source ID of Receiver State */
+#define BLE_SVC_AUDIO_BASS_RECEIVE_STATE_SRC_ID_NONE 0xFF
+
+/** BLE AUDIO BASS Add Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_ADD_SOURCE  0x01
+
+/** BLE AUDIO BASS Modify Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_MODIFY_SOURCE   0x02
+
+/** BLE AUDIO BASS Remove Source operation OP code */
+#define BLE_SVC_AUDIO_BASS_OPERATION_REMOVE_SOURCE   0x03
+
+/** BLE AUDIO BASS Error: OP Code not supported */
+#define BLE_SVC_AUDIO_BASS_ERR_OPCODE_NOT_SUPPORTED  0x80
+
+/** BLE AUDIO BASS Error: Invalid Source ID */
+#define BLE_SVC_AUDIO_BASS_ERR_INVALID_SOURCE_ID 0x81
+
+/** BLE AUDIO BASS Encryption States */
+enum ble_svc_audio_bass_big_enc {
+/** BLE AUDIO BASS BIG Encryption: Not Encrypted */
+BLE_SVC_AUDIO_BASS_BIG_ENC_NOT_ENCRYPTED,
+
+/** BLE AUDIO BASS BIG Encryption: Broadcast Code Required */
+BLE_SVC_AUDIO_BASS_BIG_ENC_BROADCAST_CODE_REQ,
+
+/** BLE AUDIO BASS BIG Encryption: Decrypting */
+BLE_SVC_AUDIO_BASS_BIG_ENC_DECRYPTING,
+
+/** BLE AUDIO BASS BIG Encryption: Bad Code */
+BLE_SVC_AUDIO_BASS_BIG_ENC_BAD_CODE
+};
+
+/** BLE AUDIO BASS PA Sync parameters, valid fo Modify Source operation */
+enum ble_svc_audio_bass_pa_sync {
+/** BLE AUDIO BASS PA Sync: Do not synchronize to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_DO_NOT_SYNC,
+
+/** BLE AUDIO BASS PA Sync: Synchronize to PA – PAST available */
+BLE_SVC_AUDIO_BASS_PA_SYNC_SYNC_PAST_AVAILABLE,
+
+/** BLE AUDIO BASS PA Sync: Synchronize to PA – PAST not available */
+BLE_SVC_AUDIO_BASS_PA_SYNC_SYNC_PAST_NOT_AVAILABLE,
+
+/**
+ * BLE AUDIO BASS PA Sync: reserved for future use.
+ * This shall be always last value in this enum
+ */
+BLE_SVC_AUDIO_BASS_PA_SYNC_RFU
+};
+
+/** BLE AUDIO BASS Broadcast Receiver: PA Sync States */
+enum ble_svc_audio_bass_pa_sync_state {
+/** BLE AUDIO BASS PA Sync State: Not synchronized to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_NOT_SYNCED,
+
+/** BLE AUDIO BASS PA Sync State: SyncInfo Request */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNC_INFO_REQ,
+
+/** BLE AUDIO BASS PA Sync State: Synchronized to PA */
+BLE_SVC_AUDIO_BASS_PA_SYNC_STATE_SYNCED,
+
+/** BLE AUDIO BASS PA Sync State: Failed to synchronize to PAA */
+