You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/04/09 08:13:34 UTC

[GitHub] [mynewt-nimble] andrzej-kaczmarek commented on a change in pull request #393: nimble/svc: Add audio streaming for hearing aid service

andrzej-kaczmarek commented on a change in pull request #393: nimble/svc: Add audio streaming for hearing aid service
URL: https://github.com/apache/mynewt-nimble/pull/393#discussion_r273371242
 
 

 ##########
 File path: nimble/host/services/asha/include/services/asha/ble_svc_asha.h
 ##########
 @@ -0,0 +1,90 @@
+/*
+ * 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_SRV_ASHA_
+#define H_BLE_SRV_ASHA_
+
+#include <stdbool.h>
+#include "nimble/ble.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define CONTROL_POINT_OP_START        0x01
+#define CONTROL_POINT_OP_STOP         0x02
+#define STATUS_OK                     0x00
+#define UNKNOWN_COMMAND               0x01
+#define ILLIGAL_PARAMETERS            0x02
+#define LEFT                          0X02
+#define RIGHT                         0X03
+#define DEVICE_SIDE                   RIGHT 
+#define READ_ONLY_BUFFER_SIZE         17
+/* Future use. */
+#define  CODEC_G722_16KHZ             0x01
+#define  CODEC_G722_24KHZ             0x02
+
+/********* Hearing aid service. ***********************/
+#define BLE_SVC_ASHA_UUID16     0xFDF0
+
+/* ASHA Characteristics UUIDS. */
+/*6333651e-c481-4a3e-9169-7c902aad37bb*/
+#define BLE_SVC_ASHA_CHR_UUID128_DEVICE_PROP \
+           0xbb, 0x37, 0xad, 0x2a, 0x90, 0x7c, 0x69, 0x91\
+           ,0x3e,  0x4a, 0x81, 0xc4, 0x1e, 0x65, 0x33, 0x63
+/* f0d4de7e-4a88-476c-9d9f-1937b0996cc0 */
+#define BLE_SVC_ASHA_CHR_UUID128_CONTROL_AUDIO \
+           0xc0, 0x6c, 0x99, 0xb0, 0x37, 0x19, 0x9f, 0x9d,\
+           0x6c, 0x47, 0x88, 0x4a, 0x7e, 0xde, 0xd4, 0xf0
+/* 38663f1a-e711-4cac-b641-326b56404837 */
+#define BLE_SVC_ASHA_CHR_UUID128_AUDIO_STATUS\
+          0x37, 0x48, 0x40, 0x56, 0x6b, 0x32, 0x41, 0xb6,\
+          0xac, 0x4c, 0x11, 0xe7, 0x1a, 0x3f, 0x66, 0x38
+/* 00e4ca9e-ab14-41e4-8823-f9e70c7e91df */
+#define BLE_SVC_ASHA_CHR_UUID128_SET_VOLUME  \
+          0xdf, 0x91, 0x7e, 0x0c, 0xe7, 0xf9, 0x23, 0x88,\
+          0xe4, 0x41, 0x14, 0xab, 0x9e, 0xca, 0xe4, 0x00
+/* 2d410339-82b6-42aa-b34e-e2e01df8cc1a */
+#define BLE_SVC_ASHA_CHR_UUID128_L2CAP_PSM  \
+         0x1a, 0xcc, 0xf8, 0x1d, 0xe0, 0xe2, 0x4e, 0xb3,0xaa,\
+         0x42, 0xb6, 0x82, 0x39, 0x03, 0x41, 0x2d
+
+typedef enum audio_types {
+    Unknown,
+    Ringtone,
+    Phonecall,
+    Media
+}ble_svc_audio_types_t ;
+
+struct ble_svc_asha_audio_control {
+    uint8_t codec_in_use;
+    int8_t volume_lvl;
+    ble_svc_audio_types_t audio_type;
+    uint8_t start_flag;
+};
+
+struct ble_svc_asha_audio_control* ble_svc_asha_get_audio_control(void);
+uint16_t ble_svc_asha_get_psm_handle(void);
+uint8_t ble_svc_asha_is_started(void);
+void gatt_svc_asha_init(void);
 
 Review comment:
   those need doxygen to explain how to use them

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services