1 /* 2 # Copyright (C) 2024 HiHope Open Source Organization . 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 */ 15 16 #ifndef OHOS_SLE_COMMON_H 17 #define OHOS_SLE_COMMON_H 18 19 #define OH_SLE_ADDR_LEN 6 20 #define OH_SLE_SEEK_PHY_NUM_MAX 3 21 #define SLE_UUID_LEN 16 22 23 #include <stdint.h> 24 25 26 typedef struct { 27 uint8_t type; /*!< @if Eng SLE device address type { @ref @ref SleAddrType } 28 @else SLE设备地址类型 { @ref @ref SleAddrType } @endif */ 29 unsigned char addr[OH_SLE_ADDR_LEN]; /*!< @if Eng SLE device address 30 @else SLE设备地址 @endif */ 31 } SleAddr; 32 33 typedef struct { 34 uint8_t len; /*!< @if Eng uuid len 35 @else UUID 长度 @endif */ 36 uint8_t uuid[SLE_UUID_LEN]; /*!< @if Eng uuid 37 @else UUID字段 @endif */ 38 } SleUuid; 39 40 /** 41 * @if Eng 42 * @brief Struct of ssap info exchange 43 * @else 44 * @brief ssap 信息交换结构体。 45 * @endif 46 */ 47 typedef struct { 48 uint32_t mtuSize; /*!< @if Eng mtu size 49 @else mtu大小 @endif */ 50 uint16_t version; /*!< @if Eng version 51 @else 版本 @endif */ 52 } SsapcExchangeInfo; 53 54 55 /** 56 * @if Eng 57 * @brief Enum of sle ACB connection state. 58 * @else 59 * @brief SLE ACB连接状态。 60 * @endif 61 */ 62 typedef enum { 63 OH_SLE_ACB_STATE_NONE = 0x00, /*!< @if Eng SLE ACB connect state of none 64 @else SLE ACB 未连接状态 @endif */ 65 OH_SLE_ACB_STATE_CONNECTED = 0x01, /*!< @if Eng SLE ACB connect state of connected 66 @else SLE ACB 已连接 @endif */ 67 OH_SLE_ACB_STATE_DISCONNECTED = 0x02, /*!< @if Eng SLE ACB connect state of disconnected 68 @else SLE ACB 已断接 @endif */ 69 } SleAcbStateType; 70 71 /** 72 * @if Eng 73 * @brief Enum of sle pairing state. 74 * @else 75 * @brief 星闪配对状态。 76 * @endif 77 */ 78 typedef enum { 79 OH_SLE_PAIR_NONE = 0x01, /*!< @if Eng Pair state of none 80 @else 未配对状态 @endif */ 81 OH_SLE_PAIR_PAIRING = 0x02, /*!< @if Eng Pair state of pairing 82 @else 正在配对 @endif */ 83 OH_SLE_PAIR_PAIRED = 0x03 /*!< @if Eng Pair state of paired 84 @else 已完成配对 @endif */ 85 } SlePairStateType; 86 87 88 89 90 91 92 93 #endif 94