Browse Source
包含 JL_BLEKit / JL_OTALib / JL_AdvParse / JL_HashPair / JLLogHelper / JLAudioUnitKit / JLAV2Lib —— 与 Android 端 .aar 同样直接随仓库分发。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>weicu
397 changed files with 31369 additions and 0 deletions
@ -0,0 +1,18 @@ |
|||||
|
//
|
||||
|
// JLAV2Lib.h
|
||||
|
// JLAV2Lib
|
||||
|
//
|
||||
|
// Created by ZPC21-032 on 2025/4/9.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
//! Project version number for JLAV2Lib.
|
||||
|
FOUNDATION_EXPORT double JLAV2LibVersionNumber; |
||||
|
|
||||
|
//! Project version string for JLAV2Lib.
|
||||
|
FOUNDATION_EXPORT const unsigned char JLAV2LibVersionString[]; |
||||
|
|
||||
|
// In this header, you should import all the public headers of your framework using statements like #import <JLAV2Lib/PublicHeader.h>
|
||||
|
#import <JLAV2Lib/jla_v2_codec_api.h> |
||||
|
|
||||
@ -0,0 +1,96 @@ |
|||||
|
#ifndef _JLA_V2_CODEC_h |
||||
|
#define _JLA_V2_CODEC_h |
||||
|
|
||||
|
|
||||
|
#ifndef u16 |
||||
|
#define u32 unsigned int |
||||
|
#define u16 unsigned short |
||||
|
#define s16 short |
||||
|
#define u8 unsigned char |
||||
|
#endif |
||||
|
|
||||
|
#define SET_DECODE_MODE 0x80 |
||||
|
#define SET_DEC_CH_MODE 0x81 |
||||
|
//#define SET_FADE_IN_TMS 0x82 //for dec plc deleted
|
||||
|
#define SET_FADE_IN_OUT 0x82 //淡入淡出 设置生效.
|
||||
|
#define SET_NEW_BITRATE 0x90 //enc.
|
||||
|
#define GET_EDFRAME_LEN 0x91 //
|
||||
|
#define SET_EDFRAME_LEN 0x92 //only for dec.
|
||||
|
|
||||
|
#define SET_HW_FFT_CALLBACK 0xA0 //br56_fft.
|
||||
|
|
||||
|
enum |
||||
|
{ |
||||
|
JLA_V2_NORMAL_CH = 0, //仅在此模式下,音源为双声道时输出双声道pcm数据.
|
||||
|
JLA_V2_L_OUT, |
||||
|
JLA_V2_R_OUT, |
||||
|
JLA_V2_LR_MEAN |
||||
|
}; |
||||
|
|
||||
|
enum |
||||
|
{ |
||||
|
JLA_V2_2CH_L_OR_R = 0x80 |
||||
|
}; |
||||
|
|
||||
|
struct audio_decode_para |
||||
|
{ |
||||
|
u32 mode; /*通过codec_config,cmd=SET_DECODE_MODE设置解码输出模式*/ |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
struct audio_set_bitrate |
||||
|
{ |
||||
|
u32 br; |
||||
|
}; |
||||
|
|
||||
|
struct jla_v2_dec_ch_oput_para |
||||
|
{ |
||||
|
u32 mode; |
||||
|
short pL; //mode_3_channel_L_coefficient Q13 8192:50%
|
||||
|
short pR; //mode_3_channel_R_coefficient Q13
|
||||
|
}; |
||||
|
|
||||
|
|
||||
|
struct jla_v2_codec_info |
||||
|
{ |
||||
|
u32 sr; ///< sample rate
|
||||
|
u32 br; ///< bit rate
|
||||
|
u16 fr_idx; ///< 帧长索引. JLA_V2_FRLEN[9 + 4 +1] = {32, 40, 48, 60, 64, 80, 96, 120, 128, 160, 240, 320, 400, 480}; 0~13.
|
||||
|
u16 nch; |
||||
|
u16 if_s24; ///< 编码输入数据 或者解码输出数据位宽是否为24比特.
|
||||
|
}; ///< enc_para + dec_para
|
||||
|
|
||||
|
|
||||
|
struct jla_v2_codec_io |
||||
|
{ |
||||
|
void* priv; |
||||
|
u16(*input_data)(void* priv, u8* buf, u16 len); //bytes
|
||||
|
u16(*output_data)(void* priv, u8* buf, u16 len); //bytes /*解码器在struct audio_decode_para参数mode=1时判断是否输出完整*/
|
||||
|
}; |
||||
|
|
||||
|
|
||||
|
struct jla_v2_codec_ops { |
||||
|
u32(*open)(void* work_buf, const struct jla_v2_codec_io* audioIO, void* para); ///<打开解码器
|
||||
|
u32(*run)(void* work_buf, void* scratch); ///<解码主循环(buffer 32bit对齐)
|
||||
|
u32(*need_dcbuf_size)(void* para); ///<获取编解码需要的空间work_buf
|
||||
|
u32(*need_stbuf_size)(void* para); ///<获取编解码需要的堆栈scratch
|
||||
|
u32(*codec_config)(void* work_buf, u32 cmd, void* parm); |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
extern struct jla_v2_codec_ops* get_jla_v2_enc_ops(); |
||||
|
extern struct jla_v2_codec_ops* get_jla_v2_dec_ops(); |
||||
|
|
||||
|
|
||||
|
extern const int JLA_V2_PLC_EN; |
||||
|
extern const int JLA_V2_HW_FFT; |
||||
|
extern const int JLA_V2_ENCODE_I24bit_ENABLE; |
||||
|
extern const int JLA_V2_DECODE_O24bit_ENABLE; |
||||
|
extern const int JLA_V2_PLC_FADE_OUT_START_POINT; |
||||
|
extern const int JLA_V2_PLC_FADE_OUT_POINTS; |
||||
|
extern const int JLA_V2_PLC_FADE_IN_POINTS; |
||||
|
extern const unsigned short JLA_V2_FRAMELEN_MASK; |
||||
|
|
||||
|
|
||||
|
|
||||
|
#endif |
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,6 @@ |
|||||
|
framework module JLAV2Lib { |
||||
|
umbrella header "JLAV2Lib.h" |
||||
|
|
||||
|
export * |
||||
|
module * { export * } |
||||
|
} |
||||
@ -0,0 +1,43 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
|
<plist version="1.0"> |
||||
|
<dict> |
||||
|
<key>AvailableLibraries</key> |
||||
|
<array> |
||||
|
<dict> |
||||
|
<key>BinaryPath</key> |
||||
|
<string>JLAudioUnitKit.framework/JLAudioUnitKit</string> |
||||
|
<key>LibraryIdentifier</key> |
||||
|
<string>ios-x86_64-simulator</string> |
||||
|
<key>LibraryPath</key> |
||||
|
<string>JLAudioUnitKit.framework</string> |
||||
|
<key>SupportedArchitectures</key> |
||||
|
<array> |
||||
|
<string>x86_64</string> |
||||
|
</array> |
||||
|
<key>SupportedPlatform</key> |
||||
|
<string>ios</string> |
||||
|
<key>SupportedPlatformVariant</key> |
||||
|
<string>simulator</string> |
||||
|
</dict> |
||||
|
<dict> |
||||
|
<key>BinaryPath</key> |
||||
|
<string>JLAudioUnitKit.framework/JLAudioUnitKit</string> |
||||
|
<key>LibraryIdentifier</key> |
||||
|
<string>ios-arm64</string> |
||||
|
<key>LibraryPath</key> |
||||
|
<string>JLAudioUnitKit.framework</string> |
||||
|
<key>SupportedArchitectures</key> |
||||
|
<array> |
||||
|
<string>arm64</string> |
||||
|
</array> |
||||
|
<key>SupportedPlatform</key> |
||||
|
<string>ios</string> |
||||
|
</dict> |
||||
|
</array> |
||||
|
<key>CFBundlePackageType</key> |
||||
|
<string>XFWK</string> |
||||
|
<key>XCFrameworkFormatVersion</key> |
||||
|
<string>1.0</string> |
||||
|
</dict> |
||||
|
</plist> |
||||
@ -0,0 +1,26 @@ |
|||||
|
//
|
||||
|
// JLAudioUnitKit.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2024/11/14.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
//! Project version number for JLAudioUnitKit.
|
||||
|
FOUNDATION_EXPORT double JLAudioUnitKitVersionNumber; |
||||
|
|
||||
|
//! Project version string for JLAudioUnitKit.
|
||||
|
FOUNDATION_EXPORT const unsigned char JLAudioUnitKitVersionString[]; |
||||
|
|
||||
|
// In this header, you should import all the public headers of your framework using statements like #import <JLAudioUnitKit/PublicHeader.h>
|
||||
|
|
||||
|
#import <JLAudioUnitKit/JLSpeexDecoder.h> |
||||
|
#import <JLAudioUnitKit/JLOpusDecoder.h> |
||||
|
#import <JLAudioUnitKit/JLOpusEncoder.h> |
||||
|
#import <JLAudioUnitKit/JLOpusFormat.h> |
||||
|
#import <JLAudioUnitKit/JLOpusEncodeConfig.h> |
||||
|
#import <JLAudioUnitKit/JLPcmToWtg.h> |
||||
|
#import <JLAudioUnitKit/JLPcmToWav.h> |
||||
|
#import <JLAudioUnitKit/JLAudioUnitPlayer.h> |
||||
|
#import <JLAudioUnitKit/JLOpusToOgg.h> |
||||
@ -0,0 +1,58 @@ |
|||||
|
//
|
||||
|
// JLAudioUnitPlayer.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/4/16.
|
||||
|
// Copyright © 2025 ZhuHai JieLi Technology Co.,Ltd. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <AudioToolbox/AudioToolbox.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
typedef NS_ENUM(NSInteger, JLAudioUnitPlayerType) { |
||||
|
JLAudioUnitPlayerTypeFile, // 支持 MP3/WAV/AAC 等文件格式(AVAudioPlayer)
|
||||
|
JLAudioUnitPlayerTypePCM // 支持 PCM 流式播放(Audio Queue)
|
||||
|
}; |
||||
|
|
||||
|
@class JLAudioUnitPlayer; |
||||
|
|
||||
|
@protocol JLAudioPlayerDelegate <NSObject> |
||||
|
@optional |
||||
|
// 播放进度更新(秒)
|
||||
|
- (void)audioPlayer:(JLAudioUnitPlayer *)player didUpdateProgress:(NSTimeInterval)currentTime duration:(NSTimeInterval)duration; |
||||
|
// 播放完成
|
||||
|
- (void)audioPlayerDidFinishPlaying:(JLAudioUnitPlayer *)player; |
||||
|
// 播放错误
|
||||
|
- (void)audioPlayer:(JLAudioUnitPlayer *)player didFailWithError:(NSError *)error; |
||||
|
@end |
||||
|
|
||||
|
@interface JLAudioUnitPlayer : NSObject |
||||
|
|
||||
|
@property (nonatomic, weak) id<JLAudioPlayerDelegate> delegate; |
||||
|
@property (nonatomic, readonly) NSTimeInterval duration; // 总时长(文件模式下有效)
|
||||
|
@property (nonatomic, readonly) NSTimeInterval currentTime; |
||||
|
@property (nonatomic, readonly) BOOL isPlaying; |
||||
|
|
||||
|
#pragma mark - 初始化方法 |
||||
|
|
||||
|
/// 文件播放初始化(MP3/WAV/AAC)
|
||||
|
- (instancetype)initWithAudioFile:(NSString *)filePath; |
||||
|
|
||||
|
/// PCM 流播放初始化(需指定格式)
|
||||
|
- (instancetype)initWithPCMFormat:(AudioStreamBasicDescription)format; |
||||
|
|
||||
|
#pragma mark - 播放控制 |
||||
|
- (void)play; |
||||
|
- (void)pause; |
||||
|
- (void)stop; |
||||
|
- (void)seekToTime:(NSTimeInterval)time; // 仅文件模式有效
|
||||
|
|
||||
|
#pragma mark - PCM 流式输入(仅 PCM 模式有效) |
||||
|
- (void)appendPCMData:(NSData *)pcmData; |
||||
|
- (void)endPCMStream; // 结束 PCM 流输入
|
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,66 @@ |
|||||
|
//
|
||||
|
// JLOpusDecoder.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2024/11/14.
|
||||
|
// Copyright © 2024 ZhuHai JieLi Technology Co.,Ltd. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <JLAudioUnitKit/JLOpusFormat.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
@class JLOpusDecoder; |
||||
|
|
||||
|
/// Opus 解码代理
|
||||
|
@protocol JLOpusDecoderDelegate <NSObject> |
||||
|
|
||||
|
/// Opus 数据解码
|
||||
|
/// - Parameters:
|
||||
|
/// - decoder: 解码器
|
||||
|
/// - data: pcm 数据
|
||||
|
/// - error: 错误信息
|
||||
|
-(void)opusDecoder:(JLOpusDecoder *)decoder Data:(NSData* _Nullable)data error:(NSError* _Nullable)error; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
typedef void(^JLOpusDecoderConvertBlock)(NSString *_Nullable pcmPath,NSError *_Nullable error); |
||||
|
|
||||
|
/// Opus 解码
|
||||
|
@interface JLOpusDecoder : NSObject |
||||
|
|
||||
|
/// 数据格式参数
|
||||
|
@property (nonatomic, strong) JLOpusFormat *opusFormat; |
||||
|
|
||||
|
/// 代理委托
|
||||
|
@property(nonatomic, weak) id<JLOpusDecoderDelegate> delegate; |
||||
|
|
||||
|
- (instancetype)init NS_UNAVAILABLE; |
||||
|
|
||||
|
/// 初始化
|
||||
|
/// - Parameters:
|
||||
|
/// - format: 解码格式
|
||||
|
/// - delegate: 代理
|
||||
|
- (instancetype)initDecoder:(JLOpusFormat *)format delegate:(id<JLOpusDecoderDelegate>)delegate; |
||||
|
|
||||
|
/// 重置解码格式
|
||||
|
/// - Parameter format: 解码格式
|
||||
|
-(void)resetOpusFramet:(JLOpusFormat *)format; |
||||
|
|
||||
|
/// 输入 Opus 数据
|
||||
|
/// - Parameter data: Opus 数据
|
||||
|
-(void)opusDecoderInputData:(NSData *)data; |
||||
|
|
||||
|
/// 解码文件
|
||||
|
/// - Parameters:
|
||||
|
/// - input: opus 文件
|
||||
|
/// - outPut: 输出路径
|
||||
|
/// - result: 结果回调
|
||||
|
-(void)opusDecodeFile:(NSString *)input outPut:(NSString *_Nullable)outPut Resoult:(JLOpusDecoderConvertBlock _Nullable)result; |
||||
|
|
||||
|
/// 释放
|
||||
|
-(void)opusOnRelease; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,83 @@ |
|||||
|
//
|
||||
|
// JLOpusEncodeConfig.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/8/27.
|
||||
|
// Copyright © 2025 ZhuHai JieLi Technology Co.,Ltd. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
typedef NS_ENUM(NSInteger, JLOpusEncoderBandwidth) { |
||||
|
///(4kHz bandpass)
|
||||
|
JLOpusEncoderBandwidthNarrowband = 1101, // 对应 OPUS_BANDWIDTH_NARROWBAND
|
||||
|
/// (6kHz bandpass)
|
||||
|
JLOpusEncoderBandwidthMediumband = 1102, // 对应 OPUS_BANDWIDTH_MEDIUMBAND
|
||||
|
/// (8kHz bandpass)
|
||||
|
JLOpusEncoderBandwidthWideband = 1103, // 对应 OPUS_BANDWIDTH_WIDEBAND
|
||||
|
/// (12kHz bandpass)
|
||||
|
JLOpusEncoderBandwidthSuperwideband = 1104,// 对应 OPUS_BANDWIDTH_SUPERWIDEBAND
|
||||
|
/// (20kHz bandpass)
|
||||
|
JLOpusEncoderBandwidthFullband = 1105 // 对应 OPUS_BANDWIDTH_FULLBAND
|
||||
|
}; |
||||
|
|
||||
|
@interface JLOpusEncodeConfig : NSObject |
||||
|
|
||||
|
/// 采样率
|
||||
|
@property (nonatomic, assign) int sampleRate; |
||||
|
|
||||
|
/// 单/双声道
|
||||
|
@property (nonatomic, assign) int channels; |
||||
|
|
||||
|
/// 帧长度 20ms 默认值
|
||||
|
@property (nonatomic, assign) int frameDuration; |
||||
|
|
||||
|
/// 帧长度
|
||||
|
@property (nonatomic, assign) int frameSize; |
||||
|
|
||||
|
/// BitRate
|
||||
|
@property (nonatomic, assign) int bitRate; |
||||
|
|
||||
|
/// 可变比特率开关,默认 NO(使用 CBR)
|
||||
|
@property (nonatomic, assign) BOOL useVBR; |
||||
|
|
||||
|
/// VBR 限制模式,默认 NO
|
||||
|
@property (nonatomic, assign) BOOL constrainedVBR; |
||||
|
|
||||
|
/// 编码复杂度 0~10,默认 5
|
||||
|
@property (nonatomic, assign) int complexity; |
||||
|
|
||||
|
/// 强制输出声道数 -1: 自适应, 1: 单声道, 2: 双声道, 默认 -1
|
||||
|
@property (nonatomic, assign) int forceChannels; |
||||
|
|
||||
|
/// 是否启用 DTX(静音段不发送数据),默认 NO
|
||||
|
@property (nonatomic, assign) BOOL useDTX; |
||||
|
|
||||
|
/// 网络丢包百分比,默认 0
|
||||
|
@property (nonatomic, assign) int packetLossPercent; |
||||
|
|
||||
|
/// 最大带宽限制(OPUS_BANDWIDTH_*),默认 FULLBAND
|
||||
|
@property (nonatomic, assign) int bandwidth; |
||||
|
|
||||
|
/// PCM 输入有效位深,默认 16
|
||||
|
@property (nonatomic, assign) int lsbDepth; |
||||
|
|
||||
|
/// 专家模式下帧时长(ms),默认与 frameDuration 一致
|
||||
|
@property (nonatomic, assign) int expertFrameDuration; |
||||
|
|
||||
|
/// 是否启用数据头
|
||||
|
/// 默认是启用的
|
||||
|
@property (nonatomic, assign) BOOL hasDataHeader; |
||||
|
|
||||
|
/// 创建默认编码配置
|
||||
|
+ (instancetype)defaultConfig; |
||||
|
|
||||
|
/// 获取默认配置
|
||||
|
/// 杰理的无头配置
|
||||
|
+ (instancetype)defaultJL; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,69 @@ |
|||||
|
//
|
||||
|
// JLOpusEncoder.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2024/11/14.
|
||||
|
// Copyright © 2024 ZhuHai JieLi Technology Co.,Ltd. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <JLAudioUnitKit/JLOpusEncodeConfig.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
@class JLOpusEncoder; |
||||
|
|
||||
|
/// Opus 编码代理
|
||||
|
@protocol JLOpusEncoderDelegate <NSObject> |
||||
|
|
||||
|
/// PCM 数据编码
|
||||
|
/// - Parameters:
|
||||
|
/// - encoder: 解码器
|
||||
|
/// - data: opus 数据
|
||||
|
/// - error: 错误信息
|
||||
|
-(void)opusEncoder:(JLOpusEncoder *)encoder Data:(NSData* _Nullable)data error:(NSError* _Nullable)error; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
typedef void(^JLOpusEncoderConvertBlock)(NSString *_Nullable pcmPath,NSError *_Nullable error); |
||||
|
|
||||
|
/// Opus 编码
|
||||
|
@interface JLOpusEncoder : NSObject |
||||
|
|
||||
|
/// 音频格式
|
||||
|
@property (nonatomic, strong) JLOpusEncodeConfig *opusFormat; |
||||
|
|
||||
|
/// 代理
|
||||
|
@property (nonatomic, weak) id<JLOpusEncoderDelegate> delegate; |
||||
|
|
||||
|
-(instancetype)init NS_UNAVAILABLE; |
||||
|
|
||||
|
/// 初始化
|
||||
|
/// - Parameters:
|
||||
|
/// - config: 音频格式
|
||||
|
/// - delegate: 代理
|
||||
|
-(instancetype)initFormat:(JLOpusEncodeConfig *)format delegate:(id<JLOpusEncoderDelegate>)delegate; |
||||
|
|
||||
|
/// PCM 数据
|
||||
|
/// - Parameter data: PCM 数据
|
||||
|
-(void)opusEncodeData:(NSData *)data; |
||||
|
|
||||
|
/// PCM 文件转换成 Opus 文件(推荐新接口,流式读取,避免一次性加载内存)
|
||||
|
/// - Parameters:
|
||||
|
/// - pcmPath: PCM 文件存放路径
|
||||
|
/// - output: 文件输出路径(可空,默认 ~/Documents/pcmToOpus.opus)
|
||||
|
/// - result: 结果回调,回传输出路径或错误
|
||||
|
-(void)opusEncodeFile:(NSString *)pcmPath output:(NSString *_Nullable)output result:(JLOpusEncoderConvertBlock _Nullable)result; |
||||
|
|
||||
|
/// 兼容旧接口(已废弃:命名拼写问题,且旧实现一次性读入文件)
|
||||
|
/// - Parameters:
|
||||
|
/// - pcmPath: PCM 文件存放路径
|
||||
|
/// - outPut: 文件输出路径
|
||||
|
/// - result: 结果回调
|
||||
|
-(void)opusEncodeFile:(NSString *)pcmPath outPut:(NSString *_Nullable)outPut Resoult:(JLOpusEncoderConvertBlock _Nullable)result __attribute__((deprecated("Use opusEncodeFile:output:result: instead."))); |
||||
|
|
||||
|
/// 释放
|
||||
|
-(void)opusOnRelease; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,59 @@ |
|||||
|
//
|
||||
|
// JLOpusOptions.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2024/11/14.
|
||||
|
// Copyright © 2024 ZhuHai JieLi Technology Co.,Ltd. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
#define OPUS_JL_MAX_FRAME_SIZE 48000 * 2 |
||||
|
#define OPUS_JL_MAX_PACKET_SIZE 1500 |
||||
|
|
||||
|
|
||||
|
@interface JLOpusFormat : NSObject |
||||
|
|
||||
|
/// 采样率
|
||||
|
@property (nonatomic, assign) int sampleRate; |
||||
|
|
||||
|
/// 单/双声道
|
||||
|
@property (nonatomic, assign) int channels; |
||||
|
|
||||
|
/// 帧长度 20ms 默认值
|
||||
|
@property (nonatomic, assign) int frameDuration; |
||||
|
|
||||
|
/// BitRate
|
||||
|
@property (nonatomic, assign) int bitRate; |
||||
|
|
||||
|
/// 数据帧大小
|
||||
|
@property (nonatomic, assign, readonly) int frameSize; |
||||
|
|
||||
|
/// 数据大小
|
||||
|
@property (nonatomic, assign) int dataSize; |
||||
|
|
||||
|
/// 是否包含数据头部
|
||||
|
@property (nonatomic, assign) BOOL hasDataHeader; |
||||
|
|
||||
|
/// 是否开启slik语音优化
|
||||
|
@property (nonatomic, assign) BOOL usVoipSlik; |
||||
|
|
||||
|
|
||||
|
-(instancetype)init NS_UNAVAILABLE; |
||||
|
|
||||
|
/// 默认配置
|
||||
|
/// sampleRate: 16000
|
||||
|
/// channels: 1
|
||||
|
/// frameDuration: 20
|
||||
|
/// dataSize: 40
|
||||
|
/// frameSize: 320
|
||||
|
/// hasDataHeader: YES
|
||||
|
/// bitRate: 16000
|
||||
|
/// usVoipSlik: false
|
||||
|
+(JLOpusFormat*)defaultFormats; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,67 @@ |
|||||
|
//
|
||||
|
// JLOpusToOgg.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/5/16.
|
||||
|
// Copyright © 2025 ZhuHai JieLi Technology Co.,Ltd. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
typedef void(^JLOpusToOggConvertBlock)(NSData *_Nullable oggData, BOOL isLast, NSError *_Nullable error); |
||||
|
|
||||
|
/// 将Opus数据转换为Ogg数据
|
||||
|
@interface JLOpusToOgg : NSObject |
||||
|
|
||||
|
/// 转码内容的回调
|
||||
|
@property(nonatomic,strong)JLOpusToOggConvertBlock _Nullable convertBlock; |
||||
|
|
||||
|
/// 帧长
|
||||
|
/// - Parameter frameLen: 帧长
|
||||
|
/// 默认值 40
|
||||
|
- (instancetype)initWithFrameLength:(uint32_t)frameLen; |
||||
|
|
||||
|
/// 开始流
|
||||
|
-(void)startStream; |
||||
|
|
||||
|
/// 添加Opus数据
|
||||
|
/// - Parameter opusData: 符合杰理的无头裸 opus 数据
|
||||
|
- (void)appendOpusData:(NSData *)opusData; |
||||
|
|
||||
|
/// 关闭流
|
||||
|
- (void)closeStream; |
||||
|
|
||||
|
|
||||
|
/// 将Opus数据转换为Ogg数据
|
||||
|
/// opus 必须为 16000
|
||||
|
/// opus 必须是 单声道
|
||||
|
/// - Parameters:
|
||||
|
/// - opusData: 符合杰理的无头裸 opus 数据
|
||||
|
/// - frameLen: 帧长 公版默认帧长是 40
|
||||
|
/// - duration: 转换后的时长
|
||||
|
/// - error: 错误
|
||||
|
+ (NSData *_Nullable)convertOpusDataToOgg:(NSData *)opusData |
||||
|
frameLen:(uint32_t)frameLen |
||||
|
duration:(double *)duration |
||||
|
error:(NSError *__autoreleasing _Nullable *)error ; |
||||
|
|
||||
|
/// 将Opus文件转换为Ogg文件
|
||||
|
/// 符合杰理的无头裸 opus 文件
|
||||
|
/// opus 必须为 16000
|
||||
|
/// opus 必须是 单声道
|
||||
|
/// - Parameters:
|
||||
|
/// - opusFilePath: opus文件路径
|
||||
|
/// - oggFilePath: ogg文件路径
|
||||
|
/// - frameLen: 帧长 公版默认帧长是 40
|
||||
|
/// - duration: 转换后的时长
|
||||
|
+(void)convertOpusFileToOgg:(NSString *)opusFilePath |
||||
|
oggFilePath:(NSString *)oggFilePath |
||||
|
frameLen:(uint32_t)frameLen |
||||
|
duration:(double *)duration; |
||||
|
|
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,55 @@ |
|||||
|
//
|
||||
|
// JLPcmToWav.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/4/15.
|
||||
|
// Copyright © 2025 ZhuHai JieLi Technology Co.,Ltd. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
/// PCM 转 WAV
|
||||
|
@interface JLPcmToWav : NSObject |
||||
|
|
||||
|
#pragma mark - 流式编码接口 |
||||
|
|
||||
|
/// 初始化流式编码器
|
||||
|
/// @param outputPath 输出文件路径
|
||||
|
/// @param sampleRate 采样率(如 16000)
|
||||
|
/// @param numChannels 声道数(1 或 2)
|
||||
|
/// @param bitsPerSample 位深(16)
|
||||
|
- (instancetype)initWithOutputPath:(NSString *)outputPath |
||||
|
sampleRate:(uint32_t)sampleRate |
||||
|
numChannels:(uint16_t)numChannels |
||||
|
bitsPerSample:(uint16_t)bitsPerSample; |
||||
|
|
||||
|
/// 追加 PCM 数据(需确保数据格式与初始化参数一致)
|
||||
|
/// @param pcmData PCM 数据块
|
||||
|
/// @param error 错误信息
|
||||
|
- (BOOL)appendPCMData:(NSData *)pcmData error:(NSError **)error; |
||||
|
|
||||
|
/// 完成编码并关闭文件(必须调用以更新 WAV 头)
|
||||
|
/// @param error 错误信息
|
||||
|
- (BOOL)finishWithError:(NSError **)error; |
||||
|
|
||||
|
#pragma mark - 一次性编码接口(便捷方法) |
||||
|
|
||||
|
/// 将 PCM 数据一次性转为 WAV 文件
|
||||
|
/// @param pcmData PCM 数据块
|
||||
|
/// @param outputPath 输出文件路径
|
||||
|
/// @param sampleRate 采样率(如 16000)
|
||||
|
/// @param numChannels 声道数(1 或 2)
|
||||
|
/// @param bitsPerSample 位深(16)
|
||||
|
/// @param error 错误信息
|
||||
|
+ (BOOL)convertPCMData:(NSData *)pcmData |
||||
|
toWAVFile:(NSString *)outputPath |
||||
|
sampleRate:(uint32_t)sampleRate |
||||
|
numChannels:(uint16_t)numChannels |
||||
|
bitsPerSample:(uint16_t)bitsPerSample |
||||
|
error:(NSError **)error; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,51 @@ |
|||||
|
//
|
||||
|
// JLPcmToWtg.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/1/21.
|
||||
|
// Copyright © 2025 ZhuHai JieLi Technology Co.,Ltd. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLPcm2WtgModel : NSObject <NSCopying> |
||||
|
|
||||
|
/// 音频文件
|
||||
|
@property (nonatomic, copy) NSString *pcmPath; |
||||
|
|
||||
|
/// 输出文件
|
||||
|
@property (nonatomic, copy) NSString *wtgPath; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
|
||||
|
/// JLPcmToWtgProtocol
|
||||
|
@protocol JLPcmToWtgDelegate <NSObject> |
||||
|
|
||||
|
/// 音频转码完成
|
||||
|
/// - Parameter model: 音频转码模型
|
||||
|
- (void)convertPcmToWtgDone:(JLPcm2WtgModel *)model; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
/// 音频转码
|
||||
|
/// PCM 转 WTG
|
||||
|
@interface JLPcmToWtg : NSObject |
||||
|
|
||||
|
- (instancetype)init NS_UNAVAILABLE; |
||||
|
|
||||
|
/// 音频转码初始化
|
||||
|
/// - Parameter delegate: 音频转码代理
|
||||
|
- (instancetype)initWithDelegate:(id<JLPcmToWtgDelegate>)delegate; |
||||
|
|
||||
|
/// 音频转码
|
||||
|
/// 当前接口模型只限制 PCM 文件格式为:8k 16bit
|
||||
|
/// 输入的pcm文件(16bit,小端,8k采样率),wtg_filename:输出的wtg文件
|
||||
|
/// - Parameter model: 音频转码模型
|
||||
|
-(void)convertPcmToWtg:(JLPcm2WtgModel *)model; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,54 @@ |
|||||
|
//
|
||||
|
// JLSpeexUnit.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2024/11/14.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
@class JLSpeexDecoder; |
||||
|
|
||||
|
@protocol JLSpeexDelegate <NSObject> |
||||
|
|
||||
|
/// Speex 数据解码
|
||||
|
/// - Parameters:
|
||||
|
/// - decoder: 解码器
|
||||
|
/// - data: PCM 数据
|
||||
|
/// - error: 错误信息
|
||||
|
- (void)speexDecoder:(JLSpeexDecoder *)decoder Data:(NSData* _Nullable)data error:(NSError* _Nullable)error; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
typedef void(^JLSpeexConvertBlock)(NSString *_Nullable pcmPath,NSError *_Nullable error); |
||||
|
|
||||
|
/// Speex 数据解码
|
||||
|
@interface JLSpeexDecoder : NSObject |
||||
|
|
||||
|
-(instancetype)init NS_UNAVAILABLE; |
||||
|
|
||||
|
/// 初始化
|
||||
|
/// - Parameter delegate: 委托
|
||||
|
-(instancetype)initWithDelegate:(id<JLSpeexDelegate>)delegate; |
||||
|
|
||||
|
/// 委托
|
||||
|
@property (nonatomic, weak) id<JLSpeexDelegate> delegate; |
||||
|
|
||||
|
/// 输入 Speex 数据
|
||||
|
/// - Parameter data: Speex 数据
|
||||
|
-(void)speexInputData:(NSData*)data; |
||||
|
|
||||
|
/// 将 Speex 转换为 PCM
|
||||
|
/// - Parameters:
|
||||
|
/// - filePath: Speex 路径
|
||||
|
/// - opPath: 输出路径
|
||||
|
/// - result: 结果回调
|
||||
|
-(void)speexConvertToPcm:(NSString *)filePath outPutFilePath:(NSString * _Nullable)opPath Result:(JLSpeexConvertBlock)result; |
||||
|
|
||||
|
/// 释放对象
|
||||
|
-(void)speexOnRelease; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,6 @@ |
|||||
|
framework module JLAudioUnitKit { |
||||
|
umbrella header "JLAudioUnitKit.h" |
||||
|
export * |
||||
|
|
||||
|
module * { export * } |
||||
|
} |
||||
@ -0,0 +1,52 @@ |
|||||
|
DESCRIPTION |
||||
|
----------- |
||||
|
This package includes the files needed to build the fixed point implementation |
||||
|
of the ITU-T G.729 Appendix IV. |
||||
|
|
||||
|
DIFFERENCES WITH G.729B |
||||
|
----------------------- |
||||
|
The ANSI-C source code simulating the bit-exact, fixed point simulation |
||||
|
software of enhanced VAD is integrated into the G.729B source code. |
||||
|
The modification to the G.729B source code updated files of coder.c, |
||||
|
cod_ld8k.c, bits.c, dec_sid.c, dtx.c, qsidgain.c, qsidlsf.c, tab_dtx.c, |
||||
|
tab_dtx.h, ld8k.h, deleted vad.c/h and integrated the enhanced VAD functions |
||||
|
into the G.729B project. The modification also replaced the original basic |
||||
|
operators used in the original G.729B source code by the basic operators of |
||||
|
ITU-T Software Tool Library STL2005. |
||||
|
|
||||
|
COMPILATION |
||||
|
----------- |
||||
|
For UNIX systems the following makefiles are provided |
||||
|
|
||||
|
coder.mak |
||||
|
decoder.mak |
||||
|
|
||||
|
Edit the makefiles coder.mak and decoder.mak to set the proper options |
||||
|
for your system. |
||||
|
The command to compile and link all code on a UNIX system is |
||||
|
|
||||
|
make -f coder.mak |
||||
|
make -f decoder.mak |
||||
|
|
||||
|
For other platforms, the *.mak files can be used to work out the |
||||
|
compilation procedures. |
||||
|
|
||||
|
USAGE |
||||
|
----- |
||||
|
The command line instruction for the encoder is as follows: |
||||
|
coder inputfile bitstreamfile dtx_option mode x |
||||
|
where: |
||||
|
inputfile : 8 kHz sampled data file containing 16 bit linear PCM signal |
||||
|
bitstreamfile: binary file containing bitstream |
||||
|
dtx_option : = 1 : DTX enabled 0 : DTX disabled |
||||
|
mode X : Run encoder with enhanced VAD in operating point X, |
||||
|
X=0 or 1 or 2 representing balanced or quality-preferred |
||||
|
or bandwidth saving operating point, respectively |
||||
|
|
||||
|
The command line for the decoder is as follows: |
||||
|
decoder bitstreamfile outputfile |
||||
|
where: |
||||
|
bitstreamfile: binary file containing bitstream |
||||
|
outputfile : 8 kHz sampled data file containing 16 bit linear PCM signal |
||||
|
|
||||
|
|
||||
@ -0,0 +1,26 @@ |
|||||
|
//
|
||||
|
// JLAudioUnitKit.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2024/11/14.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
//! Project version number for JLAudioUnitKit.
|
||||
|
FOUNDATION_EXPORT double JLAudioUnitKitVersionNumber; |
||||
|
|
||||
|
//! Project version string for JLAudioUnitKit.
|
||||
|
FOUNDATION_EXPORT const unsigned char JLAudioUnitKitVersionString[]; |
||||
|
|
||||
|
// In this header, you should import all the public headers of your framework using statements like #import <JLAudioUnitKit/PublicHeader.h>
|
||||
|
|
||||
|
#import <JLAudioUnitKit/JLSpeexDecoder.h> |
||||
|
#import <JLAudioUnitKit/JLOpusDecoder.h> |
||||
|
#import <JLAudioUnitKit/JLOpusEncoder.h> |
||||
|
#import <JLAudioUnitKit/JLOpusFormat.h> |
||||
|
#import <JLAudioUnitKit/JLOpusEncodeConfig.h> |
||||
|
#import <JLAudioUnitKit/JLPcmToWtg.h> |
||||
|
#import <JLAudioUnitKit/JLPcmToWav.h> |
||||
|
#import <JLAudioUnitKit/JLAudioUnitPlayer.h> |
||||
|
#import <JLAudioUnitKit/JLOpusToOgg.h> |
||||
@ -0,0 +1,58 @@ |
|||||
|
//
|
||||
|
// JLAudioUnitPlayer.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/4/16.
|
||||
|
// Copyright © 2025 ZhuHai JieLi Technology Co.,Ltd. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <AudioToolbox/AudioToolbox.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
typedef NS_ENUM(NSInteger, JLAudioUnitPlayerType) { |
||||
|
JLAudioUnitPlayerTypeFile, // 支持 MP3/WAV/AAC 等文件格式(AVAudioPlayer)
|
||||
|
JLAudioUnitPlayerTypePCM // 支持 PCM 流式播放(Audio Queue)
|
||||
|
}; |
||||
|
|
||||
|
@class JLAudioUnitPlayer; |
||||
|
|
||||
|
@protocol JLAudioPlayerDelegate <NSObject> |
||||
|
@optional |
||||
|
// 播放进度更新(秒)
|
||||
|
- (void)audioPlayer:(JLAudioUnitPlayer *)player didUpdateProgress:(NSTimeInterval)currentTime duration:(NSTimeInterval)duration; |
||||
|
// 播放完成
|
||||
|
- (void)audioPlayerDidFinishPlaying:(JLAudioUnitPlayer *)player; |
||||
|
// 播放错误
|
||||
|
- (void)audioPlayer:(JLAudioUnitPlayer *)player didFailWithError:(NSError *)error; |
||||
|
@end |
||||
|
|
||||
|
@interface JLAudioUnitPlayer : NSObject |
||||
|
|
||||
|
@property (nonatomic, weak) id<JLAudioPlayerDelegate> delegate; |
||||
|
@property (nonatomic, readonly) NSTimeInterval duration; // 总时长(文件模式下有效)
|
||||
|
@property (nonatomic, readonly) NSTimeInterval currentTime; |
||||
|
@property (nonatomic, readonly) BOOL isPlaying; |
||||
|
|
||||
|
#pragma mark - 初始化方法 |
||||
|
|
||||
|
/// 文件播放初始化(MP3/WAV/AAC)
|
||||
|
- (instancetype)initWithAudioFile:(NSString *)filePath; |
||||
|
|
||||
|
/// PCM 流播放初始化(需指定格式)
|
||||
|
- (instancetype)initWithPCMFormat:(AudioStreamBasicDescription)format; |
||||
|
|
||||
|
#pragma mark - 播放控制 |
||||
|
- (void)play; |
||||
|
- (void)pause; |
||||
|
- (void)stop; |
||||
|
- (void)seekToTime:(NSTimeInterval)time; // 仅文件模式有效
|
||||
|
|
||||
|
#pragma mark - PCM 流式输入(仅 PCM 模式有效) |
||||
|
- (void)appendPCMData:(NSData *)pcmData; |
||||
|
- (void)endPCMStream; // 结束 PCM 流输入
|
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,66 @@ |
|||||
|
//
|
||||
|
// JLOpusDecoder.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2024/11/14.
|
||||
|
// Copyright © 2024 ZhuHai JieLi Technology Co.,Ltd. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <JLAudioUnitKit/JLOpusFormat.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
@class JLOpusDecoder; |
||||
|
|
||||
|
/// Opus 解码代理
|
||||
|
@protocol JLOpusDecoderDelegate <NSObject> |
||||
|
|
||||
|
/// Opus 数据解码
|
||||
|
/// - Parameters:
|
||||
|
/// - decoder: 解码器
|
||||
|
/// - data: pcm 数据
|
||||
|
/// - error: 错误信息
|
||||
|
-(void)opusDecoder:(JLOpusDecoder *)decoder Data:(NSData* _Nullable)data error:(NSError* _Nullable)error; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
typedef void(^JLOpusDecoderConvertBlock)(NSString *_Nullable pcmPath,NSError *_Nullable error); |
||||
|
|
||||
|
/// Opus 解码
|
||||
|
@interface JLOpusDecoder : NSObject |
||||
|
|
||||
|
/// 数据格式参数
|
||||
|
@property (nonatomic, strong) JLOpusFormat *opusFormat; |
||||
|
|
||||
|
/// 代理委托
|
||||
|
@property(nonatomic, weak) id<JLOpusDecoderDelegate> delegate; |
||||
|
|
||||
|
- (instancetype)init NS_UNAVAILABLE; |
||||
|
|
||||
|
/// 初始化
|
||||
|
/// - Parameters:
|
||||
|
/// - format: 解码格式
|
||||
|
/// - delegate: 代理
|
||||
|
- (instancetype)initDecoder:(JLOpusFormat *)format delegate:(id<JLOpusDecoderDelegate>)delegate; |
||||
|
|
||||
|
/// 重置解码格式
|
||||
|
/// - Parameter format: 解码格式
|
||||
|
-(void)resetOpusFramet:(JLOpusFormat *)format; |
||||
|
|
||||
|
/// 输入 Opus 数据
|
||||
|
/// - Parameter data: Opus 数据
|
||||
|
-(void)opusDecoderInputData:(NSData *)data; |
||||
|
|
||||
|
/// 解码文件
|
||||
|
/// - Parameters:
|
||||
|
/// - input: opus 文件
|
||||
|
/// - outPut: 输出路径
|
||||
|
/// - result: 结果回调
|
||||
|
-(void)opusDecodeFile:(NSString *)input outPut:(NSString *_Nullable)outPut Resoult:(JLOpusDecoderConvertBlock _Nullable)result; |
||||
|
|
||||
|
/// 释放
|
||||
|
-(void)opusOnRelease; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,83 @@ |
|||||
|
//
|
||||
|
// JLOpusEncodeConfig.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/8/27.
|
||||
|
// Copyright © 2025 ZhuHai JieLi Technology Co.,Ltd. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
typedef NS_ENUM(NSInteger, JLOpusEncoderBandwidth) { |
||||
|
///(4kHz bandpass)
|
||||
|
JLOpusEncoderBandwidthNarrowband = 1101, // 对应 OPUS_BANDWIDTH_NARROWBAND
|
||||
|
/// (6kHz bandpass)
|
||||
|
JLOpusEncoderBandwidthMediumband = 1102, // 对应 OPUS_BANDWIDTH_MEDIUMBAND
|
||||
|
/// (8kHz bandpass)
|
||||
|
JLOpusEncoderBandwidthWideband = 1103, // 对应 OPUS_BANDWIDTH_WIDEBAND
|
||||
|
/// (12kHz bandpass)
|
||||
|
JLOpusEncoderBandwidthSuperwideband = 1104,// 对应 OPUS_BANDWIDTH_SUPERWIDEBAND
|
||||
|
/// (20kHz bandpass)
|
||||
|
JLOpusEncoderBandwidthFullband = 1105 // 对应 OPUS_BANDWIDTH_FULLBAND
|
||||
|
}; |
||||
|
|
||||
|
@interface JLOpusEncodeConfig : NSObject |
||||
|
|
||||
|
/// 采样率
|
||||
|
@property (nonatomic, assign) int sampleRate; |
||||
|
|
||||
|
/// 单/双声道
|
||||
|
@property (nonatomic, assign) int channels; |
||||
|
|
||||
|
/// 帧长度 20ms 默认值
|
||||
|
@property (nonatomic, assign) int frameDuration; |
||||
|
|
||||
|
/// 帧长度
|
||||
|
@property (nonatomic, assign) int frameSize; |
||||
|
|
||||
|
/// BitRate
|
||||
|
@property (nonatomic, assign) int bitRate; |
||||
|
|
||||
|
/// 可变比特率开关,默认 NO(使用 CBR)
|
||||
|
@property (nonatomic, assign) BOOL useVBR; |
||||
|
|
||||
|
/// VBR 限制模式,默认 NO
|
||||
|
@property (nonatomic, assign) BOOL constrainedVBR; |
||||
|
|
||||
|
/// 编码复杂度 0~10,默认 5
|
||||
|
@property (nonatomic, assign) int complexity; |
||||
|
|
||||
|
/// 强制输出声道数 -1: 自适应, 1: 单声道, 2: 双声道, 默认 -1
|
||||
|
@property (nonatomic, assign) int forceChannels; |
||||
|
|
||||
|
/// 是否启用 DTX(静音段不发送数据),默认 NO
|
||||
|
@property (nonatomic, assign) BOOL useDTX; |
||||
|
|
||||
|
/// 网络丢包百分比,默认 0
|
||||
|
@property (nonatomic, assign) int packetLossPercent; |
||||
|
|
||||
|
/// 最大带宽限制(OPUS_BANDWIDTH_*),默认 FULLBAND
|
||||
|
@property (nonatomic, assign) int bandwidth; |
||||
|
|
||||
|
/// PCM 输入有效位深,默认 16
|
||||
|
@property (nonatomic, assign) int lsbDepth; |
||||
|
|
||||
|
/// 专家模式下帧时长(ms),默认与 frameDuration 一致
|
||||
|
@property (nonatomic, assign) int expertFrameDuration; |
||||
|
|
||||
|
/// 是否启用数据头
|
||||
|
/// 默认是启用的
|
||||
|
@property (nonatomic, assign) BOOL hasDataHeader; |
||||
|
|
||||
|
/// 创建默认编码配置
|
||||
|
+ (instancetype)defaultConfig; |
||||
|
|
||||
|
/// 获取默认配置
|
||||
|
/// 杰理的无头配置
|
||||
|
+ (instancetype)defaultJL; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,69 @@ |
|||||
|
//
|
||||
|
// JLOpusEncoder.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2024/11/14.
|
||||
|
// Copyright © 2024 ZhuHai JieLi Technology Co.,Ltd. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <JLAudioUnitKit/JLOpusEncodeConfig.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
@class JLOpusEncoder; |
||||
|
|
||||
|
/// Opus 编码代理
|
||||
|
@protocol JLOpusEncoderDelegate <NSObject> |
||||
|
|
||||
|
/// PCM 数据编码
|
||||
|
/// - Parameters:
|
||||
|
/// - encoder: 解码器
|
||||
|
/// - data: opus 数据
|
||||
|
/// - error: 错误信息
|
||||
|
-(void)opusEncoder:(JLOpusEncoder *)encoder Data:(NSData* _Nullable)data error:(NSError* _Nullable)error; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
typedef void(^JLOpusEncoderConvertBlock)(NSString *_Nullable pcmPath,NSError *_Nullable error); |
||||
|
|
||||
|
/// Opus 编码
|
||||
|
@interface JLOpusEncoder : NSObject |
||||
|
|
||||
|
/// 音频格式
|
||||
|
@property (nonatomic, strong) JLOpusEncodeConfig *opusFormat; |
||||
|
|
||||
|
/// 代理
|
||||
|
@property (nonatomic, weak) id<JLOpusEncoderDelegate> delegate; |
||||
|
|
||||
|
-(instancetype)init NS_UNAVAILABLE; |
||||
|
|
||||
|
/// 初始化
|
||||
|
/// - Parameters:
|
||||
|
/// - config: 音频格式
|
||||
|
/// - delegate: 代理
|
||||
|
-(instancetype)initFormat:(JLOpusEncodeConfig *)format delegate:(id<JLOpusEncoderDelegate>)delegate; |
||||
|
|
||||
|
/// PCM 数据
|
||||
|
/// - Parameter data: PCM 数据
|
||||
|
-(void)opusEncodeData:(NSData *)data; |
||||
|
|
||||
|
/// PCM 文件转换成 Opus 文件(推荐新接口,流式读取,避免一次性加载内存)
|
||||
|
/// - Parameters:
|
||||
|
/// - pcmPath: PCM 文件存放路径
|
||||
|
/// - output: 文件输出路径(可空,默认 ~/Documents/pcmToOpus.opus)
|
||||
|
/// - result: 结果回调,回传输出路径或错误
|
||||
|
-(void)opusEncodeFile:(NSString *)pcmPath output:(NSString *_Nullable)output result:(JLOpusEncoderConvertBlock _Nullable)result; |
||||
|
|
||||
|
/// 兼容旧接口(已废弃:命名拼写问题,且旧实现一次性读入文件)
|
||||
|
/// - Parameters:
|
||||
|
/// - pcmPath: PCM 文件存放路径
|
||||
|
/// - outPut: 文件输出路径
|
||||
|
/// - result: 结果回调
|
||||
|
-(void)opusEncodeFile:(NSString *)pcmPath outPut:(NSString *_Nullable)outPut Resoult:(JLOpusEncoderConvertBlock _Nullable)result __attribute__((deprecated("Use opusEncodeFile:output:result: instead."))); |
||||
|
|
||||
|
/// 释放
|
||||
|
-(void)opusOnRelease; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,59 @@ |
|||||
|
//
|
||||
|
// JLOpusOptions.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2024/11/14.
|
||||
|
// Copyright © 2024 ZhuHai JieLi Technology Co.,Ltd. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
#define OPUS_JL_MAX_FRAME_SIZE 48000 * 2 |
||||
|
#define OPUS_JL_MAX_PACKET_SIZE 1500 |
||||
|
|
||||
|
|
||||
|
@interface JLOpusFormat : NSObject |
||||
|
|
||||
|
/// 采样率
|
||||
|
@property (nonatomic, assign) int sampleRate; |
||||
|
|
||||
|
/// 单/双声道
|
||||
|
@property (nonatomic, assign) int channels; |
||||
|
|
||||
|
/// 帧长度 20ms 默认值
|
||||
|
@property (nonatomic, assign) int frameDuration; |
||||
|
|
||||
|
/// BitRate
|
||||
|
@property (nonatomic, assign) int bitRate; |
||||
|
|
||||
|
/// 数据帧大小
|
||||
|
@property (nonatomic, assign, readonly) int frameSize; |
||||
|
|
||||
|
/// 数据大小
|
||||
|
@property (nonatomic, assign) int dataSize; |
||||
|
|
||||
|
/// 是否包含数据头部
|
||||
|
@property (nonatomic, assign) BOOL hasDataHeader; |
||||
|
|
||||
|
/// 是否开启slik语音优化
|
||||
|
@property (nonatomic, assign) BOOL usVoipSlik; |
||||
|
|
||||
|
|
||||
|
-(instancetype)init NS_UNAVAILABLE; |
||||
|
|
||||
|
/// 默认配置
|
||||
|
/// sampleRate: 16000
|
||||
|
/// channels: 1
|
||||
|
/// frameDuration: 20
|
||||
|
/// dataSize: 40
|
||||
|
/// frameSize: 320
|
||||
|
/// hasDataHeader: YES
|
||||
|
/// bitRate: 16000
|
||||
|
/// usVoipSlik: false
|
||||
|
+(JLOpusFormat*)defaultFormats; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,67 @@ |
|||||
|
//
|
||||
|
// JLOpusToOgg.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/5/16.
|
||||
|
// Copyright © 2025 ZhuHai JieLi Technology Co.,Ltd. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
typedef void(^JLOpusToOggConvertBlock)(NSData *_Nullable oggData, BOOL isLast, NSError *_Nullable error); |
||||
|
|
||||
|
/// 将Opus数据转换为Ogg数据
|
||||
|
@interface JLOpusToOgg : NSObject |
||||
|
|
||||
|
/// 转码内容的回调
|
||||
|
@property(nonatomic,strong)JLOpusToOggConvertBlock _Nullable convertBlock; |
||||
|
|
||||
|
/// 帧长
|
||||
|
/// - Parameter frameLen: 帧长
|
||||
|
/// 默认值 40
|
||||
|
- (instancetype)initWithFrameLength:(uint32_t)frameLen; |
||||
|
|
||||
|
/// 开始流
|
||||
|
-(void)startStream; |
||||
|
|
||||
|
/// 添加Opus数据
|
||||
|
/// - Parameter opusData: 符合杰理的无头裸 opus 数据
|
||||
|
- (void)appendOpusData:(NSData *)opusData; |
||||
|
|
||||
|
/// 关闭流
|
||||
|
- (void)closeStream; |
||||
|
|
||||
|
|
||||
|
/// 将Opus数据转换为Ogg数据
|
||||
|
/// opus 必须为 16000
|
||||
|
/// opus 必须是 单声道
|
||||
|
/// - Parameters:
|
||||
|
/// - opusData: 符合杰理的无头裸 opus 数据
|
||||
|
/// - frameLen: 帧长 公版默认帧长是 40
|
||||
|
/// - duration: 转换后的时长
|
||||
|
/// - error: 错误
|
||||
|
+ (NSData *_Nullable)convertOpusDataToOgg:(NSData *)opusData |
||||
|
frameLen:(uint32_t)frameLen |
||||
|
duration:(double *)duration |
||||
|
error:(NSError *__autoreleasing _Nullable *)error ; |
||||
|
|
||||
|
/// 将Opus文件转换为Ogg文件
|
||||
|
/// 符合杰理的无头裸 opus 文件
|
||||
|
/// opus 必须为 16000
|
||||
|
/// opus 必须是 单声道
|
||||
|
/// - Parameters:
|
||||
|
/// - opusFilePath: opus文件路径
|
||||
|
/// - oggFilePath: ogg文件路径
|
||||
|
/// - frameLen: 帧长 公版默认帧长是 40
|
||||
|
/// - duration: 转换后的时长
|
||||
|
+(void)convertOpusFileToOgg:(NSString *)opusFilePath |
||||
|
oggFilePath:(NSString *)oggFilePath |
||||
|
frameLen:(uint32_t)frameLen |
||||
|
duration:(double *)duration; |
||||
|
|
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,55 @@ |
|||||
|
//
|
||||
|
// JLPcmToWav.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/4/15.
|
||||
|
// Copyright © 2025 ZhuHai JieLi Technology Co.,Ltd. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
/// PCM 转 WAV
|
||||
|
@interface JLPcmToWav : NSObject |
||||
|
|
||||
|
#pragma mark - 流式编码接口 |
||||
|
|
||||
|
/// 初始化流式编码器
|
||||
|
/// @param outputPath 输出文件路径
|
||||
|
/// @param sampleRate 采样率(如 16000)
|
||||
|
/// @param numChannels 声道数(1 或 2)
|
||||
|
/// @param bitsPerSample 位深(16)
|
||||
|
- (instancetype)initWithOutputPath:(NSString *)outputPath |
||||
|
sampleRate:(uint32_t)sampleRate |
||||
|
numChannels:(uint16_t)numChannels |
||||
|
bitsPerSample:(uint16_t)bitsPerSample; |
||||
|
|
||||
|
/// 追加 PCM 数据(需确保数据格式与初始化参数一致)
|
||||
|
/// @param pcmData PCM 数据块
|
||||
|
/// @param error 错误信息
|
||||
|
- (BOOL)appendPCMData:(NSData *)pcmData error:(NSError **)error; |
||||
|
|
||||
|
/// 完成编码并关闭文件(必须调用以更新 WAV 头)
|
||||
|
/// @param error 错误信息
|
||||
|
- (BOOL)finishWithError:(NSError **)error; |
||||
|
|
||||
|
#pragma mark - 一次性编码接口(便捷方法) |
||||
|
|
||||
|
/// 将 PCM 数据一次性转为 WAV 文件
|
||||
|
/// @param pcmData PCM 数据块
|
||||
|
/// @param outputPath 输出文件路径
|
||||
|
/// @param sampleRate 采样率(如 16000)
|
||||
|
/// @param numChannels 声道数(1 或 2)
|
||||
|
/// @param bitsPerSample 位深(16)
|
||||
|
/// @param error 错误信息
|
||||
|
+ (BOOL)convertPCMData:(NSData *)pcmData |
||||
|
toWAVFile:(NSString *)outputPath |
||||
|
sampleRate:(uint32_t)sampleRate |
||||
|
numChannels:(uint16_t)numChannels |
||||
|
bitsPerSample:(uint16_t)bitsPerSample |
||||
|
error:(NSError **)error; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,51 @@ |
|||||
|
//
|
||||
|
// JLPcmToWtg.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/1/21.
|
||||
|
// Copyright © 2025 ZhuHai JieLi Technology Co.,Ltd. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLPcm2WtgModel : NSObject <NSCopying> |
||||
|
|
||||
|
/// 音频文件
|
||||
|
@property (nonatomic, copy) NSString *pcmPath; |
||||
|
|
||||
|
/// 输出文件
|
||||
|
@property (nonatomic, copy) NSString *wtgPath; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
|
||||
|
/// JLPcmToWtgProtocol
|
||||
|
@protocol JLPcmToWtgDelegate <NSObject> |
||||
|
|
||||
|
/// 音频转码完成
|
||||
|
/// - Parameter model: 音频转码模型
|
||||
|
- (void)convertPcmToWtgDone:(JLPcm2WtgModel *)model; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
/// 音频转码
|
||||
|
/// PCM 转 WTG
|
||||
|
@interface JLPcmToWtg : NSObject |
||||
|
|
||||
|
- (instancetype)init NS_UNAVAILABLE; |
||||
|
|
||||
|
/// 音频转码初始化
|
||||
|
/// - Parameter delegate: 音频转码代理
|
||||
|
- (instancetype)initWithDelegate:(id<JLPcmToWtgDelegate>)delegate; |
||||
|
|
||||
|
/// 音频转码
|
||||
|
/// 当前接口模型只限制 PCM 文件格式为:8k 16bit
|
||||
|
/// 输入的pcm文件(16bit,小端,8k采样率),wtg_filename:输出的wtg文件
|
||||
|
/// - Parameter model: 音频转码模型
|
||||
|
-(void)convertPcmToWtg:(JLPcm2WtgModel *)model; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,54 @@ |
|||||
|
//
|
||||
|
// JLSpeexUnit.h
|
||||
|
// JLAudioUnitKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2024/11/14.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
@class JLSpeexDecoder; |
||||
|
|
||||
|
@protocol JLSpeexDelegate <NSObject> |
||||
|
|
||||
|
/// Speex 数据解码
|
||||
|
/// - Parameters:
|
||||
|
/// - decoder: 解码器
|
||||
|
/// - data: PCM 数据
|
||||
|
/// - error: 错误信息
|
||||
|
- (void)speexDecoder:(JLSpeexDecoder *)decoder Data:(NSData* _Nullable)data error:(NSError* _Nullable)error; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
typedef void(^JLSpeexConvertBlock)(NSString *_Nullable pcmPath,NSError *_Nullable error); |
||||
|
|
||||
|
/// Speex 数据解码
|
||||
|
@interface JLSpeexDecoder : NSObject |
||||
|
|
||||
|
-(instancetype)init NS_UNAVAILABLE; |
||||
|
|
||||
|
/// 初始化
|
||||
|
/// - Parameter delegate: 委托
|
||||
|
-(instancetype)initWithDelegate:(id<JLSpeexDelegate>)delegate; |
||||
|
|
||||
|
/// 委托
|
||||
|
@property (nonatomic, weak) id<JLSpeexDelegate> delegate; |
||||
|
|
||||
|
/// 输入 Speex 数据
|
||||
|
/// - Parameter data: Speex 数据
|
||||
|
-(void)speexInputData:(NSData*)data; |
||||
|
|
||||
|
/// 将 Speex 转换为 PCM
|
||||
|
/// - Parameters:
|
||||
|
/// - filePath: Speex 路径
|
||||
|
/// - opPath: 输出路径
|
||||
|
/// - result: 结果回调
|
||||
|
-(void)speexConvertToPcm:(NSString *)filePath outPutFilePath:(NSString * _Nullable)opPath Result:(JLSpeexConvertBlock)result; |
||||
|
|
||||
|
/// 释放对象
|
||||
|
-(void)speexOnRelease; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,6 @@ |
|||||
|
framework module JLAudioUnitKit { |
||||
|
umbrella header "JLAudioUnitKit.h" |
||||
|
export * |
||||
|
|
||||
|
module * { export * } |
||||
|
} |
||||
@ -0,0 +1,234 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
|
<plist version="1.0"> |
||||
|
<dict> |
||||
|
<key>files</key> |
||||
|
<dict> |
||||
|
<key>Headers/JLAudioUnitKit.h</key> |
||||
|
<data> |
||||
|
hE2nr+4q2/NdSgBaayJc7ZoOXb0= |
||||
|
</data> |
||||
|
<key>Headers/JLAudioUnitPlayer.h</key> |
||||
|
<data> |
||||
|
QPMLV/XA8hjk39d+vT+S57t0fDU= |
||||
|
</data> |
||||
|
<key>Headers/JLOpusDecoder.h</key> |
||||
|
<data> |
||||
|
K1bYcaJ67prImNlGuldy8csTRHc= |
||||
|
</data> |
||||
|
<key>Headers/JLOpusEncodeConfig.h</key> |
||||
|
<data> |
||||
|
NArAew5QxnSJGsD0tRzQ2V7bHrY= |
||||
|
</data> |
||||
|
<key>Headers/JLOpusEncoder.h</key> |
||||
|
<data> |
||||
|
7DYUlvXrp1QC9l2XZ5tNHtsmsBQ= |
||||
|
</data> |
||||
|
<key>Headers/JLOpusFormat.h</key> |
||||
|
<data> |
||||
|
Du1x3VNk87NstmspRk7ElijuZrk= |
||||
|
</data> |
||||
|
<key>Headers/JLOpusToOgg.h</key> |
||||
|
<data> |
||||
|
fSJT6LcyylJHTHX1wsN3JHG2FxU= |
||||
|
</data> |
||||
|
<key>Headers/JLPcmToWav.h</key> |
||||
|
<data> |
||||
|
/BbZmqmWpWVBusXqjnzbjaBNCNg= |
||||
|
</data> |
||||
|
<key>Headers/JLPcmToWtg.h</key> |
||||
|
<data> |
||||
|
zoOdOFpIulND0F1OrfIXR1H0kh0= |
||||
|
</data> |
||||
|
<key>Headers/JLSpeexDecoder.h</key> |
||||
|
<data> |
||||
|
5ecBKtD3BDGccLiKpTs0fS0CSgs= |
||||
|
</data> |
||||
|
<key>Info.plist</key> |
||||
|
<data> |
||||
|
pXqOzYCqPnMLY0nonWZTcbfnlhU= |
||||
|
</data> |
||||
|
<key>Modules/module.modulemap</key> |
||||
|
<data> |
||||
|
2vYf0m+hGTOTapX6sliv/F1E1VI= |
||||
|
</data> |
||||
|
<key>readme.txt</key> |
||||
|
<data> |
||||
|
wijZX0Dr2OlODWS6XYbpeKabb7g= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>files2</key> |
||||
|
<dict> |
||||
|
<key>Headers/JLAudioUnitKit.h</key> |
||||
|
<dict> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
J5pq6Ed3fR+cQ7CGPXDoPl7BZzix7Cjf5yJZFRRvxqs= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLAudioUnitPlayer.h</key> |
||||
|
<dict> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
qBz0OA82HUH4kBtO8xiUw7Q4ohtiIvCSYfCqax5xjJY= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLOpusDecoder.h</key> |
||||
|
<dict> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
cnAj6Nt6vgRLoEH6QY3Q+gYpjcxGPN1OLLZbCgdLymI= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLOpusEncodeConfig.h</key> |
||||
|
<dict> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
qrPpsrXaNCvyxf0/gUZtvveL+ywsfgBUrMPFibjneOo= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLOpusEncoder.h</key> |
||||
|
<dict> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
YoHsvoGH2VEjvEIzEa7t+cAnzf8kHEU3dJTd03ABr1w= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLOpusFormat.h</key> |
||||
|
<dict> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
Nm6vM9/EbFzyIWbsysu6EOO2S+vZVeplcop4NvoJaMA= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLOpusToOgg.h</key> |
||||
|
<dict> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
dNSvJJnED/6E1p7TYZ4zBzUnLDVsZ8NovuNYjge6T/w= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLPcmToWav.h</key> |
||||
|
<dict> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
l/SEQhSFh7ctq/pBV+Z7X+Z0/gz30eCw3s31otjMPho= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLPcmToWtg.h</key> |
||||
|
<dict> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
MwtbX3Sa0nytA+m11x+1rDvP4WvJnZLljshuT5B3WD0= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLSpeexDecoder.h</key> |
||||
|
<dict> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
pV0X3xn07Ps7wE+0EfL9Yu/08tp8Ug8s14iDigRU46o= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Modules/module.modulemap</key> |
||||
|
<dict> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
akFCUM59aSAaRM/ADWQ138YT9GD3oAjcaTvTUo24Ml8= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>readme.txt</key> |
||||
|
<dict> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
+2GG9ORrf2yJnBe2joKWtyBZL9p2sCH8EXqK1GIgW0E= |
||||
|
</data> |
||||
|
</dict> |
||||
|
</dict> |
||||
|
<key>rules</key> |
||||
|
<dict> |
||||
|
<key>^.*</key> |
||||
|
<true/> |
||||
|
<key>^.*\.lproj/</key> |
||||
|
<dict> |
||||
|
<key>optional</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>1000</real> |
||||
|
</dict> |
||||
|
<key>^.*\.lproj/locversion.plist$</key> |
||||
|
<dict> |
||||
|
<key>omit</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>1100</real> |
||||
|
</dict> |
||||
|
<key>^Base\.lproj/</key> |
||||
|
<dict> |
||||
|
<key>weight</key> |
||||
|
<real>1010</real> |
||||
|
</dict> |
||||
|
<key>^version.plist$</key> |
||||
|
<true/> |
||||
|
</dict> |
||||
|
<key>rules2</key> |
||||
|
<dict> |
||||
|
<key>.*\.dSYM($|/)</key> |
||||
|
<dict> |
||||
|
<key>weight</key> |
||||
|
<real>11</real> |
||||
|
</dict> |
||||
|
<key>^(.*/)?\.DS_Store$</key> |
||||
|
<dict> |
||||
|
<key>omit</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>2000</real> |
||||
|
</dict> |
||||
|
<key>^.*</key> |
||||
|
<true/> |
||||
|
<key>^.*\.lproj/</key> |
||||
|
<dict> |
||||
|
<key>optional</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>1000</real> |
||||
|
</dict> |
||||
|
<key>^.*\.lproj/locversion.plist$</key> |
||||
|
<dict> |
||||
|
<key>omit</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>1100</real> |
||||
|
</dict> |
||||
|
<key>^Base\.lproj/</key> |
||||
|
<dict> |
||||
|
<key>weight</key> |
||||
|
<real>1010</real> |
||||
|
</dict> |
||||
|
<key>^Info\.plist$</key> |
||||
|
<dict> |
||||
|
<key>omit</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>20</real> |
||||
|
</dict> |
||||
|
<key>^PkgInfo$</key> |
||||
|
<dict> |
||||
|
<key>omit</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>20</real> |
||||
|
</dict> |
||||
|
<key>^embedded\.provisionprofile$</key> |
||||
|
<dict> |
||||
|
<key>weight</key> |
||||
|
<real>20</real> |
||||
|
</dict> |
||||
|
<key>^version\.plist$</key> |
||||
|
<dict> |
||||
|
<key>weight</key> |
||||
|
<real>20</real> |
||||
|
</dict> |
||||
|
</dict> |
||||
|
</dict> |
||||
|
</plist> |
||||
@ -0,0 +1,52 @@ |
|||||
|
DESCRIPTION |
||||
|
----------- |
||||
|
This package includes the files needed to build the fixed point implementation |
||||
|
of the ITU-T G.729 Appendix IV. |
||||
|
|
||||
|
DIFFERENCES WITH G.729B |
||||
|
----------------------- |
||||
|
The ANSI-C source code simulating the bit-exact, fixed point simulation |
||||
|
software of enhanced VAD is integrated into the G.729B source code. |
||||
|
The modification to the G.729B source code updated files of coder.c, |
||||
|
cod_ld8k.c, bits.c, dec_sid.c, dtx.c, qsidgain.c, qsidlsf.c, tab_dtx.c, |
||||
|
tab_dtx.h, ld8k.h, deleted vad.c/h and integrated the enhanced VAD functions |
||||
|
into the G.729B project. The modification also replaced the original basic |
||||
|
operators used in the original G.729B source code by the basic operators of |
||||
|
ITU-T Software Tool Library STL2005. |
||||
|
|
||||
|
COMPILATION |
||||
|
----------- |
||||
|
For UNIX systems the following makefiles are provided |
||||
|
|
||||
|
coder.mak |
||||
|
decoder.mak |
||||
|
|
||||
|
Edit the makefiles coder.mak and decoder.mak to set the proper options |
||||
|
for your system. |
||||
|
The command to compile and link all code on a UNIX system is |
||||
|
|
||||
|
make -f coder.mak |
||||
|
make -f decoder.mak |
||||
|
|
||||
|
For other platforms, the *.mak files can be used to work out the |
||||
|
compilation procedures. |
||||
|
|
||||
|
USAGE |
||||
|
----- |
||||
|
The command line instruction for the encoder is as follows: |
||||
|
coder inputfile bitstreamfile dtx_option mode x |
||||
|
where: |
||||
|
inputfile : 8 kHz sampled data file containing 16 bit linear PCM signal |
||||
|
bitstreamfile: binary file containing bitstream |
||||
|
dtx_option : = 1 : DTX enabled 0 : DTX disabled |
||||
|
mode X : Run encoder with enhanced VAD in operating point X, |
||||
|
X=0 or 1 or 2 representing balanced or quality-preferred |
||||
|
or bandwidth saving operating point, respectively |
||||
|
|
||||
|
The command line for the decoder is as follows: |
||||
|
decoder bitstreamfile outputfile |
||||
|
where: |
||||
|
bitstreamfile: binary file containing bitstream |
||||
|
outputfile : 8 kHz sampled data file containing 16 bit linear PCM signal |
||||
|
|
||||
|
|
||||
@ -0,0 +1,44 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
|
<plist version="1.0"> |
||||
|
<dict> |
||||
|
<key>AvailableLibraries</key> |
||||
|
<array> |
||||
|
<dict> |
||||
|
<key>BinaryPath</key> |
||||
|
<string>JLLogHelper.framework/JLLogHelper</string> |
||||
|
<key>LibraryIdentifier</key> |
||||
|
<string>ios-arm64_x86_64-simulator</string> |
||||
|
<key>LibraryPath</key> |
||||
|
<string>JLLogHelper.framework</string> |
||||
|
<key>SupportedArchitectures</key> |
||||
|
<array> |
||||
|
<string>arm64</string> |
||||
|
<string>x86_64</string> |
||||
|
</array> |
||||
|
<key>SupportedPlatform</key> |
||||
|
<string>ios</string> |
||||
|
<key>SupportedPlatformVariant</key> |
||||
|
<string>simulator</string> |
||||
|
</dict> |
||||
|
<dict> |
||||
|
<key>BinaryPath</key> |
||||
|
<string>JLLogHelper.framework/JLLogHelper</string> |
||||
|
<key>LibraryIdentifier</key> |
||||
|
<string>ios-arm64</string> |
||||
|
<key>LibraryPath</key> |
||||
|
<string>JLLogHelper.framework</string> |
||||
|
<key>SupportedArchitectures</key> |
||||
|
<array> |
||||
|
<string>arm64</string> |
||||
|
</array> |
||||
|
<key>SupportedPlatform</key> |
||||
|
<string>ios</string> |
||||
|
</dict> |
||||
|
</array> |
||||
|
<key>CFBundlePackageType</key> |
||||
|
<string>XFWK</string> |
||||
|
<key>XCFrameworkFormatVersion</key> |
||||
|
<string>1.0</string> |
||||
|
</dict> |
||||
|
</plist> |
||||
@ -0,0 +1,19 @@ |
|||||
|
//
|
||||
|
// JLLogHelper.h
|
||||
|
// JLLogHelper
|
||||
|
//
|
||||
|
// Created by EzioChan on 2024/5/8.
|
||||
|
// Copyright © 2024 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
//! Project version number for JLLogHelper.
|
||||
|
FOUNDATION_EXPORT double JLLogHelperVersionNumber; |
||||
|
|
||||
|
//! Project version string for JLLogHelper.
|
||||
|
FOUNDATION_EXPORT const unsigned char JLLogHelperVersionString[]; |
||||
|
|
||||
|
// In this header, you should import all the public headers of your framework using statements like #import <JLLogHelper/PublicHeader.h>
|
||||
|
|
||||
|
#import <JLLogHelper/JLLogManager.h> |
||||
@ -0,0 +1,88 @@ |
|||||
|
//
|
||||
|
// JLLogManager.h
|
||||
|
// JLLogHelper
|
||||
|
//
|
||||
|
// Created by EzioChan on 2024/5/8.
|
||||
|
// Copyright © 2024 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
/// 打印宏
|
||||
|
#define kJLLog(level,fmt...) [JLLogManager logLevel:level funcName:__FUNCTION__ line:__LINE__ format:fmt] |
||||
|
|
||||
|
typedef NS_ENUM(NSInteger, JLLOG_LEVEL) { |
||||
|
JLLOG_COMPLETE = 0, |
||||
|
JLLOG_DEBUG = 1, |
||||
|
JLLOG_INFO = 2, |
||||
|
JLLOG_WARN = 3, |
||||
|
JLLOG_ERROR = 4, |
||||
|
}; |
||||
|
|
||||
|
/// 日志打印
|
||||
|
@interface JLLogManager : NSObject |
||||
|
|
||||
|
/// 打印SDK版本
|
||||
|
+(void)sdkVersion; |
||||
|
|
||||
|
///清理已存储的打印
|
||||
|
+(void)clearLog; |
||||
|
|
||||
|
/**
|
||||
|
* 打印文本 |
||||
|
*/ |
||||
|
+(void)openLogTextFile; |
||||
|
|
||||
|
///重定向保存日志文件路径设置
|
||||
|
/// @param path 路径
|
||||
|
+(void)redirectLogPath:(NSString *)path; |
||||
|
|
||||
|
/// 收集日志回调接口
|
||||
|
/// @param block 回调
|
||||
|
+(void)collectLog:(void(^)(NSString *log))block; |
||||
|
|
||||
|
/// 打印时间
|
||||
|
/// @param isTimeStamp 是否打印 default is false
|
||||
|
+(void)logWithTimestamp:(BOOL)isTimeStamp; |
||||
|
|
||||
|
/// 把日志保存存储起来
|
||||
|
/// @param isSave 是否保存 default is yes
|
||||
|
+(void)saveLogAsFile:(BOOL)isSave; |
||||
|
|
||||
|
///LOG使能与等级,默认开启且debug等级。
|
||||
|
/// @param enable LOG使能
|
||||
|
/// @param isMore 是否打印【函数名&行号】
|
||||
|
/// @param level LOG等级
|
||||
|
+(void)setLog:(BOOL)enable IsMore:(BOOL)isMore Level:(JLLOG_LEVEL)level; |
||||
|
|
||||
|
/// 打印函数
|
||||
|
/// @param level LOG等级
|
||||
|
/// @param func 函数名
|
||||
|
/// @param line 行号
|
||||
|
/// @param format 内容
|
||||
|
+(void)logLevel:(JLLOG_LEVEL)level funcName:(const char* _Nullable)func line:(const int)line format:(NSString * _Nonnull)format,...; |
||||
|
|
||||
|
/// 打印
|
||||
|
/// @param something 任意字符串内容
|
||||
|
+(void)logSomething:(NSString *)something; |
||||
|
|
||||
|
/// 打印对象
|
||||
|
/// @param object 任意对象
|
||||
|
+(void)logObject:(id)object; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// 打印
|
||||
|
/// @param level LOG等级
|
||||
|
/// @param content 内容
|
||||
|
+(void)logLevel:(JLLOG_LEVEL)level content:(NSString *)content; |
||||
|
|
||||
|
/// 保存日志信息到文件中
|
||||
|
/// @param logContent 日志内容
|
||||
|
+(void)saveLog:(NSString *)logContent; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,6 @@ |
|||||
|
framework module JLLogHelper { |
||||
|
umbrella header "JLLogHelper.h" |
||||
|
export * |
||||
|
|
||||
|
module * { export * } |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
//
|
||||
|
// JLLogHelper.h
|
||||
|
// JLLogHelper
|
||||
|
//
|
||||
|
// Created by EzioChan on 2024/5/8.
|
||||
|
// Copyright © 2024 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
//! Project version number for JLLogHelper.
|
||||
|
FOUNDATION_EXPORT double JLLogHelperVersionNumber; |
||||
|
|
||||
|
//! Project version string for JLLogHelper.
|
||||
|
FOUNDATION_EXPORT const unsigned char JLLogHelperVersionString[]; |
||||
|
|
||||
|
// In this header, you should import all the public headers of your framework using statements like #import <JLLogHelper/PublicHeader.h>
|
||||
|
|
||||
|
#import <JLLogHelper/JLLogManager.h> |
||||
@ -0,0 +1,88 @@ |
|||||
|
//
|
||||
|
// JLLogManager.h
|
||||
|
// JLLogHelper
|
||||
|
//
|
||||
|
// Created by EzioChan on 2024/5/8.
|
||||
|
// Copyright © 2024 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
/// 打印宏
|
||||
|
#define kJLLog(level,fmt...) [JLLogManager logLevel:level funcName:__FUNCTION__ line:__LINE__ format:fmt] |
||||
|
|
||||
|
typedef NS_ENUM(NSInteger, JLLOG_LEVEL) { |
||||
|
JLLOG_COMPLETE = 0, |
||||
|
JLLOG_DEBUG = 1, |
||||
|
JLLOG_INFO = 2, |
||||
|
JLLOG_WARN = 3, |
||||
|
JLLOG_ERROR = 4, |
||||
|
}; |
||||
|
|
||||
|
/// 日志打印
|
||||
|
@interface JLLogManager : NSObject |
||||
|
|
||||
|
/// 打印SDK版本
|
||||
|
+(void)sdkVersion; |
||||
|
|
||||
|
///清理已存储的打印
|
||||
|
+(void)clearLog; |
||||
|
|
||||
|
/**
|
||||
|
* 打印文本 |
||||
|
*/ |
||||
|
+(void)openLogTextFile; |
||||
|
|
||||
|
///重定向保存日志文件路径设置
|
||||
|
/// @param path 路径
|
||||
|
+(void)redirectLogPath:(NSString *)path; |
||||
|
|
||||
|
/// 收集日志回调接口
|
||||
|
/// @param block 回调
|
||||
|
+(void)collectLog:(void(^)(NSString *log))block; |
||||
|
|
||||
|
/// 打印时间
|
||||
|
/// @param isTimeStamp 是否打印 default is false
|
||||
|
+(void)logWithTimestamp:(BOOL)isTimeStamp; |
||||
|
|
||||
|
/// 把日志保存存储起来
|
||||
|
/// @param isSave 是否保存 default is yes
|
||||
|
+(void)saveLogAsFile:(BOOL)isSave; |
||||
|
|
||||
|
///LOG使能与等级,默认开启且debug等级。
|
||||
|
/// @param enable LOG使能
|
||||
|
/// @param isMore 是否打印【函数名&行号】
|
||||
|
/// @param level LOG等级
|
||||
|
+(void)setLog:(BOOL)enable IsMore:(BOOL)isMore Level:(JLLOG_LEVEL)level; |
||||
|
|
||||
|
/// 打印函数
|
||||
|
/// @param level LOG等级
|
||||
|
/// @param func 函数名
|
||||
|
/// @param line 行号
|
||||
|
/// @param format 内容
|
||||
|
+(void)logLevel:(JLLOG_LEVEL)level funcName:(const char* _Nullable)func line:(const int)line format:(NSString * _Nonnull)format,...; |
||||
|
|
||||
|
/// 打印
|
||||
|
/// @param something 任意字符串内容
|
||||
|
+(void)logSomething:(NSString *)something; |
||||
|
|
||||
|
/// 打印对象
|
||||
|
/// @param object 任意对象
|
||||
|
+(void)logObject:(id)object; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// 打印
|
||||
|
/// @param level LOG等级
|
||||
|
/// @param content 内容
|
||||
|
+(void)logLevel:(JLLOG_LEVEL)level content:(NSString *)content; |
||||
|
|
||||
|
/// 保存日志信息到文件中
|
||||
|
/// @param logContent 日志内容
|
||||
|
+(void)saveLog:(NSString *)logContent; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,6 @@ |
|||||
|
framework module JLLogHelper { |
||||
|
umbrella header "JLLogHelper.h" |
||||
|
export * |
||||
|
|
||||
|
module * { export * } |
||||
|
} |
||||
@ -0,0 +1,147 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
|
<plist version="1.0"> |
||||
|
<dict> |
||||
|
<key>files</key> |
||||
|
<dict> |
||||
|
<key>Headers/JLLogHelper.h</key> |
||||
|
<data> |
||||
|
TahP/o16a5TgPGLNFs/QhND95FU= |
||||
|
</data> |
||||
|
<key>Headers/JLLogManager.h</key> |
||||
|
<data> |
||||
|
Be4QtnAF0IDSmlMZquwyK7LLd8w= |
||||
|
</data> |
||||
|
<key>Info.plist</key> |
||||
|
<data> |
||||
|
PJl+BYy7qbdneBUnydYicJKb/SM= |
||||
|
</data> |
||||
|
<key>Modules/module.modulemap</key> |
||||
|
<data> |
||||
|
YwPsApnJXdp+uskVahraY2UK/Jk= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>files2</key> |
||||
|
<dict> |
||||
|
<key>Headers/JLLogHelper.h</key> |
||||
|
<dict> |
||||
|
<key>hash</key> |
||||
|
<data> |
||||
|
TahP/o16a5TgPGLNFs/QhND95FU= |
||||
|
</data> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
nD5WuwBhpaoCwOGeWB5OusXVP21nYy+/Hcn6nPideIk= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLLogManager.h</key> |
||||
|
<dict> |
||||
|
<key>hash</key> |
||||
|
<data> |
||||
|
Be4QtnAF0IDSmlMZquwyK7LLd8w= |
||||
|
</data> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
vOgQgQVptNwQdUKpCW2EBNruc0PL6BnkSjxVpptJsf0= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Modules/module.modulemap</key> |
||||
|
<dict> |
||||
|
<key>hash</key> |
||||
|
<data> |
||||
|
YwPsApnJXdp+uskVahraY2UK/Jk= |
||||
|
</data> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
ViwpXSuoKoiEUwMpetyre+mlEz0+JE8UURyNSgBuylM= |
||||
|
</data> |
||||
|
</dict> |
||||
|
</dict> |
||||
|
<key>rules</key> |
||||
|
<dict> |
||||
|
<key>^.*</key> |
||||
|
<true/> |
||||
|
<key>^.*\.lproj/</key> |
||||
|
<dict> |
||||
|
<key>optional</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>1000</real> |
||||
|
</dict> |
||||
|
<key>^.*\.lproj/locversion.plist$</key> |
||||
|
<dict> |
||||
|
<key>omit</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>1100</real> |
||||
|
</dict> |
||||
|
<key>^Base\.lproj/</key> |
||||
|
<dict> |
||||
|
<key>weight</key> |
||||
|
<real>1010</real> |
||||
|
</dict> |
||||
|
<key>^version.plist$</key> |
||||
|
<true/> |
||||
|
</dict> |
||||
|
<key>rules2</key> |
||||
|
<dict> |
||||
|
<key>.*\.dSYM($|/)</key> |
||||
|
<dict> |
||||
|
<key>weight</key> |
||||
|
<real>11</real> |
||||
|
</dict> |
||||
|
<key>^(.*/)?\.DS_Store$</key> |
||||
|
<dict> |
||||
|
<key>omit</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>2000</real> |
||||
|
</dict> |
||||
|
<key>^.*</key> |
||||
|
<true/> |
||||
|
<key>^.*\.lproj/</key> |
||||
|
<dict> |
||||
|
<key>optional</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>1000</real> |
||||
|
</dict> |
||||
|
<key>^.*\.lproj/locversion.plist$</key> |
||||
|
<dict> |
||||
|
<key>omit</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>1100</real> |
||||
|
</dict> |
||||
|
<key>^Base\.lproj/</key> |
||||
|
<dict> |
||||
|
<key>weight</key> |
||||
|
<real>1010</real> |
||||
|
</dict> |
||||
|
<key>^Info\.plist$</key> |
||||
|
<dict> |
||||
|
<key>omit</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>20</real> |
||||
|
</dict> |
||||
|
<key>^PkgInfo$</key> |
||||
|
<dict> |
||||
|
<key>omit</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>20</real> |
||||
|
</dict> |
||||
|
<key>^embedded\.provisionprofile$</key> |
||||
|
<dict> |
||||
|
<key>weight</key> |
||||
|
<real>20</real> |
||||
|
</dict> |
||||
|
<key>^version\.plist$</key> |
||||
|
<dict> |
||||
|
<key>weight</key> |
||||
|
<real>20</real> |
||||
|
</dict> |
||||
|
</dict> |
||||
|
</dict> |
||||
|
</plist> |
||||
@ -0,0 +1,44 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
|
<plist version="1.0"> |
||||
|
<dict> |
||||
|
<key>AvailableLibraries</key> |
||||
|
<array> |
||||
|
<dict> |
||||
|
<key>BinaryPath</key> |
||||
|
<string>JL_AdvParse.framework/JL_AdvParse</string> |
||||
|
<key>LibraryIdentifier</key> |
||||
|
<string>ios-arm64</string> |
||||
|
<key>LibraryPath</key> |
||||
|
<string>JL_AdvParse.framework</string> |
||||
|
<key>SupportedArchitectures</key> |
||||
|
<array> |
||||
|
<string>arm64</string> |
||||
|
</array> |
||||
|
<key>SupportedPlatform</key> |
||||
|
<string>ios</string> |
||||
|
</dict> |
||||
|
<dict> |
||||
|
<key>BinaryPath</key> |
||||
|
<string>JL_AdvParse.framework/JL_AdvParse</string> |
||||
|
<key>LibraryIdentifier</key> |
||||
|
<string>ios-arm64_x86_64-simulator</string> |
||||
|
<key>LibraryPath</key> |
||||
|
<string>JL_AdvParse.framework</string> |
||||
|
<key>SupportedArchitectures</key> |
||||
|
<array> |
||||
|
<string>arm64</string> |
||||
|
<string>x86_64</string> |
||||
|
</array> |
||||
|
<key>SupportedPlatform</key> |
||||
|
<string>ios</string> |
||||
|
<key>SupportedPlatformVariant</key> |
||||
|
<string>simulator</string> |
||||
|
</dict> |
||||
|
</array> |
||||
|
<key>CFBundlePackageType</key> |
||||
|
<string>XFWK</string> |
||||
|
<key>XCFrameworkFormatVersion</key> |
||||
|
<string>1.0</string> |
||||
|
</dict> |
||||
|
</plist> |
||||
@ -0,0 +1,72 @@ |
|||||
|
//
|
||||
|
// JLAdvParse.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/1/31.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <JLLogHelper/JLLogHelper.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
typedef NS_ENUM(UInt8,JL_AdvType) { |
||||
|
JL_AdvTypeSoundBox = 0, //音箱类型
|
||||
|
JL_AdvTypeChargingBin = 1, //充电仓类型
|
||||
|
JL_AdvTypeTWS = 2, //TWS耳机类型
|
||||
|
JL_AdvTypeHeadset = 3, //普通耳机类型
|
||||
|
JL_AdvTypeSoundCard = 4, //声卡类型
|
||||
|
JL_AdvTypeWatch = 5, //手表类型
|
||||
|
JL_AdvTypeTradition = 6, //传统设备类型
|
||||
|
}; |
||||
|
|
||||
|
|
||||
|
typedef NS_ENUM(NSInteger,JL_DeviceType) { |
||||
|
JL_DeviceTypeSoundBox = 0, //AI音箱类型
|
||||
|
JL_DeviceTypeChargingBin = 1, //充电仓类型
|
||||
|
JL_DeviceTypeTWS = 2, //TWS耳机类型
|
||||
|
JL_DeviceTypeHeadset = 3, //普通耳机类型
|
||||
|
JL_DeviceTypeSoundCard = 4, //声卡类型
|
||||
|
JL_DeviceTypeWatch = 5, //手表类型
|
||||
|
JL_DeviceTypeDongle = 6, //Dongle
|
||||
|
JL_DeviceTypeTradition = -1, //传统设备类型
|
||||
|
}; |
||||
|
|
||||
|
|
||||
|
/// 广播包解析器
|
||||
|
@interface JLAdvParse : NSObject |
||||
|
|
||||
|
/// 打印当前SDK的版本
|
||||
|
+(void)sdkVersion; |
||||
|
|
||||
|
/// 解析设备广播包内容
|
||||
|
/// @param key 过滤码(只针对传统设备生效,默认填空即可)
|
||||
|
/// @param advertData 蓝牙广播字典
|
||||
|
+(NSDictionary*)bluetoothAdvParse:(NSData *_Nullable)key AdvData:(NSDictionary*_Nonnull)advertData; |
||||
|
|
||||
|
/// 解析蓝牙广播包
|
||||
|
/// @param advertData 蓝牙广播报字典
|
||||
|
/// @param rssi 蓝牙信号强度
|
||||
|
+(NSDictionary *)bluetoothAdvData:(NSDictionary *)advertData RSSI:(NSNumber *)rssi; |
||||
|
|
||||
|
#pragma mark - 回连广播包信息 |
||||
|
/**
|
||||
|
* 获取广播包kCBAdvDataManufacturerData里面 'JLOTA' 标识的蓝牙地址 |
||||
|
* @param kCBAdvDataManufacturerData 广播包 |
||||
|
*/ |
||||
|
+ (NSString * _Nullable)otaBleMacAddressFromCBAdvDataManufacturerData:(NSData *)kCBAdvDataManufacturerData; |
||||
|
|
||||
|
/**
|
||||
|
* 判断当前蓝牙地址是否等于广播包kCBAdvDataManufacturerData里面的蓝牙地址 |
||||
|
* @param otaBleMacAddress ota升级中设备的蓝牙地址 |
||||
|
* @param kCBAdvDataManufacturerData 广播包 |
||||
|
*/ |
||||
|
+ (Boolean)otaBleMacAddress:(NSString *)otaBleMacAddress isEqualToCBAdvDataManufacturerData:(NSData *)kCBAdvDataManufacturerData; |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,64 @@ |
|||||
|
//
|
||||
|
// JLChargingBoxAdv.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import "JLDevicesAdv.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLChargingBoxAdv : JLDevicesAdv |
||||
|
|
||||
|
/// 经典蓝牙地址
|
||||
|
@property(nonatomic, strong) NSString *edrAddr; |
||||
|
|
||||
|
/// 是否已配对
|
||||
|
@property(nonatomic, assign) BOOL isParied; |
||||
|
|
||||
|
/// 是否已开盖
|
||||
|
@property(nonatomic, assign) BOOL isOpen; |
||||
|
|
||||
|
/// 耳机状态
|
||||
|
///0x00:不显示弹窗
|
||||
|
///0x01:经典蓝牙未连接
|
||||
|
///0x02:经典蓝牙已连接
|
||||
|
///0x03:设备正在回连
|
||||
|
///0x04:设备不可连接 (需要手动进入配对模式)
|
||||
|
@property(nonatomic, assign) uint8_t status; |
||||
|
|
||||
|
/// 左耳电量
|
||||
|
@property(nonatomic, assign) uint8_t batteryLeft; |
||||
|
|
||||
|
/// 右耳电量
|
||||
|
@property(nonatomic, assign) uint8_t batteryRight; |
||||
|
|
||||
|
/// 充电仓电量
|
||||
|
@property(nonatomic, assign) uint8_t batteryBox; |
||||
|
|
||||
|
///左耳是否在充电中
|
||||
|
@property(nonatomic, assign) BOOL isChargingLeft; |
||||
|
|
||||
|
///右耳是否在充电中
|
||||
|
@property(nonatomic, assign) BOOL isChargingRight; |
||||
|
|
||||
|
///充电仓是否在充电中
|
||||
|
@property(nonatomic, assign) BOOL isChargingBox; |
||||
|
|
||||
|
/// seq
|
||||
|
/// 用于区分是否同一次开机。每次开机或者断开连接后 增加1
|
||||
|
@property(nonatomic, assign) uint8_t seq; |
||||
|
|
||||
|
///模式
|
||||
|
/// 0x00:充电模式
|
||||
|
/// 0x01:发射模式
|
||||
|
@property(nonatomic, assign) uint8_t mode; |
||||
|
|
||||
|
/// 加密 Hash 校验值
|
||||
|
@property(nonatomic, copy) NSData *hashData; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,54 @@ |
|||||
|
//
|
||||
|
// JLDevicesAdv.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import "JLAdvParse.h" |
||||
|
|
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLDevicesAdv : NSObject |
||||
|
|
||||
|
/// 客户唯一标识
|
||||
|
@property(nonatomic,assign)uint16_t uid; |
||||
|
|
||||
|
/// 产品唯一标识
|
||||
|
@property(nonatomic,assign)uint16_t pid; |
||||
|
|
||||
|
/// 设备类型
|
||||
|
///JL_DeviceTypeSoundBox = 0, //AI音箱类型
|
||||
|
///JL_DeviceTypeChargingBin = 1, //充电仓类型
|
||||
|
///JL_DeviceTypeTWS = 2, //TWS耳机类型
|
||||
|
///JL_DeviceTypeHeadset = 3, //普通耳机类型
|
||||
|
///JL_DeviceTypeSoundCard = 4, //声卡类型
|
||||
|
///JL_DeviceTypeWatch = 5, //手表类型
|
||||
|
///JL_DeviceTypeTradition = -1, //传统设备类型
|
||||
|
@property(nonatomic,assign)JL_DeviceType type; |
||||
|
|
||||
|
/// 协议版本
|
||||
|
@property(nonatomic,assign)uint8_t version; |
||||
|
|
||||
|
/// 可变数据段
|
||||
|
@property(nonatomic,copy)NSData *variableData; |
||||
|
|
||||
|
- (instancetype)initWithData:(NSData *)data; |
||||
|
|
||||
|
|
||||
|
/// 转成model类型
|
||||
|
/// @param basicData 蓝牙广播数据
|
||||
|
+(JLDevicesAdv *__nullable)advertDataToModel:(NSData *)basicData; |
||||
|
|
||||
|
/// 转成model类型
|
||||
|
/// @param basicHexStr 蓝牙广播数据
|
||||
|
+(JLDevicesAdv *__nullable)advertDataHexStrToModel:(NSString *)basicHexStr; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
|
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,47 @@ |
|||||
|
//
|
||||
|
// JLEarphoneAdv.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import "JLDevicesAdv.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLEarphoneAdv : JLDevicesAdv |
||||
|
|
||||
|
/// 左耳电量
|
||||
|
@property(nonatomic, assign) uint8_t batteryLeft; |
||||
|
|
||||
|
/// 右耳电量
|
||||
|
@property(nonatomic, assign) uint8_t batteryRight; |
||||
|
|
||||
|
///左耳是否在充电中
|
||||
|
@property(nonatomic, assign) BOOL isChargingLeft; |
||||
|
|
||||
|
///右耳是否在充电中
|
||||
|
@property(nonatomic, assign) BOOL isChargingRight; |
||||
|
|
||||
|
/// 是否已配对
|
||||
|
@property(nonatomic, assign) BOOL isParied; |
||||
|
|
||||
|
/// 是否主机
|
||||
|
@property(nonatomic, assign) BOOL isMaster; |
||||
|
|
||||
|
/// 是否允许连接
|
||||
|
@property(nonatomic, assign) BOOL enableConnect; |
||||
|
|
||||
|
/// 耳机状态
|
||||
|
///0x00:不显示弹窗
|
||||
|
///0x01:经典蓝牙未连接
|
||||
|
///0x02:经典蓝牙已连接
|
||||
|
///0x03:设备正在回连
|
||||
|
///0x04:设备不可连接 (需要手动进入配对模式)
|
||||
|
@property(nonatomic, assign) uint8_t status; |
||||
|
|
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,25 @@ |
|||||
|
//
|
||||
|
// JLOtaAdv.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <JL_AdvParse/JL_AdvParse.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLOtaAdv : JLDevicesAdv |
||||
|
|
||||
|
/// ble address before
|
||||
|
@property(nonatomic,strong)NSString *BleAddrBefore; |
||||
|
|
||||
|
//MARK: - Version 1
|
||||
|
/// battery
|
||||
|
@property(nonatomic,assign)uint8_t battery; |
||||
|
|
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,19 @@ |
|||||
|
//
|
||||
|
// JLSoundBoxAdv.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import "JLTwsAdv.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLSoundBoxAdv : JLTwsAdv |
||||
|
|
||||
|
@property(nonatomic,assign)uint8_t battery; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,19 @@ |
|||||
|
//
|
||||
|
// JLSoundCardAdv.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import "JLTwsAdv.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLSoundCardAdv : JLTwsAdv |
||||
|
|
||||
|
@property(nonatomic,assign)uint8_t battery; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,89 @@ |
|||||
|
//
|
||||
|
// JLTwsAdv.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import "JLDevicesAdv.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLTwsAdv : JLDevicesAdv |
||||
|
|
||||
|
//MARK: - Version 0
|
||||
|
|
||||
|
/// 经典蓝牙地址
|
||||
|
@property(nonatomic, strong) NSString *edrAddr; |
||||
|
|
||||
|
/// 耳机状态
|
||||
|
///0x00:不显示弹窗
|
||||
|
///0x01:经典蓝牙未连接
|
||||
|
///0x02:经典蓝牙已连接
|
||||
|
///0x03:设备正在回连
|
||||
|
///0x04:设备不可连接 (需要手动进入配对模式)
|
||||
|
@property(nonatomic, assign) uint8_t status; |
||||
|
|
||||
|
/// 左耳电量
|
||||
|
@property(nonatomic, assign) uint8_t batteryLeft; |
||||
|
|
||||
|
/// 右耳电量
|
||||
|
@property(nonatomic, assign) uint8_t batteryRight; |
||||
|
|
||||
|
/// 充电仓电量
|
||||
|
@property(nonatomic, assign) uint8_t batteryBox; |
||||
|
|
||||
|
///左耳是否在充电中
|
||||
|
@property(nonatomic, assign) BOOL isChargingLeft; |
||||
|
|
||||
|
///右耳是否在充电中
|
||||
|
@property(nonatomic, assign) BOOL isChargingRight; |
||||
|
|
||||
|
///充电仓是否在充电中
|
||||
|
@property(nonatomic, assign) BOOL isChargingBox; |
||||
|
|
||||
|
/// seq
|
||||
|
/// 用于区分是否同一次开机。每次开机或者断开连接后 增加1
|
||||
|
@property(nonatomic, assign) uint8_t seq; |
||||
|
|
||||
|
/// 加密 Hash 校验值
|
||||
|
@property(nonatomic, copy) NSData *hashData; |
||||
|
|
||||
|
//MARK: - Version 1
|
||||
|
/// BLE连接属性(enableConnect)
|
||||
|
@property(nonatomic, assign) BOOL bleEnable; |
||||
|
|
||||
|
//MARK: - Version 2
|
||||
|
/// 连接方式
|
||||
|
/// 0x00 BLE 通迅
|
||||
|
/// 0x01 SPP 通迅
|
||||
|
/// 0x02 GATT Over BR/EDR (V5/V6)
|
||||
|
@property(nonatomic, assign) uint8_t connectWay; |
||||
|
|
||||
|
/// 是否支持智能充电仓
|
||||
|
@property(nonatomic, assign) BOOL isSupportChargBox; |
||||
|
|
||||
|
//MARK: - Version 3
|
||||
|
/// 左耳电量为挂脖耳机电量!!!,其他耳机电量使用
|
||||
|
|
||||
|
//MARK: - Version 4/5/6 扩展
|
||||
|
/// LeAudio连接状态值
|
||||
|
@property(nonatomic, assign) uint8_t leAudioStatus; |
||||
|
/// 是否支持LeAudio
|
||||
|
@property(nonatomic, assign) BOOL supportLeAudio; |
||||
|
/// LeAudio是否已连接
|
||||
|
@property(nonatomic, assign) BOOL leAudioConnectedStatus; |
||||
|
/// RCSP是否使用LeAudio地址
|
||||
|
@property(nonatomic, assign) BOOL rcspUseLeAudioAddress; |
||||
|
/// 是否需要认证
|
||||
|
@property(nonatomic, assign) BOOL needAuth; |
||||
|
/// 协议版本号
|
||||
|
@property(nonatomic, assign) uint8_t protocolVersion; |
||||
|
|
||||
|
/// 设备数量 (V6)
|
||||
|
@property(nonatomic, assign) uint8_t deviceQuantity; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,35 @@ |
|||||
|
//
|
||||
|
// JLWatchAdv.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <JL_AdvParse/JLDevicesAdv.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLWatchAdv : JLDevicesAdv |
||||
|
|
||||
|
/// 经典蓝牙地址
|
||||
|
@property(nonatomic, strong) NSString *edrAddr; |
||||
|
|
||||
|
/// 连接方式
|
||||
|
/// 0x00 ble
|
||||
|
/// 0x01 spp
|
||||
|
@property(nonatomic, assign) int8_t connectWay; |
||||
|
|
||||
|
|
||||
|
/// 手表状态
|
||||
|
/// 0x00:经典蓝牙未连接
|
||||
|
/// 0x01:经典蓝牙已连接 0x02:设备正在回连
|
||||
|
/// 0x03:设备不可连接 (需要手动进入配对模式)
|
||||
|
@property(nonatomic, assign) int8_t connectState; |
||||
|
|
||||
|
/// 是否需要先连上 ble
|
||||
|
@property(nonatomic, assign) BOOL priorityConnection; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,27 @@ |
|||||
|
//
|
||||
|
// JL_AdvParse.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/1/31.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
//! Project version number for JL_AdvParse.
|
||||
|
FOUNDATION_EXPORT double JL_AdvParseVersionNumber; |
||||
|
|
||||
|
//! Project version string for JL_AdvParse.
|
||||
|
FOUNDATION_EXPORT const unsigned char JL_AdvParseVersionString[]; |
||||
|
|
||||
|
// In this header, you should import all the public headers of your framework using statements like #import <JL_AdvParse/PublicHeader.h>
|
||||
|
#import <JL_AdvParse/JLAdvParse.h> |
||||
|
#import <JL_AdvParse/JLDevicesAdv.h> |
||||
|
#import <JL_AdvParse/JLTwsAdv.h> |
||||
|
#import <JL_AdvParse/JLSoundBoxAdv.h> |
||||
|
#import <JL_AdvParse/JLSoundCardAdv.h> |
||||
|
#import <JL_AdvParse/JLChargingBoxAdv.h> |
||||
|
#import <JL_AdvParse/JLEarphoneAdv.h> |
||||
|
#import <JL_AdvParse/JLWatchAdv.h> |
||||
|
#import <JL_AdvParse/JLOtaAdv.h> |
||||
|
|
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,6 @@ |
|||||
|
framework module JL_AdvParse { |
||||
|
umbrella header "JL_AdvParse.h" |
||||
|
export * |
||||
|
|
||||
|
module * { export * } |
||||
|
} |
||||
@ -0,0 +1,72 @@ |
|||||
|
//
|
||||
|
// JLAdvParse.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/1/31.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <JLLogHelper/JLLogHelper.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
typedef NS_ENUM(UInt8,JL_AdvType) { |
||||
|
JL_AdvTypeSoundBox = 0, //音箱类型
|
||||
|
JL_AdvTypeChargingBin = 1, //充电仓类型
|
||||
|
JL_AdvTypeTWS = 2, //TWS耳机类型
|
||||
|
JL_AdvTypeHeadset = 3, //普通耳机类型
|
||||
|
JL_AdvTypeSoundCard = 4, //声卡类型
|
||||
|
JL_AdvTypeWatch = 5, //手表类型
|
||||
|
JL_AdvTypeTradition = 6, //传统设备类型
|
||||
|
}; |
||||
|
|
||||
|
|
||||
|
typedef NS_ENUM(NSInteger,JL_DeviceType) { |
||||
|
JL_DeviceTypeSoundBox = 0, //AI音箱类型
|
||||
|
JL_DeviceTypeChargingBin = 1, //充电仓类型
|
||||
|
JL_DeviceTypeTWS = 2, //TWS耳机类型
|
||||
|
JL_DeviceTypeHeadset = 3, //普通耳机类型
|
||||
|
JL_DeviceTypeSoundCard = 4, //声卡类型
|
||||
|
JL_DeviceTypeWatch = 5, //手表类型
|
||||
|
JL_DeviceTypeDongle = 6, //Dongle
|
||||
|
JL_DeviceTypeTradition = -1, //传统设备类型
|
||||
|
}; |
||||
|
|
||||
|
|
||||
|
/// 广播包解析器
|
||||
|
@interface JLAdvParse : NSObject |
||||
|
|
||||
|
/// 打印当前SDK的版本
|
||||
|
+(void)sdkVersion; |
||||
|
|
||||
|
/// 解析设备广播包内容
|
||||
|
/// @param key 过滤码(只针对传统设备生效,默认填空即可)
|
||||
|
/// @param advertData 蓝牙广播字典
|
||||
|
+(NSDictionary*)bluetoothAdvParse:(NSData *_Nullable)key AdvData:(NSDictionary*_Nonnull)advertData; |
||||
|
|
||||
|
/// 解析蓝牙广播包
|
||||
|
/// @param advertData 蓝牙广播报字典
|
||||
|
/// @param rssi 蓝牙信号强度
|
||||
|
+(NSDictionary *)bluetoothAdvData:(NSDictionary *)advertData RSSI:(NSNumber *)rssi; |
||||
|
|
||||
|
#pragma mark - 回连广播包信息 |
||||
|
/**
|
||||
|
* 获取广播包kCBAdvDataManufacturerData里面 'JLOTA' 标识的蓝牙地址 |
||||
|
* @param kCBAdvDataManufacturerData 广播包 |
||||
|
*/ |
||||
|
+ (NSString * _Nullable)otaBleMacAddressFromCBAdvDataManufacturerData:(NSData *)kCBAdvDataManufacturerData; |
||||
|
|
||||
|
/**
|
||||
|
* 判断当前蓝牙地址是否等于广播包kCBAdvDataManufacturerData里面的蓝牙地址 |
||||
|
* @param otaBleMacAddress ota升级中设备的蓝牙地址 |
||||
|
* @param kCBAdvDataManufacturerData 广播包 |
||||
|
*/ |
||||
|
+ (Boolean)otaBleMacAddress:(NSString *)otaBleMacAddress isEqualToCBAdvDataManufacturerData:(NSData *)kCBAdvDataManufacturerData; |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,64 @@ |
|||||
|
//
|
||||
|
// JLChargingBoxAdv.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import "JLDevicesAdv.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLChargingBoxAdv : JLDevicesAdv |
||||
|
|
||||
|
/// 经典蓝牙地址
|
||||
|
@property(nonatomic, strong) NSString *edrAddr; |
||||
|
|
||||
|
/// 是否已配对
|
||||
|
@property(nonatomic, assign) BOOL isParied; |
||||
|
|
||||
|
/// 是否已开盖
|
||||
|
@property(nonatomic, assign) BOOL isOpen; |
||||
|
|
||||
|
/// 耳机状态
|
||||
|
///0x00:不显示弹窗
|
||||
|
///0x01:经典蓝牙未连接
|
||||
|
///0x02:经典蓝牙已连接
|
||||
|
///0x03:设备正在回连
|
||||
|
///0x04:设备不可连接 (需要手动进入配对模式)
|
||||
|
@property(nonatomic, assign) uint8_t status; |
||||
|
|
||||
|
/// 左耳电量
|
||||
|
@property(nonatomic, assign) uint8_t batteryLeft; |
||||
|
|
||||
|
/// 右耳电量
|
||||
|
@property(nonatomic, assign) uint8_t batteryRight; |
||||
|
|
||||
|
/// 充电仓电量
|
||||
|
@property(nonatomic, assign) uint8_t batteryBox; |
||||
|
|
||||
|
///左耳是否在充电中
|
||||
|
@property(nonatomic, assign) BOOL isChargingLeft; |
||||
|
|
||||
|
///右耳是否在充电中
|
||||
|
@property(nonatomic, assign) BOOL isChargingRight; |
||||
|
|
||||
|
///充电仓是否在充电中
|
||||
|
@property(nonatomic, assign) BOOL isChargingBox; |
||||
|
|
||||
|
/// seq
|
||||
|
/// 用于区分是否同一次开机。每次开机或者断开连接后 增加1
|
||||
|
@property(nonatomic, assign) uint8_t seq; |
||||
|
|
||||
|
///模式
|
||||
|
/// 0x00:充电模式
|
||||
|
/// 0x01:发射模式
|
||||
|
@property(nonatomic, assign) uint8_t mode; |
||||
|
|
||||
|
/// 加密 Hash 校验值
|
||||
|
@property(nonatomic, copy) NSData *hashData; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,54 @@ |
|||||
|
//
|
||||
|
// JLDevicesAdv.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import "JLAdvParse.h" |
||||
|
|
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLDevicesAdv : NSObject |
||||
|
|
||||
|
/// 客户唯一标识
|
||||
|
@property(nonatomic,assign)uint16_t uid; |
||||
|
|
||||
|
/// 产品唯一标识
|
||||
|
@property(nonatomic,assign)uint16_t pid; |
||||
|
|
||||
|
/// 设备类型
|
||||
|
///JL_DeviceTypeSoundBox = 0, //AI音箱类型
|
||||
|
///JL_DeviceTypeChargingBin = 1, //充电仓类型
|
||||
|
///JL_DeviceTypeTWS = 2, //TWS耳机类型
|
||||
|
///JL_DeviceTypeHeadset = 3, //普通耳机类型
|
||||
|
///JL_DeviceTypeSoundCard = 4, //声卡类型
|
||||
|
///JL_DeviceTypeWatch = 5, //手表类型
|
||||
|
///JL_DeviceTypeTradition = -1, //传统设备类型
|
||||
|
@property(nonatomic,assign)JL_DeviceType type; |
||||
|
|
||||
|
/// 协议版本
|
||||
|
@property(nonatomic,assign)uint8_t version; |
||||
|
|
||||
|
/// 可变数据段
|
||||
|
@property(nonatomic,copy)NSData *variableData; |
||||
|
|
||||
|
- (instancetype)initWithData:(NSData *)data; |
||||
|
|
||||
|
|
||||
|
/// 转成model类型
|
||||
|
/// @param basicData 蓝牙广播数据
|
||||
|
+(JLDevicesAdv *__nullable)advertDataToModel:(NSData *)basicData; |
||||
|
|
||||
|
/// 转成model类型
|
||||
|
/// @param basicHexStr 蓝牙广播数据
|
||||
|
+(JLDevicesAdv *__nullable)advertDataHexStrToModel:(NSString *)basicHexStr; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
|
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,47 @@ |
|||||
|
//
|
||||
|
// JLEarphoneAdv.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import "JLDevicesAdv.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLEarphoneAdv : JLDevicesAdv |
||||
|
|
||||
|
/// 左耳电量
|
||||
|
@property(nonatomic, assign) uint8_t batteryLeft; |
||||
|
|
||||
|
/// 右耳电量
|
||||
|
@property(nonatomic, assign) uint8_t batteryRight; |
||||
|
|
||||
|
///左耳是否在充电中
|
||||
|
@property(nonatomic, assign) BOOL isChargingLeft; |
||||
|
|
||||
|
///右耳是否在充电中
|
||||
|
@property(nonatomic, assign) BOOL isChargingRight; |
||||
|
|
||||
|
/// 是否已配对
|
||||
|
@property(nonatomic, assign) BOOL isParied; |
||||
|
|
||||
|
/// 是否主机
|
||||
|
@property(nonatomic, assign) BOOL isMaster; |
||||
|
|
||||
|
/// 是否允许连接
|
||||
|
@property(nonatomic, assign) BOOL enableConnect; |
||||
|
|
||||
|
/// 耳机状态
|
||||
|
///0x00:不显示弹窗
|
||||
|
///0x01:经典蓝牙未连接
|
||||
|
///0x02:经典蓝牙已连接
|
||||
|
///0x03:设备正在回连
|
||||
|
///0x04:设备不可连接 (需要手动进入配对模式)
|
||||
|
@property(nonatomic, assign) uint8_t status; |
||||
|
|
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,25 @@ |
|||||
|
//
|
||||
|
// JLOtaAdv.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <JL_AdvParse/JL_AdvParse.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLOtaAdv : JLDevicesAdv |
||||
|
|
||||
|
/// ble address before
|
||||
|
@property(nonatomic,strong)NSString *BleAddrBefore; |
||||
|
|
||||
|
//MARK: - Version 1
|
||||
|
/// battery
|
||||
|
@property(nonatomic,assign)uint8_t battery; |
||||
|
|
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,19 @@ |
|||||
|
//
|
||||
|
// JLSoundBoxAdv.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import "JLTwsAdv.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLSoundBoxAdv : JLTwsAdv |
||||
|
|
||||
|
@property(nonatomic,assign)uint8_t battery; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,19 @@ |
|||||
|
//
|
||||
|
// JLSoundCardAdv.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import "JLTwsAdv.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLSoundCardAdv : JLTwsAdv |
||||
|
|
||||
|
@property(nonatomic,assign)uint8_t battery; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,89 @@ |
|||||
|
//
|
||||
|
// JLTwsAdv.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import "JLDevicesAdv.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLTwsAdv : JLDevicesAdv |
||||
|
|
||||
|
//MARK: - Version 0
|
||||
|
|
||||
|
/// 经典蓝牙地址
|
||||
|
@property(nonatomic, strong) NSString *edrAddr; |
||||
|
|
||||
|
/// 耳机状态
|
||||
|
///0x00:不显示弹窗
|
||||
|
///0x01:经典蓝牙未连接
|
||||
|
///0x02:经典蓝牙已连接
|
||||
|
///0x03:设备正在回连
|
||||
|
///0x04:设备不可连接 (需要手动进入配对模式)
|
||||
|
@property(nonatomic, assign) uint8_t status; |
||||
|
|
||||
|
/// 左耳电量
|
||||
|
@property(nonatomic, assign) uint8_t batteryLeft; |
||||
|
|
||||
|
/// 右耳电量
|
||||
|
@property(nonatomic, assign) uint8_t batteryRight; |
||||
|
|
||||
|
/// 充电仓电量
|
||||
|
@property(nonatomic, assign) uint8_t batteryBox; |
||||
|
|
||||
|
///左耳是否在充电中
|
||||
|
@property(nonatomic, assign) BOOL isChargingLeft; |
||||
|
|
||||
|
///右耳是否在充电中
|
||||
|
@property(nonatomic, assign) BOOL isChargingRight; |
||||
|
|
||||
|
///充电仓是否在充电中
|
||||
|
@property(nonatomic, assign) BOOL isChargingBox; |
||||
|
|
||||
|
/// seq
|
||||
|
/// 用于区分是否同一次开机。每次开机或者断开连接后 增加1
|
||||
|
@property(nonatomic, assign) uint8_t seq; |
||||
|
|
||||
|
/// 加密 Hash 校验值
|
||||
|
@property(nonatomic, copy) NSData *hashData; |
||||
|
|
||||
|
//MARK: - Version 1
|
||||
|
/// BLE连接属性(enableConnect)
|
||||
|
@property(nonatomic, assign) BOOL bleEnable; |
||||
|
|
||||
|
//MARK: - Version 2
|
||||
|
/// 连接方式
|
||||
|
/// 0x00 BLE 通迅
|
||||
|
/// 0x01 SPP 通迅
|
||||
|
/// 0x02 GATT Over BR/EDR (V5/V6)
|
||||
|
@property(nonatomic, assign) uint8_t connectWay; |
||||
|
|
||||
|
/// 是否支持智能充电仓
|
||||
|
@property(nonatomic, assign) BOOL isSupportChargBox; |
||||
|
|
||||
|
//MARK: - Version 3
|
||||
|
/// 左耳电量为挂脖耳机电量!!!,其他耳机电量使用
|
||||
|
|
||||
|
//MARK: - Version 4/5/6 扩展
|
||||
|
/// LeAudio连接状态值
|
||||
|
@property(nonatomic, assign) uint8_t leAudioStatus; |
||||
|
/// 是否支持LeAudio
|
||||
|
@property(nonatomic, assign) BOOL supportLeAudio; |
||||
|
/// LeAudio是否已连接
|
||||
|
@property(nonatomic, assign) BOOL leAudioConnectedStatus; |
||||
|
/// RCSP是否使用LeAudio地址
|
||||
|
@property(nonatomic, assign) BOOL rcspUseLeAudioAddress; |
||||
|
/// 是否需要认证
|
||||
|
@property(nonatomic, assign) BOOL needAuth; |
||||
|
/// 协议版本号
|
||||
|
@property(nonatomic, assign) uint8_t protocolVersion; |
||||
|
|
||||
|
/// 设备数量 (V6)
|
||||
|
@property(nonatomic, assign) uint8_t deviceQuantity; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,35 @@ |
|||||
|
//
|
||||
|
// JLWatchAdv.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <JL_AdvParse/JLDevicesAdv.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLWatchAdv : JLDevicesAdv |
||||
|
|
||||
|
/// 经典蓝牙地址
|
||||
|
@property(nonatomic, strong) NSString *edrAddr; |
||||
|
|
||||
|
/// 连接方式
|
||||
|
/// 0x00 ble
|
||||
|
/// 0x01 spp
|
||||
|
@property(nonatomic, assign) int8_t connectWay; |
||||
|
|
||||
|
|
||||
|
/// 手表状态
|
||||
|
/// 0x00:经典蓝牙未连接
|
||||
|
/// 0x01:经典蓝牙已连接 0x02:设备正在回连
|
||||
|
/// 0x03:设备不可连接 (需要手动进入配对模式)
|
||||
|
@property(nonatomic, assign) int8_t connectState; |
||||
|
|
||||
|
/// 是否需要先连上 ble
|
||||
|
@property(nonatomic, assign) BOOL priorityConnection; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,27 @@ |
|||||
|
//
|
||||
|
// JL_AdvParse.h
|
||||
|
// JL_AdvParse
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/1/31.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
//! Project version number for JL_AdvParse.
|
||||
|
FOUNDATION_EXPORT double JL_AdvParseVersionNumber; |
||||
|
|
||||
|
//! Project version string for JL_AdvParse.
|
||||
|
FOUNDATION_EXPORT const unsigned char JL_AdvParseVersionString[]; |
||||
|
|
||||
|
// In this header, you should import all the public headers of your framework using statements like #import <JL_AdvParse/PublicHeader.h>
|
||||
|
#import <JL_AdvParse/JLAdvParse.h> |
||||
|
#import <JL_AdvParse/JLDevicesAdv.h> |
||||
|
#import <JL_AdvParse/JLTwsAdv.h> |
||||
|
#import <JL_AdvParse/JLSoundBoxAdv.h> |
||||
|
#import <JL_AdvParse/JLSoundCardAdv.h> |
||||
|
#import <JL_AdvParse/JLChargingBoxAdv.h> |
||||
|
#import <JL_AdvParse/JLEarphoneAdv.h> |
||||
|
#import <JL_AdvParse/JLWatchAdv.h> |
||||
|
#import <JL_AdvParse/JLOtaAdv.h> |
||||
|
|
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,6 @@ |
|||||
|
framework module JL_AdvParse { |
||||
|
umbrella header "JL_AdvParse.h" |
||||
|
export * |
||||
|
|
||||
|
module * { export * } |
||||
|
} |
||||
@ -0,0 +1,267 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
|
<plist version="1.0"> |
||||
|
<dict> |
||||
|
<key>files</key> |
||||
|
<dict> |
||||
|
<key>Headers/JLAdvParse.h</key> |
||||
|
<data> |
||||
|
64SI1XBWnV1VmXIYu8XpmwMpE04= |
||||
|
</data> |
||||
|
<key>Headers/JLChargingBoxAdv.h</key> |
||||
|
<data> |
||||
|
dxEumtBFtKzehtXyVAacIJk/UU4= |
||||
|
</data> |
||||
|
<key>Headers/JLDevicesAdv.h</key> |
||||
|
<data> |
||||
|
WG6Ivw9lqj20J5OXda4lXMvAsig= |
||||
|
</data> |
||||
|
<key>Headers/JLEarphoneAdv.h</key> |
||||
|
<data> |
||||
|
fJODfMyuNuG59rHtw1StpNjde1A= |
||||
|
</data> |
||||
|
<key>Headers/JLOtaAdv.h</key> |
||||
|
<data> |
||||
|
4Mj6y77mEbeHdo+4OgFL9yf+E0c= |
||||
|
</data> |
||||
|
<key>Headers/JLSoundBoxAdv.h</key> |
||||
|
<data> |
||||
|
9psoYa5IuZ6p/X9FRRnLe5THJMQ= |
||||
|
</data> |
||||
|
<key>Headers/JLSoundCardAdv.h</key> |
||||
|
<data> |
||||
|
Q5T5xqjNDkTS+Niqp/KpoD9vipY= |
||||
|
</data> |
||||
|
<key>Headers/JLTwsAdv.h</key> |
||||
|
<data> |
||||
|
whLObetTxteRXS580FiZ1/A3Yzo= |
||||
|
</data> |
||||
|
<key>Headers/JLWatchAdv.h</key> |
||||
|
<data> |
||||
|
gK+FyDcSe6OVJK11wqqm1ppRE9k= |
||||
|
</data> |
||||
|
<key>Headers/JL_AdvParse.h</key> |
||||
|
<data> |
||||
|
gtcFkie1/FuAHO4WI/GUyN9chKY= |
||||
|
</data> |
||||
|
<key>Info.plist</key> |
||||
|
<data> |
||||
|
y32GLYYZ4FDhJGOjUkYUZfxaRn8= |
||||
|
</data> |
||||
|
<key>Modules/module.modulemap</key> |
||||
|
<data> |
||||
|
hBvb1e7FRkpwYoECUsVQBBscN38= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>files2</key> |
||||
|
<dict> |
||||
|
<key>Headers/JLAdvParse.h</key> |
||||
|
<dict> |
||||
|
<key>hash</key> |
||||
|
<data> |
||||
|
64SI1XBWnV1VmXIYu8XpmwMpE04= |
||||
|
</data> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
ZG6RQ7l2Ko9IXNo517Aimfq7d03KANKIIPV09hZSFrg= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLChargingBoxAdv.h</key> |
||||
|
<dict> |
||||
|
<key>hash</key> |
||||
|
<data> |
||||
|
dxEumtBFtKzehtXyVAacIJk/UU4= |
||||
|
</data> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
Bci4NCRbpGrT/YgMlRkA2DjX/lY/o8VmxkWPNtV+DjA= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLDevicesAdv.h</key> |
||||
|
<dict> |
||||
|
<key>hash</key> |
||||
|
<data> |
||||
|
WG6Ivw9lqj20J5OXda4lXMvAsig= |
||||
|
</data> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
Mxf6qWhX6ctmSC0RVl7gdK4koCGeaUr8omEI9+9PMvc= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLEarphoneAdv.h</key> |
||||
|
<dict> |
||||
|
<key>hash</key> |
||||
|
<data> |
||||
|
fJODfMyuNuG59rHtw1StpNjde1A= |
||||
|
</data> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
WThhDcnj1tcLW3Lrp2VUET7rXC/8iv9Y1dtAdPg0yWs= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLOtaAdv.h</key> |
||||
|
<dict> |
||||
|
<key>hash</key> |
||||
|
<data> |
||||
|
4Mj6y77mEbeHdo+4OgFL9yf+E0c= |
||||
|
</data> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
HuR8+O4ONYywZcporXuxlzO1xXOtZZqm/P9+s8yj+OI= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLSoundBoxAdv.h</key> |
||||
|
<dict> |
||||
|
<key>hash</key> |
||||
|
<data> |
||||
|
9psoYa5IuZ6p/X9FRRnLe5THJMQ= |
||||
|
</data> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
Iqjsp9NyRvmdlXu0gN7zltuwg75M+Kc9qFaTSHStolA= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLSoundCardAdv.h</key> |
||||
|
<dict> |
||||
|
<key>hash</key> |
||||
|
<data> |
||||
|
Q5T5xqjNDkTS+Niqp/KpoD9vipY= |
||||
|
</data> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
WTBLq2+eyH5+TrY08Gh3/yReEWRnKg9UOCJmz56bnkE= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLTwsAdv.h</key> |
||||
|
<dict> |
||||
|
<key>hash</key> |
||||
|
<data> |
||||
|
whLObetTxteRXS580FiZ1/A3Yzo= |
||||
|
</data> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
w6Ia/stHXZvCfmmPgTEpBj7A6haG6O+E0MeXH/fNKmA= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JLWatchAdv.h</key> |
||||
|
<dict> |
||||
|
<key>hash</key> |
||||
|
<data> |
||||
|
gK+FyDcSe6OVJK11wqqm1ppRE9k= |
||||
|
</data> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
7iXBmticKJ52uKE+6RrHJt5ES0gq2Xan5WIG/w0sCyk= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Headers/JL_AdvParse.h</key> |
||||
|
<dict> |
||||
|
<key>hash</key> |
||||
|
<data> |
||||
|
gtcFkie1/FuAHO4WI/GUyN9chKY= |
||||
|
</data> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
t61emyM8slC+fTJM6XnBxjTDrpY7xvhUK5gCXfQf/3E= |
||||
|
</data> |
||||
|
</dict> |
||||
|
<key>Modules/module.modulemap</key> |
||||
|
<dict> |
||||
|
<key>hash</key> |
||||
|
<data> |
||||
|
hBvb1e7FRkpwYoECUsVQBBscN38= |
||||
|
</data> |
||||
|
<key>hash2</key> |
||||
|
<data> |
||||
|
F65y3OGliGsHZpxzdTdQxUwgmJdHiihk1gvX6sJzhxA= |
||||
|
</data> |
||||
|
</dict> |
||||
|
</dict> |
||||
|
<key>rules</key> |
||||
|
<dict> |
||||
|
<key>^.*</key> |
||||
|
<true/> |
||||
|
<key>^.*\.lproj/</key> |
||||
|
<dict> |
||||
|
<key>optional</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>1000</real> |
||||
|
</dict> |
||||
|
<key>^.*\.lproj/locversion.plist$</key> |
||||
|
<dict> |
||||
|
<key>omit</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>1100</real> |
||||
|
</dict> |
||||
|
<key>^Base\.lproj/</key> |
||||
|
<dict> |
||||
|
<key>weight</key> |
||||
|
<real>1010</real> |
||||
|
</dict> |
||||
|
<key>^version.plist$</key> |
||||
|
<true/> |
||||
|
</dict> |
||||
|
<key>rules2</key> |
||||
|
<dict> |
||||
|
<key>.*\.dSYM($|/)</key> |
||||
|
<dict> |
||||
|
<key>weight</key> |
||||
|
<real>11</real> |
||||
|
</dict> |
||||
|
<key>^(.*/)?\.DS_Store$</key> |
||||
|
<dict> |
||||
|
<key>omit</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>2000</real> |
||||
|
</dict> |
||||
|
<key>^.*</key> |
||||
|
<true/> |
||||
|
<key>^.*\.lproj/</key> |
||||
|
<dict> |
||||
|
<key>optional</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>1000</real> |
||||
|
</dict> |
||||
|
<key>^.*\.lproj/locversion.plist$</key> |
||||
|
<dict> |
||||
|
<key>omit</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>1100</real> |
||||
|
</dict> |
||||
|
<key>^Base\.lproj/</key> |
||||
|
<dict> |
||||
|
<key>weight</key> |
||||
|
<real>1010</real> |
||||
|
</dict> |
||||
|
<key>^Info\.plist$</key> |
||||
|
<dict> |
||||
|
<key>omit</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>20</real> |
||||
|
</dict> |
||||
|
<key>^PkgInfo$</key> |
||||
|
<dict> |
||||
|
<key>omit</key> |
||||
|
<true/> |
||||
|
<key>weight</key> |
||||
|
<real>20</real> |
||||
|
</dict> |
||||
|
<key>^embedded\.provisionprofile$</key> |
||||
|
<dict> |
||||
|
<key>weight</key> |
||||
|
<real>20</real> |
||||
|
</dict> |
||||
|
<key>^version\.plist$</key> |
||||
|
<dict> |
||||
|
<key>weight</key> |
||||
|
<real>20</real> |
||||
|
</dict> |
||||
|
</dict> |
||||
|
</dict> |
||||
|
</plist> |
||||
@ -0,0 +1,44 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
|
<plist version="1.0"> |
||||
|
<dict> |
||||
|
<key>AvailableLibraries</key> |
||||
|
<array> |
||||
|
<dict> |
||||
|
<key>BinaryPath</key> |
||||
|
<string>JL_BLEKit.framework/JL_BLEKit</string> |
||||
|
<key>LibraryIdentifier</key> |
||||
|
<string>ios-arm64</string> |
||||
|
<key>LibraryPath</key> |
||||
|
<string>JL_BLEKit.framework</string> |
||||
|
<key>SupportedArchitectures</key> |
||||
|
<array> |
||||
|
<string>arm64</string> |
||||
|
</array> |
||||
|
<key>SupportedPlatform</key> |
||||
|
<string>ios</string> |
||||
|
</dict> |
||||
|
<dict> |
||||
|
<key>BinaryPath</key> |
||||
|
<string>JL_BLEKit.framework/JL_BLEKit</string> |
||||
|
<key>LibraryIdentifier</key> |
||||
|
<string>ios-arm64_x86_64-simulator</string> |
||||
|
<key>LibraryPath</key> |
||||
|
<string>JL_BLEKit.framework</string> |
||||
|
<key>SupportedArchitectures</key> |
||||
|
<array> |
||||
|
<string>arm64</string> |
||||
|
<string>x86_64</string> |
||||
|
</array> |
||||
|
<key>SupportedPlatform</key> |
||||
|
<string>ios</string> |
||||
|
<key>SupportedPlatformVariant</key> |
||||
|
<string>simulator</string> |
||||
|
</dict> |
||||
|
</array> |
||||
|
<key>CFBundlePackageType</key> |
||||
|
<string>XFWK</string> |
||||
|
<key>XCFrameworkFormatVersion</key> |
||||
|
<string>1.0</string> |
||||
|
</dict> |
||||
|
</plist> |
||||
@ -0,0 +1,120 @@ |
|||||
|
//
|
||||
|
// ECBDTManager.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/11/20.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <JL_BLEKit/JL_BLEKit.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@class JL_ManagerM; |
||||
|
|
||||
|
@protocol ECBDTManagerProtocol <NSObject> |
||||
|
|
||||
|
/// 大数据传输错误
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 设备
|
||||
|
/// - type: 类型
|
||||
|
/// - error: 错误
|
||||
|
-(void)ecBDTManagerError:(JL_ManagerM *)manager Type:(uint8_t) type Error:(NSError *)error; |
||||
|
|
||||
|
/// 获取到设备端推送/ SDK 端读取的大数据内容
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 设备
|
||||
|
/// - type: 类型
|
||||
|
/// - data: 数据块
|
||||
|
/// - progress: 进度
|
||||
|
-(void)ecBDTManager:(JL_ManagerM *)manager Type:(uint8_t) type GetBigData:(NSData *)data Progress:(float) progress; |
||||
|
|
||||
|
/// 获取到设备端推送/ SDK 端读取的大数据内容 结束
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 设备
|
||||
|
/// - type: 类型
|
||||
|
/// - saveFilePath: 数据存放位置
|
||||
|
-(void)ecBDTManager:(JL_ManagerM *)manager Type:(uint8_t) type FinishBigData:(NSString *)saveFilePath; |
||||
|
|
||||
|
|
||||
|
@optional |
||||
|
|
||||
|
/// App 端主动发起的向写入数据进度
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 设备
|
||||
|
/// - progress: 数据
|
||||
|
/// - finish: 是否完成
|
||||
|
-(void)ecBDTManager:(JL_ManagerM *)manager SendBigDataPresent:(float )progress Finish:(BOOL)finish; |
||||
|
|
||||
|
/// 设备端发起大数据写操作
|
||||
|
/// 设备端主动发起的向 App 端写入数据
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 设备
|
||||
|
/// - type: 类型
|
||||
|
/// - req: 请求写入的内容
|
||||
|
-(void)ecBDTManager:(JL_ManagerM *)manager StartBigData:(ECBDTWriteReq *)req Type:(uint8_t) type; |
||||
|
|
||||
|
|
||||
|
/// 设备端发起大数据读取操作
|
||||
|
/// 开发者在这里需要对设备主动过来请求的内容进行回复
|
||||
|
/// -(void)responseDev:(JL_ManagerM *)manager resp:(ECBDTReadReq *)req Data:(NSData *)data
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 设备
|
||||
|
/// - type: 类型
|
||||
|
/// - req: 请求内容
|
||||
|
-(void)ecBDTManager:(JL_ManagerM *)manager ReadBigData:(ECBDTReadReq *)req Type:(uint8_t) type; |
||||
|
|
||||
|
/// 发送大数据完毕
|
||||
|
/// - Parameter manager: 设备
|
||||
|
/// - Parameter type: 类型
|
||||
|
-(void)ecBDTManagerSendFinish:(JL_ManagerM *)manager Type:(uint8_t) type; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
@interface ECBDTManager : ECOneToMorePtl |
||||
|
|
||||
|
+(instancetype)share; |
||||
|
|
||||
|
/// APP 读取设备数据
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 设备
|
||||
|
/// - type: 数据类型
|
||||
|
/// * 0 :原始数据
|
||||
|
/// * 1 : 阿里云数据
|
||||
|
/// * 2:RTC数据
|
||||
|
/// * 3:AI云
|
||||
|
/// * 4:TTS语音合成
|
||||
|
/// * 5:平台接口认证信息
|
||||
|
/// * 6:esim 卡信息
|
||||
|
/// * 7:4G 模块升级数据
|
||||
|
/// * 8:提示音文件数据
|
||||
|
-(void)readData:(JL_ManagerM *)manager Type:(uint8_t)type; |
||||
|
|
||||
|
/// APP 写入设备数据
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 设备
|
||||
|
/// - type: 数据类型
|
||||
|
/// * 0 :原始数据
|
||||
|
/// * 1 : 阿里云数据
|
||||
|
/// * 2:RTC数据
|
||||
|
/// * 3:AI云
|
||||
|
/// * 4:TTS语音合成
|
||||
|
/// * 5:平台接口认证信息
|
||||
|
/// * 6:esim 卡信息
|
||||
|
/// * 7:4G 模块升级数据
|
||||
|
/// * 8:提示音文件数据
|
||||
|
/// - data: 大数据内容
|
||||
|
-(void)writeData:(JL_ManagerM *)manager Type:(uint8_t) type Data:(NSData*)data; |
||||
|
|
||||
|
/// 回应设备主动读取内容
|
||||
|
/// 此方法需要配合使用
|
||||
|
/// -(void)ecBDTManager:(JL_ManagerM *)manager ReadBigData:(ECBDTReadReq *)req
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 设备
|
||||
|
/// - req: 设备端请求的对象
|
||||
|
/// - data: 需要下发的数据内容
|
||||
|
-(void)responseDev:(JL_ManagerM *)manager resp:(ECBDTReadReq *)req Data:(NSData *)data; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,166 @@ |
|||||
|
//
|
||||
|
// ECBDTObjc.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/11/21.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface ECBDTObjc : NSObject |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
/// 设备传输参数回复数据
|
||||
|
@interface ECBDTBasic : NSObject |
||||
|
/// 操作类型
|
||||
|
/// 0:设备传输参数
|
||||
|
/// 1:传输数据
|
||||
|
@property (nonatomic, assign) uint8_t op; |
||||
|
|
||||
|
/// 方式
|
||||
|
/// 0:读取数据
|
||||
|
/// 1:发送数据
|
||||
|
@property (nonatomic, assign) uint8_t way; |
||||
|
|
||||
|
/// 数据类型
|
||||
|
/// * 0 :原始数据
|
||||
|
/// * 1 : 阿里云数据
|
||||
|
/// * 2:RTC数据
|
||||
|
/// * 3:AI云
|
||||
|
/// * 4:TTS语音合成
|
||||
|
/// * 5:平台接口认证信息
|
||||
|
/// * 6:esim 卡信息
|
||||
|
/// * 7:4G 模块升级数据
|
||||
|
@property (nonatomic, assign) uint8_t type; |
||||
|
|
||||
|
/// 版本
|
||||
|
@property (nonatomic, assign) uint8_t version; |
||||
|
|
||||
|
/// 数据
|
||||
|
@property (nonatomic, copy)NSData *paramData; |
||||
|
|
||||
|
-(instancetype)initData:(NSData *)data; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
|
||||
|
//MARK: - 回复大数据数据解析(设备回复)
|
||||
|
|
||||
|
/// 设备传输参数(读取回复)
|
||||
|
@interface ECBDTReadResp : ECBDTBasic |
||||
|
/// 结果码
|
||||
|
@property (nonatomic, assign) uint8_t result; |
||||
|
|
||||
|
/// 数据长度
|
||||
|
@property (nonatomic, assign) uint32_t dtLen; |
||||
|
|
||||
|
/// 数据总 CRC
|
||||
|
@property (nonatomic, assign) uint16_t crc; |
||||
|
|
||||
|
/// 发送 MTU 协商值
|
||||
|
@property (nonatomic, assign) uint16_t sendMtu; |
||||
|
|
||||
|
/// 接收 MTU 协商值
|
||||
|
@property (nonatomic, assign) uint16_t receiveMtu; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
/// 设备传输参数(发送回复)
|
||||
|
@interface ECBDTWriteResp : ECBDTBasic |
||||
|
/// 结果码
|
||||
|
@property (nonatomic, assign) uint8_t result; |
||||
|
|
||||
|
/// 发送 MTU 协商值
|
||||
|
@property (nonatomic, assign) uint16_t sendMtu; |
||||
|
|
||||
|
/// 接收 MTU 协商值
|
||||
|
@property (nonatomic, assign) uint16_t receiveMtu; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
//MARK: - 请求大数据数据解析(设备请求)
|
||||
|
|
||||
|
/// 设备传输参数(读取请求)
|
||||
|
@interface ECBDTReadReq: ECBDTBasic |
||||
|
|
||||
|
/// 发送 MTU 协商值
|
||||
|
@property (nonatomic, assign) uint16_t sendMtu; |
||||
|
|
||||
|
/// 接收 MTU 协商值
|
||||
|
@property (nonatomic, assign) uint16_t receiveMtu; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
|
||||
|
/// 设备传输参数(发送请求)
|
||||
|
@interface ECBDTWriteReq : ECBDTBasic |
||||
|
|
||||
|
/// 数据长度
|
||||
|
@property (nonatomic, assign) uint32_t dtLen; |
||||
|
|
||||
|
/// 数据总 CRC
|
||||
|
@property (nonatomic, assign) uint16_t crc; |
||||
|
|
||||
|
/// 发送 MTU 协商值
|
||||
|
@property (nonatomic, assign) uint16_t sendMtu; |
||||
|
|
||||
|
/// 接收 MTU 协商值
|
||||
|
@property (nonatomic, assign) uint16_t receiveMtu; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
|
||||
|
//传输数据命令参数
|
||||
|
@interface ECBDTCmdData : NSObject<NSCopying> |
||||
|
/// 数据类型
|
||||
|
/// * 0 :原始数据
|
||||
|
/// * 1 : 阿里云数据
|
||||
|
/// * 2:RTC数据
|
||||
|
/// * 3:AI云
|
||||
|
/// * 4:TTS语音合成
|
||||
|
/// * 5:平台接口认证信息
|
||||
|
/// * 6:esim 卡信息
|
||||
|
/// * 7:4G 模块升级数据
|
||||
|
@property (nonatomic, assign) uint8_t type; |
||||
|
|
||||
|
|
||||
|
/// 标识位
|
||||
|
/// YES:结束
|
||||
|
/// NO:继续
|
||||
|
@property (nonatomic, assign) BOOL isEnd; |
||||
|
|
||||
|
///序号
|
||||
|
@property (nonatomic, assign) uint32_t seq; |
||||
|
|
||||
|
/// crc
|
||||
|
@property (nonatomic, assign) uint16_t crc; |
||||
|
|
||||
|
/// 数据偏移
|
||||
|
@property (nonatomic, assign) uint32_t offset; |
||||
|
|
||||
|
/// 数据长度
|
||||
|
@property (nonatomic, assign) uint16_t len; |
||||
|
|
||||
|
/// 数据
|
||||
|
@property (nonatomic, copy)NSData *data; |
||||
|
|
||||
|
|
||||
|
-(instancetype)initData:(NSData *)data; |
||||
|
|
||||
|
-(NSData *)beData; |
||||
|
|
||||
|
/// 切块分包数据
|
||||
|
/// - Parameters:
|
||||
|
/// - mtu: 发送的 mtu
|
||||
|
/// - type: 数据类型
|
||||
|
/// - dt: 文件数据
|
||||
|
+(NSArray<ECBDTCmdData *>*)makeWithMtu:(uint16_t)mtu Type:(uint8_t) type Data:(NSData *)dt; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,28 @@ |
|||||
|
//
|
||||
|
// ECOneToMorePtl.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2021/10/27.
|
||||
|
// Copyright © 2021 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import "NSData+ToUnit.h" |
||||
|
#import "JL_ManagerM.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface ECOneToMorePtl : NSObject |
||||
|
|
||||
|
@property(nonatomic,strong,readonly)NSHashTable *delegates; |
||||
|
@property(nonatomic,strong)NSLock *delegateLock; |
||||
|
|
||||
|
-(void)addDelegate:(id)delegate; |
||||
|
-(void)removeDelegate:(id)delegate; |
||||
|
-(void)removeAll; |
||||
|
-(void)inputPKG:(JL_PKG*)pkg; |
||||
|
-(void)inputPKG:(JL_PKG *)pkg Manager:(JL_ManagerM *)mgr; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,41 @@ |
|||||
|
//
|
||||
|
// ECThreadHelper.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/11/20.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@protocol ECThreadHelperPtl <NSObject> |
||||
|
|
||||
|
-(void)startAction:(id)objc; |
||||
|
-(void)finishThreadTaskAction; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
typedef void(^EcThreadAction)(id objc); |
||||
|
|
||||
|
@interface ECThreadHelper : NSObject |
||||
|
|
||||
|
|
||||
|
@property (nonatomic, weak) id<ECThreadHelperPtl> delegate; |
||||
|
|
||||
|
@property (nonatomic, copy) EcThreadAction action; |
||||
|
|
||||
|
+(instancetype)share; |
||||
|
|
||||
|
-(instancetype)init; |
||||
|
|
||||
|
-(void)addTask:(id<NSCopying>)any; |
||||
|
|
||||
|
-(void)nextTask; |
||||
|
|
||||
|
-(void)clean; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,82 @@ |
|||||
|
//
|
||||
|
// JL4GUpgradeManager.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/12/18.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import "JLPublicSettingBlocks.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
/// 4G 升级状态枚举
|
||||
|
typedef NS_ENUM(uint8_t, JL4GUpgradeStatus) { |
||||
|
/// 完成
|
||||
|
JL4GUpgradeStatusFinish = 0x00, |
||||
|
/// 开始
|
||||
|
JL4GUpgradeStatusStart = 0x01, |
||||
|
/// 传输中
|
||||
|
JL4GUpgradeStatusTransporting = 0x02, |
||||
|
/// 设备处理中
|
||||
|
JL4GUpgradeStatusDeviceProcessing = 0xff |
||||
|
}; |
||||
|
|
||||
|
@class JL4GUpgradeManager; |
||||
|
|
||||
|
/// 4G 升级代理回调
|
||||
|
@protocol JL4GUpgradeDelegate <NSObject> |
||||
|
|
||||
|
/// 升级结果
|
||||
|
/// - Parameters:
|
||||
|
/// - mgr:4G升级管理对象
|
||||
|
/// - status: 升级状态
|
||||
|
/// - progress: 升级进度
|
||||
|
/// - code: 结果码
|
||||
|
/// 0x00 升级成功
|
||||
|
/// 0x01 升级失败
|
||||
|
/// 0x02 升级超时
|
||||
|
/// - error: 错误信息
|
||||
|
-(void)jl4GUpgradeResult:(JL4GUpgradeManager *)mgr Status:(JL4GUpgradeStatus) status Progress:(float)progress Code:(uint8_t)code error:(NSError * _Nullable)error; |
||||
|
|
||||
|
/// 设备 4G 信息更新
|
||||
|
/// - Parameter g4Model: 4G信息
|
||||
|
-(void)jl4GGetDeviceInfo:(JLPublic4GModel *)g4Model; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
@class JL_ManagerM; |
||||
|
|
||||
|
/// 4G模块升级管理对象
|
||||
|
@interface JL4GUpgradeManager : NSObject |
||||
|
|
||||
|
/// 单例
|
||||
|
+(instancetype)share; |
||||
|
|
||||
|
/// 4G 升级信息
|
||||
|
/// ⚠️需要先执行获取模块信息后获得值
|
||||
|
@property(nonatomic,strong)JLPublic4GModel *g4Model; |
||||
|
|
||||
|
/// 4G升级代理回调
|
||||
|
@property(nonatomic,weak) id<JL4GUpgradeDelegate> delegate; |
||||
|
|
||||
|
/// 获取4G模块信息
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 设备
|
||||
|
/// - result: 回调结果
|
||||
|
-(void)cmdGetDevice4GInfo:(JL_ManagerM *)manager result:(JLPSSource4GCbk)result; |
||||
|
|
||||
|
|
||||
|
/// 开始4G升级
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 设备
|
||||
|
/// - data: 升级数据
|
||||
|
-(void)cmdStartUpgrade4G:(JL_ManagerM *)manager Data:(NSData *)data; |
||||
|
|
||||
|
/// 取消4G升级
|
||||
|
/// - Parameter manager: 设备
|
||||
|
-(void)cmdCancel4GUpgrade:(JL_ManagerM *)manager; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,77 @@ |
|||||
|
//
|
||||
|
// JLAIDialManager.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/10/12.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <JL_BLEKit/JL_TypeEnum.h> |
||||
|
#import <JL_BLEKit/JL_FileManager.h> |
||||
|
#import <JL_BLEKit/JLAiManager.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
@class JL_ManagerM; |
||||
|
@class JLAIDialManager; |
||||
|
|
||||
|
@protocol JLAIDialManagerDelegate <NSObject> |
||||
|
|
||||
|
/// 设备通知App AI表盘界面变化
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: ai dial manager
|
||||
|
/// - status:0x00: 退出AI表盘功能 0x01: 进入AI表盘功能
|
||||
|
-(void)aiDialManager:(JLAIDialManager *)manager didAiDialStatusChange:(uint8_t)status; |
||||
|
|
||||
|
/// 开始AI生成表盘
|
||||
|
/// - Parameter manager: ai dial manager
|
||||
|
-(void)aiDialdidStartCreateManager:(JLAIDialManager *)manager; |
||||
|
|
||||
|
/// 重新录音
|
||||
|
/// - Parameter manager: ai dial manager
|
||||
|
-(void)aiDialdidRestartRecordManager:(JLAIDialManager *)manager; |
||||
|
|
||||
|
/// AI表盘开始安装
|
||||
|
/// - Parameter manager: ai dial manager
|
||||
|
-(void)aiDialdidStartInstallManager:(JLAIDialManager *)manager; |
||||
|
|
||||
|
|
||||
|
/// 重新生成表盘
|
||||
|
/// - Parameter manager: ai dial manager
|
||||
|
-(void)aiDialdidReCreateManager:(JLAIDialManager *)manager; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// ai dial manager
|
||||
|
@interface JLAIDialManager : NSObject |
||||
|
|
||||
|
/// 进入/退出AI表盘
|
||||
|
@property (nonatomic, assign) BOOL isCreateing; |
||||
|
|
||||
|
/// 缩略图尺寸 默认 200*200
|
||||
|
/// scale zoom size default 200*200
|
||||
|
@property (nonatomic, strong) JLDialSize *scaleZoomSize; |
||||
|
|
||||
|
|
||||
|
/// 代理
|
||||
|
@property (nonatomic, weak) id<JLAIDialManagerDelegate> delegate; |
||||
|
|
||||
|
|
||||
|
/// AI 表盘风格显示设置
|
||||
|
/// - Parameter manager: 设备对象
|
||||
|
/// - Parameter style: 风格类型
|
||||
|
/// - Parameter result: 回调对象
|
||||
|
-(void)aiDialSetManager:(JL_ManagerM *)manager AiStyle:(NSString *)style Result:(JL_CMD_RESPOND)result; |
||||
|
|
||||
|
|
||||
|
/// AI表盘告诉设备缩略图发送完毕
|
||||
|
/// - Parameter manager: 设备对象
|
||||
|
/// - Parameter path: 目标缩略图路径(设备端的位置)默认 "/VIE_THUMB"
|
||||
|
/// - Parameter result: 回调对象
|
||||
|
-(void)aiDialSendThumbAiImageTo:(JL_ManagerM *)manager withPath:(NSString *)path Result:(JL_CMD_RESPOND)result; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,121 @@ |
|||||
|
//
|
||||
|
// JLAiManager.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/8/9.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <JL_BLEKit/JL_TypeEnum.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
//MARK: - JLOpenPlatformInfo
|
||||
|
/// 平台接口认证信息
|
||||
|
@interface JLOpenPlatformInfo : NSObject |
||||
|
/// 版本号
|
||||
|
@property(nonatomic,assign)uint8_t version; |
||||
|
/// 平台 ID
|
||||
|
@property(nonatomic,copy)NSString *appID; |
||||
|
/// app key
|
||||
|
@property(nonatomic,copy)NSString *appKey; |
||||
|
/// app 的密钥
|
||||
|
@property(nonatomic,copy)NSString *appSecret; |
||||
|
/// 原始数据
|
||||
|
@property(nonatomic,copy)NSData *basicData; |
||||
|
|
||||
|
-(instancetype)initData:(NSData *)data; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
/// 平台接口认证信息
|
||||
|
@interface JLOpenPlatformMessage : NSObject |
||||
|
/// 版本号
|
||||
|
@property(nonatomic,assign)uint8_t version; |
||||
|
/// 支持平台信息
|
||||
|
@property(nonatomic,copy)NSArray <JLOpenPlatformInfo *>* infoArray; |
||||
|
|
||||
|
-(instancetype)initData:(NSData *)dt; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
/// 屏幕尺寸
|
||||
|
@interface JLDialSize : NSObject |
||||
|
|
||||
|
/// width
|
||||
|
@property(nonatomic,assign) uint16_t width; |
||||
|
|
||||
|
/// height
|
||||
|
@property(nonatomic,assign) uint16_t height; |
||||
|
|
||||
|
/// 初始化
|
||||
|
/// - Parameters:
|
||||
|
/// - width: width
|
||||
|
/// - height: height
|
||||
|
+(JLDialSize *)makeSize:(uint16_t)width Height:(uint16_t)height; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
//MARK: - JLAiManager
|
||||
|
@class JL_ManagerM; |
||||
|
@class JLAiManager; |
||||
|
|
||||
|
@protocol JLAIManagerDelegate <NSObject> |
||||
|
|
||||
|
/// 设备回调/推送结果
|
||||
|
/// - Parameter mgr: JLAiManager
|
||||
|
-(void)jlaiUpdateStatus:(JLAiManager *)mgr; |
||||
|
|
||||
|
@optional |
||||
|
/// 设备主动推送JLOpenPlatformInfo信息
|
||||
|
/// - Parameters:
|
||||
|
/// - mgr: 设备
|
||||
|
/// - infoArray: [JLOpenPlatformInfo]
|
||||
|
-(void)jlaiUpdateDevAiOpenPlatforms:(JLAiManager *)mgr Info:(JLOpenPlatformMessage *)info; |
||||
|
|
||||
|
|
||||
|
@end |
||||
|
|
||||
|
typedef void(^JLOpenPFBlock)(JLOpenPlatformMessage *message,JL_CMDStatus result); |
||||
|
|
||||
|
/// AI状态 管理类
|
||||
|
/// 当前接口适用于一些支持设备对讲的设备,在使用时需要先初始化当前类并接受代理:JLAIManagerDelegate
|
||||
|
/// 在初始化后需要主动获取状态才可以获得首次的状态内容
|
||||
|
///
|
||||
|
@interface JLAiManager : NSObject |
||||
|
|
||||
|
/// 版本号
|
||||
|
@property(assign,nonatomic)uint8_t version; |
||||
|
|
||||
|
/// 0x00:默认状态
|
||||
|
/// 0x01:进入AI界面
|
||||
|
/// 0x02:退出AI界面
|
||||
|
@property(assign,nonatomic)uint8_t status; |
||||
|
|
||||
|
/// 回调代理
|
||||
|
@property(weak,nonatomic)id<JLAIManagerDelegate> delegate; |
||||
|
|
||||
|
/// 获取AI 的状态
|
||||
|
///- Parameters:
|
||||
|
/// - manager: 设备对象
|
||||
|
-(void)getStatus:(JL_ManagerM *)manager; |
||||
|
|
||||
|
/// 设置设备的状态
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 设备对象
|
||||
|
/// - result: 回调结果
|
||||
|
-(void)setToDevice:(JL_ManagerM *)manager result:(JL_CMD_RESPOND _Nullable)result; |
||||
|
|
||||
|
|
||||
|
/// 获取平台接口认证信息,此信息需要先获取 JLDeviceConfig
|
||||
|
/// 根据JLDeviceConfigModel 的 exportFunc 属性的
|
||||
|
/// spOpenInfo 判断是否支持平台开放接口信息获得
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 设备对象
|
||||
|
/// - result: 回调结果
|
||||
|
-(void)getOpenPlatformInfo:(JL_ManagerM *)manager result:(JLOpenPFBlock _Nullable)result; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,35 @@ |
|||||
|
//
|
||||
|
// JLAuracastDevStateModel.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/11/17.
|
||||
|
// Copyright © 2025 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
/**
|
||||
|
Auracast 设备状态数据模型 |
||||
|
|
||||
|
*/ |
||||
|
@interface JLAuracastDevStateModel : NSObject |
||||
|
|
||||
|
typedef NS_ENUM(uint8_t, JLAuracastDevStateType) { |
||||
|
JLAuracastDevStateTypeLogin = 0x01, |
||||
|
}; |
||||
|
typedef NS_ENUM(uint8_t, JLAuracastLoginState) { |
||||
|
JLAuracastLoginStateLogout = 0, |
||||
|
JLAuracastLoginStateLogin = 1, |
||||
|
}; |
||||
|
/// 登录状态
|
||||
|
@property(nonatomic, assign) JLAuracastLoginState loginState; |
||||
|
|
||||
|
- (instancetype)initParseData:(NSData *)data; |
||||
|
|
||||
|
- (void)updateParseData:(NSData *)data; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,121 @@ |
|||||
|
//
|
||||
|
// JLAuracastLancerManager.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/11/17.
|
||||
|
// Copyright © 2025 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <JL_BLEKit/JL_BLEKit.h> |
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
@class JLAuracastLancerSettingMode; |
||||
|
@class JLAuracastLancerManager; |
||||
|
|
||||
|
@protocol JLAuracastLancerManagerDelegate <NSObject> |
||||
|
@optional |
||||
|
-(void)lancerManager:(JLAuracastLancerManager *)mgr didUpdateSetting:(JLAuracastLancerSettingMode *)mode; |
||||
|
/// 设备状态更新
|
||||
|
/// - Parameters:
|
||||
|
/// - mgr: 管理器
|
||||
|
/// - state: 最新设备状态
|
||||
|
-(void)lancerManager:(JLAuracastLancerManager *)mgr didUpdateDeviceState:(JLAuracastDevStateModel *)state; |
||||
|
@end |
||||
|
|
||||
|
/// Lancer 验证
|
||||
|
typedef NS_ENUM(NSUInteger, JLAuracastLancerLoginVerifyType) { |
||||
|
/// 验证成功
|
||||
|
JLLancerLoginVerifyTypeSuccess = 0x00, |
||||
|
/// 验证失败
|
||||
|
JLLancerLoginVerifyTypeFail = 0x01, |
||||
|
/// 已登录
|
||||
|
JLLancerLoginVerifyTypeLogined = 0x02 |
||||
|
}; |
||||
|
|
||||
|
/// 修改密码结果
|
||||
|
typedef NS_ENUM(NSUInteger, JLAuracastLancerChangePwdResult) { |
||||
|
/// 修改成功
|
||||
|
JLAuracastLancerChangePwdSuccess = 0x00, |
||||
|
/// 旧密码错误
|
||||
|
JLAuracastLancerChangePwdOldError = 0x01, |
||||
|
/// 密码没有变化
|
||||
|
JLAuracastLancerChangePwdNoChange = 0x02, |
||||
|
/// 新密码长度不对
|
||||
|
JLAuracastLancerChangePwdLengthError = 0x03 |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
|
||||
|
typedef void(^JLLancerLoginVerifyBlock)(JLAuracastLancerLoginVerifyType status); |
||||
|
|
||||
|
typedef void(^JLLancerChangePwdBlock)(JLAuracastLancerChangePwdResult status); |
||||
|
|
||||
|
@interface JLAuracastLancerManager : NSObject |
||||
|
|
||||
|
@property(nonatomic, strong) JLAuracastLancerSettingMode *__nullable settingMode; |
||||
|
|
||||
|
@property(nonatomic, weak) id<JLAuracastLancerManagerDelegate> delegate; |
||||
|
|
||||
|
|
||||
|
-(instancetype)initWithManager:(JL_ManagerM *)manager; |
||||
|
|
||||
|
/// 设备状态
|
||||
|
@property(nonatomic,strong)JLAuracastDevStateModel *devState; |
||||
|
|
||||
|
/// 登录
|
||||
|
/// - Parameters:
|
||||
|
/// - password: 登录密码
|
||||
|
/// - result: 结果
|
||||
|
-(void)loginVerify:(NSString *)password Result:(JLLancerLoginVerifyBlock)result; |
||||
|
|
||||
|
/// 修改密码
|
||||
|
/// - Parameters:
|
||||
|
/// - oldPwd: 旧密码
|
||||
|
/// - newPwd: 新密码
|
||||
|
/// - result: 结果
|
||||
|
-(void)changePassword:(NSString *)oldPwd newPassword:(NSString *)newPwd Result:(JLLancerChangePwdBlock)result; |
||||
|
|
||||
|
/// 获取Auracast设备状态
|
||||
|
-(void)auracastGetDevState; |
||||
|
|
||||
|
/// 获取广播音频发射设置
|
||||
|
/// - Parameter type: 类型
|
||||
|
/// 0x01 == 广播名称
|
||||
|
/// 0x02 == 音频格式序号
|
||||
|
/// 0x03 == 加密信息
|
||||
|
/// 0x04 == 发射功率
|
||||
|
-(void)getBroadcastLancerSetting:(UInt8)type; |
||||
|
|
||||
|
/// 获取广播音频发射设置
|
||||
|
-(void)getBroadcastLancerSetting; |
||||
|
|
||||
|
/// 单独设置广播名称
|
||||
|
-(void)setBroadcastName:(NSString *)name; |
||||
|
|
||||
|
/// 单独设置音频格式序号
|
||||
|
-(void)setAudioFormatIndex:(JLBroadcastSetAudioFormat)index; |
||||
|
|
||||
|
/// 单独设置加密与 Broadcast Code(长度16)
|
||||
|
-(void)setEncryptEnabled:(BOOL)enabled code:(NSData *)code; |
||||
|
|
||||
|
/// 单独设置发射功率(1~10)
|
||||
|
-(void)setPowerLevel:(uint8_t)level; |
||||
|
|
||||
|
/// 一次性下发全部设置(来自 settingMode 或参数)
|
||||
|
-(void)setBroadcastLancerSetting:(JLAuracastLancerSettingMode *)mode; |
||||
|
|
||||
|
///关机
|
||||
|
-(void)shoudown; |
||||
|
|
||||
|
///重启
|
||||
|
-(void)restart; |
||||
|
|
||||
|
///恢复出厂设置
|
||||
|
-(void)reset; |
||||
|
|
||||
|
/// 销毁
|
||||
|
-(void)onDestory; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,148 @@ |
|||||
|
//
|
||||
|
// JLAuracastLancerSettingMode.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/11/17.
|
||||
|
// Copyright © 2025 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
/// 音频格式
|
||||
|
typedef NS_ENUM(UInt8, JLBroadcastSetAudioFormat) { |
||||
|
/// 名称: 8_1
|
||||
|
/// 采样率(Hz): 8000
|
||||
|
/// 帧间隔(us):7500
|
||||
|
/// 包长(Byte):26
|
||||
|
/// 码率(kbps):27.732
|
||||
|
/// 重发次数 :2
|
||||
|
/// 最大传输延时(ms) :8
|
||||
|
/// 演示延时(ms) :40
|
||||
|
JLBroadcastSetAudioFormat8_1 = 0x01, |
||||
|
/// 名称: 8_2
|
||||
|
/// 采样率(Hz): 8000
|
||||
|
/// 帧间隔(us):10000
|
||||
|
/// 包长(Byte):30
|
||||
|
/// 码率(kbps):24
|
||||
|
/// 重发次数:2
|
||||
|
/// 最大传输延时(ms):10
|
||||
|
/// 演示延时(ms):40
|
||||
|
JLBroadcastSetAudioFormat8_2 = 0x02, |
||||
|
/// 名称: 16_1_1
|
||||
|
/// 采样率(Hz): 16000
|
||||
|
/// 帧间隔(us):7500
|
||||
|
/// 包长(Byte):30
|
||||
|
/// 码率(kbps):32
|
||||
|
/// 重发次数:2
|
||||
|
/// 最大传输延时(ms):8
|
||||
|
/// 演示延时(ms):40
|
||||
|
JLBroadcastSetAudioFormat16_1_1 = 0x03, |
||||
|
/// 名称: 16_2_1
|
||||
|
/// 采样率(Hz): 16000
|
||||
|
/// 帧间隔(us):10000
|
||||
|
/// 包长(Byte):40
|
||||
|
/// 码率(kbps):48
|
||||
|
/// 重发次数:2
|
||||
|
/// 最大传输延时(ms):10
|
||||
|
/// 演示延时(ms):40
|
||||
|
JLBroadcastSetAudioFormat16_2_1 = 0x04, |
||||
|
/// 名称: 24_1_1
|
||||
|
/// 采样率(Hz): 24000
|
||||
|
/// 帧间隔(us):7500
|
||||
|
/// 包长(Byte):45
|
||||
|
/// 码率(kbps):48
|
||||
|
/// 重发次数:2
|
||||
|
/// 最大传输延时(ms):8
|
||||
|
/// 演示延时(ms):40
|
||||
|
JLBroadcastSetAudioFormat24_1_1 = 0x05, |
||||
|
/// 名称: 24_2_1
|
||||
|
/// 采样率(Hz): 24000
|
||||
|
/// 帧间隔(us):10000
|
||||
|
/// 包长(Byte):60
|
||||
|
/// 码率(kbps):48
|
||||
|
/// 重发次数:2
|
||||
|
/// 最大传输延时(ms):10
|
||||
|
/// 演示延时(ms):40
|
||||
|
JLBroadcastSetAudioFormat24_2_1 = 0x06, |
||||
|
/// 名称: 32_1_1
|
||||
|
/// 采样率(Hz): 32000
|
||||
|
/// 帧间隔(us):7500
|
||||
|
/// 包长(Byte):60
|
||||
|
/// 码率(kbps):64
|
||||
|
/// 重发次数:2
|
||||
|
/// 最大传输延时(ms):8
|
||||
|
/// 演示延时(ms):40
|
||||
|
JLBroadcastSetAudioFormat32_1_1 = 0x07, |
||||
|
/// 名称: 32_2_1
|
||||
|
/// 采样率(Hz): 32000
|
||||
|
/// 帧间隔(us):10000
|
||||
|
/// 包长(Byte):80
|
||||
|
/// 码率(kbps):64
|
||||
|
/// 重发次数:2
|
||||
|
/// 最大传输延时(ms):10
|
||||
|
/// 演示延时(ms):40
|
||||
|
JLBroadcastSetAudioFormat32_2_1 = 0x08, |
||||
|
/// 名称: 441_1_1
|
||||
|
/// 采样率(Hz): 44100
|
||||
|
/// 帧间隔(us):8163
|
||||
|
/// 包长(Byte):97
|
||||
|
/// 码率(kbps):95.06
|
||||
|
/// 重发次数:4
|
||||
|
/// 最大传输延时(ms):24
|
||||
|
/// 演示延时(ms):40
|
||||
|
JLBroadcastSetAudioFormat441_1_1 = 0x09, |
||||
|
/// 名称: 441_2_1
|
||||
|
/// 采样率(Hz): 44100
|
||||
|
/// 帧间隔(us):10884
|
||||
|
/// 包长(Byte):130
|
||||
|
/// 码率(kbps):95.55
|
||||
|
/// 重发次数:4
|
||||
|
/// 最大传输延时(ms):31
|
||||
|
/// 演示延时(ms):40
|
||||
|
JLBroadcastSetAudioFormat441_2_1 = 0x0A, |
||||
|
/// 名称: 48_1
|
||||
|
/// 采样率(Hz): 48000
|
||||
|
/// 帧间隔(us):7500
|
||||
|
/// 包长(Byte):75
|
||||
|
/// 码率(kbps):80
|
||||
|
/// 重发次数:4
|
||||
|
/// 最大传输延时(ms):15
|
||||
|
/// 演示延时(ms):40
|
||||
|
JLBroadcastSetAudioFormat48_1 = 0x0B, |
||||
|
/// 名称: 48_2
|
||||
|
/// 采样率(Hz): 48000
|
||||
|
/// 帧间隔(us):10000
|
||||
|
/// 包长(Byte):100
|
||||
|
/// 码率(kbps):80
|
||||
|
/// 重发次数:4
|
||||
|
/// 最大传输延时(ms):20
|
||||
|
/// 演示延时(ms):40
|
||||
|
JLBroadcastSetAudioFormat48_2 = 0x0C |
||||
|
|
||||
|
}; |
||||
|
/**
|
||||
|
Auracast 发射端设置数据模型 |
||||
|
*/ |
||||
|
@interface JLAuracastLancerSettingMode : NSObject |
||||
|
|
||||
|
/// 广播名称
|
||||
|
@property(nonatomic, copy) NSString *broadcastName; |
||||
|
/// 音频格式
|
||||
|
@property(nonatomic, assign) JLBroadcastSetAudioFormat audioFormatIndex; |
||||
|
/// 是否加密
|
||||
|
@property(nonatomic, assign) BOOL encryptEnabled; |
||||
|
/// 广播加密密码
|
||||
|
@property(nonatomic, copy) NSData * _Nullable broadcastCode; |
||||
|
/// 发射功率设置
|
||||
|
@property(nonatomic, assign) uint8_t powerLevel; |
||||
|
|
||||
|
-(instancetype)initParseData:(NSData *)data; |
||||
|
|
||||
|
-(void)updateParseData:(NSData *)data; |
||||
|
|
||||
|
-(NSData *)toLTVData; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,123 @@ |
|||||
|
//
|
||||
|
// JLAuracastManager.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/11/17.
|
||||
|
// Copyright © 2025 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <JL_BLEKit/JL_BLEKit.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
@class JLBroadcastDataModel; |
||||
|
@class JLAuracastDevStateModel; |
||||
|
@class JLAuracastManager; |
||||
|
|
||||
|
/// 搜索状态
|
||||
|
typedef NS_ENUM(NSUInteger, JLAuracastScanState) { |
||||
|
///操作成功/不在搜索状态
|
||||
|
JLAuracastScanStateSuccess = 0, |
||||
|
///正在搜索,请勿重复操作
|
||||
|
JLAuracastScanStateScanning = 1, |
||||
|
///收听广播过程不允许扫描
|
||||
|
JLAuracastScanStateForbidden = 2, |
||||
|
///设备繁忙
|
||||
|
JLAuracastScanStateBusy = 3, |
||||
|
}; |
||||
|
|
||||
|
/// 扫描类型
|
||||
|
typedef NS_ENUM(NSUInteger, JLAuracastScanType) { |
||||
|
/// 停止
|
||||
|
JLAuracastScanTypeStop = 0, |
||||
|
/// 开始
|
||||
|
JLAuracastScanTypeStart = 1, |
||||
|
/// 查询
|
||||
|
JLAuracastScanTypeQuery = 2, |
||||
|
}; |
||||
|
|
||||
|
@protocol JLAuracastManagerDelegate <NSObject> |
||||
|
@optional |
||||
|
|
||||
|
/// 搜索状态
|
||||
|
/// - Parameters:
|
||||
|
/// - mgr: 管理器
|
||||
|
/// - state: 搜索状态
|
||||
|
/// - error: 错误
|
||||
|
-(void)auracastManager:(JLAuracastManager *)mgr didUpdateSearchState:(BOOL)state Error:(NSError * _Nullable)error; |
||||
|
|
||||
|
|
||||
|
/// 广播列表更新
|
||||
|
/// - Parameters:
|
||||
|
/// - mgr: 管理器
|
||||
|
/// - list: 最新的广播数据列表
|
||||
|
-(void)auracastManager:(JLAuracastManager *)mgr didUpdateBroadcastList:(NSArray<JLBroadcastDataModel *> *)list; |
||||
|
|
||||
|
/// 设备状态更新
|
||||
|
/// - Parameters:
|
||||
|
/// - mgr: 管理器
|
||||
|
/// - state: 最新设备状态
|
||||
|
-(void)auracastManager:(JLAuracastManager *)mgr didUpdateDeviceState:(JLAuracastDevStateModel *)state; |
||||
|
|
||||
|
/// 当前播放源更新
|
||||
|
/// - Parameters:
|
||||
|
/// - mgr: 管理器
|
||||
|
/// - source: 当前播放源(可空)
|
||||
|
-(void)auracastManager:(JLAuracastManager *)mgr didUpdateCurrentSource:(JLBroadcastDataModel * _Nullable)source; |
||||
|
@end |
||||
|
|
||||
|
typedef void(^JLAuracastManagerResultBlock)(JL_CMDStatus status, NSError * _Nullable error); |
||||
|
|
||||
|
@interface JLAuracastManager : NSObject |
||||
|
|
||||
|
/// 扫描状态
|
||||
|
@property(nonatomic, assign)BOOL isScanning; |
||||
|
|
||||
|
/// 若干个搜索到的对象
|
||||
|
@property(nonatomic,strong)NSMutableArray <JLBroadcastDataModel *>* broadcastDataModels; |
||||
|
|
||||
|
/// 设备状态
|
||||
|
@property(nonatomic,strong)JLAuracastDevStateModel *devState; |
||||
|
|
||||
|
/// 当前播放源
|
||||
|
@property(nonatomic,strong)JLBroadcastDataModel *__nullable currentSource; |
||||
|
|
||||
|
/// 回调代理
|
||||
|
@property(nonatomic,weak)id<JLAuracastManagerDelegate> delegate; |
||||
|
|
||||
|
/// 初始化
|
||||
|
-(instancetype)initWithManager:(JL_ManagerM *)manager; |
||||
|
|
||||
|
|
||||
|
/// 扫描Auracast广播
|
||||
|
/// - Parameter type: 扫描类型
|
||||
|
-(void)auracastScanBroadcast:(JLAuracastScanType)type; |
||||
|
|
||||
|
/// 获取Auracast设备状态
|
||||
|
-(void)auracastGetDevState; |
||||
|
|
||||
|
|
||||
|
/// 设置Auracast当前播放源
|
||||
|
/// - Parameter model: 播放源
|
||||
|
/// - Parameter block: 回调
|
||||
|
/// 这里的回调仅仅是命令收发的一个回复,设备回复成功不代表添加成功
|
||||
|
/// 只说明了此命令交互成功,开发者仍需监听
|
||||
|
/// -(void)auracastManager:(JLAuracastManager *)mgr didUpdateCurrentSource:(JLBroadcastDataModel * _Nullable)source 作为判断是否成功收听的重要指标
|
||||
|
-(void)addSourceToDev:(JLBroadcastDataModel *)model result:(JLAuracastManagerResultBlock _Nullable)block; |
||||
|
|
||||
|
/// 移除Auracast当前播放源
|
||||
|
/// - Parameter block: 回调
|
||||
|
-(void)removeDevCurrentSource:(JLAuracastManagerResultBlock _Nullable)block; |
||||
|
|
||||
|
/// 获取Auracast当前播放源
|
||||
|
/// - Parameter block: 回调
|
||||
|
-(void)getCurrentOperationSource:(void(^)(JLBroadcastDataModel *model))block; |
||||
|
|
||||
|
/// 销毁
|
||||
|
-(void)onDestory; |
||||
|
|
||||
|
|
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,87 @@ |
|||||
|
//
|
||||
|
// JLAutoConfigAnc.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2022/10/28.
|
||||
|
// Copyright © 2022 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
|
||||
|
#import "ECOneToMorePtl.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@class JL_ManagerM; |
||||
|
|
||||
|
typedef void(^AutoConfigResult)(BOOL status); |
||||
|
|
||||
|
@protocol JLAutoConfigAncPtl <NSObject> |
||||
|
|
||||
|
|
||||
|
/// 设备正在重新检测自适应降噪
|
||||
|
-(void)autoConfigDidConfiging; |
||||
|
///设置自适应降噪失败了
|
||||
|
-(void)autoConfigDidFailed; |
||||
|
///设置自适应降噪成功了
|
||||
|
-(void)autoConfigDidSucceed; |
||||
|
///关闭自适应降噪
|
||||
|
-(void)autoConfigDidClose; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
|
||||
|
/// 自适应降噪处理类
|
||||
|
@interface JLAutoConfigAnc : ECOneToMorePtl |
||||
|
|
||||
|
/// 设备开启/关闭自适应降噪的状态
|
||||
|
@property (assign,nonatomic)BOOL status; |
||||
|
|
||||
|
/// 开启设备自适应降噪
|
||||
|
/// 这里只是进入了设备开始适配降噪的命令过程
|
||||
|
/// 适配成功与否需要添加协议JLAutoConfigAncPtl进行监听
|
||||
|
/**
|
||||
|
interface testView : UIView<JLAutoConfigAncPtl> |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
-(void)initData{ |
||||
|
JLAutoConfigAnc *anc = [[JLAutoConfigAnc alloc] init]; |
||||
|
[anc addDelegate:self]; |
||||
|
} |
||||
|
|
||||
|
-(void)autoConfigDidFailed{ |
||||
|
//设置自适应降噪失败了
|
||||
|
} |
||||
|
-(void)autoConfigDidSucceed{ |
||||
|
//设置自适应降噪成功了
|
||||
|
} |
||||
|
-(void)autoConfigDidClose{ |
||||
|
//关闭自适应降噪
|
||||
|
} |
||||
|
*/ |
||||
|
/// - Parameter manager: manager
|
||||
|
-(void)atAncStartAutoConfigWithManager:(JL_ManagerM*)manager; |
||||
|
|
||||
|
|
||||
|
/// 打开设备自适应降噪
|
||||
|
/// 设备默认有一套已在运行的降噪算法
|
||||
|
/// 打开后设备会进入降噪模式,不会经历检测启动自适应的时间,相当于是即时生效
|
||||
|
/// - Parameter result: 这里回调的是一个设备命令处理的结果
|
||||
|
/// - Parameter manager: manager
|
||||
|
-(void)atAncOpenAutoConfigResult:(JL_CMD_RESPOND)result Manager:(JL_ManagerM*)manager; |
||||
|
|
||||
|
/// 用户关闭设备的自适应降噪模式算法
|
||||
|
/// - Parameter result: 命令处理结果,不代表命令处理成功
|
||||
|
/// - Parameter manager: manager
|
||||
|
-(void)atAncCloseAutoConfigResult:(JL_CMD_RESPOND)result Manager:(JL_ManagerM*)manager; |
||||
|
|
||||
|
/// 获取设备是否开启了自适应降噪
|
||||
|
/// - Parameter result: 这里处理的结果是,设备实际是否开启了的结果,无需从代理中获得结果
|
||||
|
/// - Parameter manager: manager
|
||||
|
-(void)atAncGetAutoConfigResult:(AutoConfigResult)result Manager:(JL_ManagerM*)manager; |
||||
|
|
||||
|
|
||||
|
@end |
||||
|
|
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,38 @@ |
|||||
|
//
|
||||
|
// JLAutoPressureModel.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2021/10/12.
|
||||
|
// Copyright © 2021 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import "JLwSettingModel.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
///压力自动检测模式
|
||||
|
typedef NS_ENUM(UInt8, WatchAPLeveType) { |
||||
|
///放松
|
||||
|
WatchAPLeve_Relex = 0x00, |
||||
|
/// 正常
|
||||
|
WatchAPLeve_Normal = 0x01, |
||||
|
/// 中等
|
||||
|
WatchAPLeve_Middle = 0x02, |
||||
|
/// 偏高
|
||||
|
WatchAPLeve_Hight = 0x03 |
||||
|
}; |
||||
|
|
||||
|
@interface JLAutoPressureModel : JLwSettingModel |
||||
|
|
||||
|
///开关
|
||||
|
@property(nonatomic,assign)BOOL status; |
||||
|
/// 模式
|
||||
|
@property(nonatomic,assign)WatchAPLeveType model; |
||||
|
|
||||
|
-(instancetype)initWithData:(NSData *)data; |
||||
|
|
||||
|
-(instancetype)initWithModel:(WatchAPLeveType)model switchStatus:(BOOL)status; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,65 @@ |
|||||
|
//
|
||||
|
// JLBroadcastDataModel.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/11/17.
|
||||
|
// Copyright © 2025 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
/// Auracast 广播数据模型
|
||||
|
@interface JLBroadcastDataModel : NSObject |
||||
|
|
||||
|
/// 广播名称
|
||||
|
@property(nonatomic, copy) NSString *broadcastName; |
||||
|
/// 广播ID
|
||||
|
@property(nonatomic, copy) NSData *broadcastID; |
||||
|
/// 广播特性
|
||||
|
@property(nonatomic, assign) uint8_t features; |
||||
|
/// 是否加密
|
||||
|
@property(nonatomic, assign) BOOL encrypted; |
||||
|
/// 广播地址
|
||||
|
@property(nonatomic, copy) NSData *advertiserAddress; |
||||
|
/// 广播地址
|
||||
|
@property(nonatomic, copy) NSString *advertiserAddressString; |
||||
|
|
||||
|
/// 广播密钥
|
||||
|
@property(nonatomic, copy) NSData *broadcastKey; |
||||
|
|
||||
|
typedef NS_ENUM(uint8_t, JLBroadcastSyncState) { |
||||
|
JLBroadcastSyncStateIdle = 0, |
||||
|
JLBroadcastSyncStateSyncing = 1, |
||||
|
JLBroadcastSyncStateSuccess = 2, |
||||
|
}; |
||||
|
/// 同步状态
|
||||
|
/// Broadcast sync state
|
||||
|
/// 当此状态为空闲时,需要查看错误码检查是否存在错误
|
||||
|
@property(nonatomic, assign) JLBroadcastSyncState syncState; |
||||
|
|
||||
|
typedef NS_ENUM(uint8_t, JLBroadcastErrorCode) { |
||||
|
JLBroadcastErrorCodeNone = 0x00, |
||||
|
JLBroadcastErrorCodeName = 0x01, |
||||
|
JLBroadcastErrorCodeAddress = 0x02, |
||||
|
JLBroadcastErrorCodeID = 0x03, |
||||
|
JLBroadcastErrorCodeKey = 0x04, |
||||
|
JLBroadcastErrorCodeSyncFailed = 0x05, |
||||
|
JLBroadcastErrorCodeSyncTimeout = 0x06, |
||||
|
JLBroadcastErrorCodeSyncLost = 0x07, |
||||
|
}; |
||||
|
/// 错误码
|
||||
|
@property(nonatomic, assign) JLBroadcastErrorCode errorCode; |
||||
|
|
||||
|
@property(nonatomic, copy) NSData *ltvData; |
||||
|
|
||||
|
- (instancetype)initParseData:(NSData *)data; |
||||
|
|
||||
|
|
||||
|
/// 将当前模型内容按 LTV 规则编码为数据
|
||||
|
- (NSData *)toLTVData; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,23 @@ |
|||||
|
//
|
||||
|
// JLCmdBasic.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/9/13.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <JL_BLEKit/JL_TypeEnum.h> |
||||
|
#import <JL_BLEKit/JL_ManagerM.h> |
||||
|
#import <JL_BLEKit/NSData+ToUnit.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLCmdBasic : NSObject |
||||
|
|
||||
|
-(void)inputPKG:(JL_PKG *)pkg; |
||||
|
|
||||
|
-(void)makeCommandAction:(NSData *)targetData withManager:(JL_ManagerM *)manager Result:(JL_CMD_RESPOND _Nullable)result; |
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,45 @@ |
|||||
|
//
|
||||
|
// JLConsequentHeartRateModel.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2021/10/12.
|
||||
|
// Copyright © 2021 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import "JLwSettingModel.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
/// 测量心率传感器设置
|
||||
|
@interface JLConsequentHeartRateModel : JLwSettingModel |
||||
|
///开关
|
||||
|
@property(nonatomic,assign)BOOL status; |
||||
|
/// 测量模式
|
||||
|
@property(nonatomic,assign)WatchConsequentType rType; |
||||
|
|
||||
|
/// 上限心率
|
||||
|
@property(nonatomic,assign)UInt8 maxHeartRate; |
||||
|
|
||||
|
/// 下限心率
|
||||
|
@property(nonatomic,assign)UInt8 minHeartRate; |
||||
|
|
||||
|
/// 是否包含上下心率区间
|
||||
|
@property(nonatomic,assign)BOOL hasRange; |
||||
|
|
||||
|
-(instancetype)initWithData:(NSData *)data; |
||||
|
|
||||
|
/// 创建一个新的传感器设置对象
|
||||
|
/// @param type 测量类型
|
||||
|
/// @param status 开团状态
|
||||
|
- (instancetype)initWithModel:(WatchConsequentType)type Status:(BOOL)status; |
||||
|
|
||||
|
/// 创建一个新的传感器设置对象
|
||||
|
/// 携带心率上下限的
|
||||
|
/// @param type 测量类型
|
||||
|
/// @param status 开关状态
|
||||
|
/// @param min 心率下限
|
||||
|
/// @param max 心率上限
|
||||
|
- (instancetype)initWithModel:(WatchConsequentType)type Status:(BOOL)status Min:(UInt8) min Max:(UInt8)max; |
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,55 @@ |
|||||
|
//
|
||||
|
// JLDevAudioAIttsHandler.h
|
||||
|
// JL_BLEKit
|
||||
|
// Created by EzioChan on 2025/12/12.
|
||||
|
// Copyright © 2025 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <JL_BLEKit/JLModel_SPEEX.h> |
||||
|
#import <JL_BLEKit/JL_BigDataManager.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@class JL_ManagerM; |
||||
|
@protocol JLDevAudioAIttsHandlerDelegate <NSObject> |
||||
|
/// 设备回调ai云数据
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 设备
|
||||
|
/// - aicloud: AI云数据对象
|
||||
|
- (void)receiveDataFrom:(JL_ManagerM *)manager WithAiCloud:(JLSpeechAiCloud *)aicloud; |
||||
|
|
||||
|
/// 设备返回tts合成数据
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 设备
|
||||
|
/// - tts: tts数据对象
|
||||
|
- (void)receiveDataFrom:(JL_ManagerM *)manager WithTTS:(JLSpeechTTSSynthesis *)tts; |
||||
|
@end |
||||
|
|
||||
|
/// 语音 AI/tts 传输处理(新)
|
||||
|
/// 对外接口与旧类一致,仅更换类名,内部转发至 JL_SpeechAIttsHandler
|
||||
|
@interface JLDevAudioAIttsHandler : NSObject |
||||
|
|
||||
|
@property (nonatomic, weak) id<JLDevAudioAIttsHandlerDelegate> delegate; |
||||
|
|
||||
|
/// 初始化一个语音大数据传输实例
|
||||
|
/// - Parameter mgr: JL_ManagerM
|
||||
|
- (instancetype)initWithMgr:(JL_ManagerM *)mgr; |
||||
|
|
||||
|
/// 发送tts语音合成信息
|
||||
|
/// - Parameters:
|
||||
|
/// - tts: tts语音对象内容
|
||||
|
/// - manager: 设备
|
||||
|
/// - result: 回调结果
|
||||
|
- (void)devAudioSendTTs:(JLSpeechTTSSynthesis *)tts manager:(JL_ManagerM *)manager result:(JL_BIGDATA_RT)result; |
||||
|
|
||||
|
/// 发送ai云数据到设备
|
||||
|
/// - Parameters:
|
||||
|
/// - cloud: ai云数据
|
||||
|
/// - manager: 设备
|
||||
|
/// - result: 回调结果
|
||||
|
- (void)devAudioSendAiCloud:(JLSpeechAiCloud *)cloud manager:(JL_ManagerM *)manager result:(JL_BIGDATA_RT)result; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,95 @@ |
|||||
|
//
|
||||
|
// JLDevAudioManager.h
|
||||
|
// JL_BLEKit
|
||||
|
// Created by EzioChan on 2025/12/12.
|
||||
|
// Copyright © 2025 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <JL_BLEKit/JL_TypeEnum.h> |
||||
|
#import <JL_BLEKit/JL_Tools.h> |
||||
|
#import <JL_BLEKit/JLModel_SPEEX.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@class JL_ManagerM; |
||||
|
@class JLDevAudioManager; |
||||
|
|
||||
|
@protocol JLDevAudioManagerDelegate <NSObject> |
||||
|
/// 录音数据回调
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 操作设备
|
||||
|
/// - data: 数据
|
||||
|
- (void)devAudioManager:(JLDevAudioManager *)manager Audio:(NSData *)data; |
||||
|
|
||||
|
/// 设备端开始录音
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 操作设备
|
||||
|
/// - param: 录音参数
|
||||
|
- (void)devAudioManager:(JLDevAudioManager *)manager StartByDeviceWithParam:(JLRecordParams *)param; |
||||
|
|
||||
|
/// 设备端结束录音
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 操作设备
|
||||
|
/// - param: 语音助手配置参数
|
||||
|
- (void)devAudioManager:(JLDevAudioManager *)manager StopByDeviceWithParam:(JLSpeechRecognition *)param; |
||||
|
|
||||
|
/// 录音状态回调
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 操作设备
|
||||
|
/// - status: 状态
|
||||
|
- (void)devAudioManager:(JLDevAudioManager *)manager Status:(JL_SpeakType)status; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
/// 设备录音管理对象(新)
|
||||
|
/// 对外接口与旧类一致,仅更换类名,内部转发至 JL_SpeexManager
|
||||
|
@interface JLDevAudioManager : NSObject |
||||
|
|
||||
|
@property (nonatomic, weak) id<JLDevAudioManagerDelegate> delegate; |
||||
|
|
||||
|
/// 获取单例
|
||||
|
/// - Parameters:
|
||||
|
/// - delegate: 代理
|
||||
|
/// - manager: 操作设备
|
||||
|
/// - Returns: 录音管理对象实例
|
||||
|
+ (JLDevAudioManager *)shareDevAudioManager:(id<JLDevAudioManagerDelegate>)delegate WithManager:(JL_ManagerM *)manager; |
||||
|
|
||||
|
/// 获取录音状态
|
||||
|
/// - Returns: 当前录音状态
|
||||
|
- (JL_SpeakType)cmdCheckRecordStatus; |
||||
|
|
||||
|
/// 开始录音
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 操作设备
|
||||
|
/// - params: 录音参数
|
||||
|
/// - result: 命令操作结果回调
|
||||
|
- (void)cmdStartRecord:(JL_ManagerM *)manager Params:(JLRecordParams *)params Result:(JL_CMD_RESPOND __nullable)result; |
||||
|
/// 停止录音
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 操作设备
|
||||
|
/// - reason: VAD类型
|
||||
|
/// - result: 命令操作结果回调
|
||||
|
- (void)cmdStopRecord:(JL_ManagerM *)manager Reason:(JLSpeakDownReason)reason Result:(JL_CMD_RESPOND __nullable)result; |
||||
|
/// 停止录音2
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: 操作设备
|
||||
|
/// - reason: vad类型
|
||||
|
/// - schr: 语音设置助手
|
||||
|
/// - result: 回调结果
|
||||
|
- (void)cmdStopRecord:(JL_ManagerM *)manager Reason:(JLSpeakDownReason)reason SpeechHelper:(JLSpeechRecognition *)schr Result:(JL_CMD_RESPOND __nullable)result; |
||||
|
|
||||
|
/// 允许录音(设备端主动发起时的同意响应)
|
||||
|
/// 在收到设备主动发起录音的回调后调用,设备会播放提示音
|
||||
|
- (void)cmdAllowSpeak; |
||||
|
/// 拒绝录音(设备端主动发起时的拒绝响应)
|
||||
|
/// 在收到设备主动发起录音的回调后调用,拒绝设备开始录音
|
||||
|
- (void)cmdRejectSpeak; |
||||
|
|
||||
|
/// 停止语音
|
||||
|
/// 发送命令给音箱,停止接收数据,即检测到断句
|
||||
|
- (void)cmdSpeakingDone __attribute__((deprecated("当前命令已失效,请使用cmdStopRecord:(JL_ManagerM *)manager Reason:(JLSpeakDownReason) reason"))); |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,102 @@ |
|||||
|
//
|
||||
|
// JLDevPlayerCtrl.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2023/9/25.
|
||||
|
// Copyright © 2023 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <JL_BLEKit/JL_BLEKit.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@class JL_ManagerM; |
||||
|
@class JLDevPlayerCtrl; |
||||
|
|
||||
|
/// 播放器回调
|
||||
|
@protocol JLDevPlayerCtrlDelegate<NSObject> |
||||
|
|
||||
|
/// 播放状态
|
||||
|
/// - Parameters:
|
||||
|
/// - ctrl: 播放器
|
||||
|
/// - status: 播放模式
|
||||
|
-(void)jlDevPlayerCtrl:(JLDevPlayerCtrl *)ctrl playMode:(uint8_t)playMode; |
||||
|
|
||||
|
/// 播放状态回调
|
||||
|
/// - Parameters:
|
||||
|
/// - ctrl: 播放器
|
||||
|
/// - status: 播放状态
|
||||
|
/// - card: 当前播放的设备
|
||||
|
/// - time: 当前播放的时间
|
||||
|
/// - total: 总时长
|
||||
|
-(void)jlDevPlayerCtrl:(JLDevPlayerCtrl *)ctrl playStatus:(uint8_t)status currentCard:(uint8_t)card currentTime:(uint32_t)time tolalTime:(uint32_t)total; |
||||
|
|
||||
|
/// 播放文件回调
|
||||
|
/// - Parameters:
|
||||
|
/// - ctrl: 播放器
|
||||
|
/// - name: 文件名
|
||||
|
/// - clus: 文件簇号
|
||||
|
-(void)jlDevPlayerCtrl:(JLDevPlayerCtrl *)ctrl fileName:(NSString *)name currentClus:(uint32_t)clus; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
|
||||
|
/// 设备播放器管理类
|
||||
|
@interface JLDevPlayerCtrl : JLCmdBasic |
||||
|
|
||||
|
/// 播放状态
|
||||
|
@property(nonatomic,assign)uint8_t playStatus; |
||||
|
|
||||
|
/// 当前播放的设备
|
||||
|
/// 0x00 : USB
|
||||
|
/// 0x01 : SD_0
|
||||
|
/// 0x02 : SD_1
|
||||
|
/// 0x03 : FLASH
|
||||
|
/// 0x04 : LineIn
|
||||
|
/// 0x05 : FLASH2
|
||||
|
@property(nonatomic,assign)uint8_t currentCard; |
||||
|
|
||||
|
/// 当前播放时间
|
||||
|
@property(nonatomic,assign)uint32_t currentTime; |
||||
|
|
||||
|
/// 歌曲总时长
|
||||
|
@property(nonatomic,assign)uint32_t tolalTime; |
||||
|
|
||||
|
/// 当前播放文件名
|
||||
|
@property(nonatomic,strong)NSString *fileName; |
||||
|
|
||||
|
/// 当前播放文件的簇号
|
||||
|
@property(nonatomic,assign)uint32_t currentClus; |
||||
|
|
||||
|
/// 当前播放模式
|
||||
|
/// 0x01:全部循环;
|
||||
|
/// 0x02:设备循环;
|
||||
|
/// 0x03:单曲循环;
|
||||
|
/// 0x04:随机播放;
|
||||
|
/// 0x05:文件夹循环
|
||||
|
@property (nonatomic,assign)uint8_t playMode; |
||||
|
|
||||
|
/// 代理
|
||||
|
@property(nonatomic,weak)id<JLDevPlayerCtrlDelegate> delegate; |
||||
|
|
||||
|
/// 操控设备播放器设置
|
||||
|
/// - Parameters:
|
||||
|
/// - cmd: 操作命令
|
||||
|
/// 0x01:PP按钮
|
||||
|
/// 0x02:上一曲
|
||||
|
/// 0x03:下一曲
|
||||
|
/// 0x04:切换播放模式(当前播放模式:不可指定,设备播放模式自增)
|
||||
|
/// 0x05:EQ
|
||||
|
/// 0x06:快退
|
||||
|
/// 0x07:快进
|
||||
|
/// - sec: 时间(当快进/快退时需要,其他功能时值为0)
|
||||
|
/// - manager: 设备对象
|
||||
|
/// - result: 返回结果
|
||||
|
-(void)cmdPlayerCtrl:(uint8_t)cmd |
||||
|
Second:(uint16_t)sec |
||||
|
Manager:(JL_ManagerM *)manager |
||||
|
Result:(JL_CMD_RESPOND __nullable)result; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,113 @@ |
|||||
|
//
|
||||
|
// JLDeviceConfig.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2022/10/31.
|
||||
|
// Copyright © 2022 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <JL_BLEKit/JL_TypeEnum.h> |
||||
|
|
||||
|
@class JL_ManagerM; |
||||
|
@class JLDeviceConfigModel; |
||||
|
@class JLDeviceConfigTws; |
||||
|
@class JLDeviceConfigDongle; |
||||
|
@class JLDeviceConfigSoundBox; |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
typedef void(^JLConfigRsp)(JL_CMDStatus status, uint8_t sn, JLDeviceConfigModel* __nullable config); |
||||
|
|
||||
|
typedef void(^JLConfigTwsRsp)(JL_CMDStatus status, uint8_t sn, JLDeviceConfigTws* __nullable config); |
||||
|
|
||||
|
typedef void(^JLConfigAuracastRsp)(JL_CMDStatus status, uint8_t sn, JLDeviceConfigDongle* __nullable config); |
||||
|
|
||||
|
typedef void (^JLConfigSoundBoxRsp)(JL_CMDStatus status, uint8_t sn, JLDeviceConfigSoundBox* __nullable config); |
||||
|
|
||||
|
|
||||
|
/// 固件设置配置回调协议
|
||||
|
/// 遵循时,可通过父类的- (void)addDelegate:(id)delegate方法添加遵循
|
||||
|
@protocol JLConfigPtl <NSObject> |
||||
|
|
||||
|
@optional |
||||
|
/// 监听回调协议
|
||||
|
/// - Parameter configModel: 固件设置配置回调
|
||||
|
-(void)deviceConfigWith:(JLDeviceConfigModel *)configModel; |
||||
|
|
||||
|
/// TWS监听回调协议
|
||||
|
/// - Parameter configModel: 固件设置配置回调
|
||||
|
-(void)deviceTwsConfigWith:(JLDeviceConfigTws *)configModel; |
||||
|
|
||||
|
/// SoundBox监听回调协议
|
||||
|
/// - Parameter configModel: 固件设置配置回调
|
||||
|
-(void)deviceSoundBoxConfigWith:(JLDeviceConfigSoundBox *)configModel; |
||||
|
|
||||
|
/// Dongle 监听回调协议
|
||||
|
/// - Parameter configModel: 固件设置配置回调
|
||||
|
-(void)deviceAuracastConfigWith:(JLDeviceConfigDongle *)configModel; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
@interface JLDeviceConfig : NSObject |
||||
|
|
||||
|
|
||||
|
@property(nonatomic,weak) id<JLConfigPtl> _Nullable delegate; |
||||
|
|
||||
|
+(instancetype)share; |
||||
|
|
||||
|
/// 获取设备配置信息
|
||||
|
-(void)deviceConfigGet:(JL_ManagerM *)manager; |
||||
|
|
||||
|
|
||||
|
/// 手表查询设备当前固件配置内容
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: manager
|
||||
|
/// - result: 回调功能配置内容
|
||||
|
-(void)deviceGetConfig:(JL_ManagerM *)manager result:(JLConfigRsp)result; |
||||
|
|
||||
|
/// 手表多设备管理时,可通过对应的设备UUID 获取相关的设备配置
|
||||
|
/// - Parameter entity: 设备uuidStr
|
||||
|
-(JLDeviceConfigModel *_Nullable)deviceGetConfigWithUUID:(NSString *)uuidStr; |
||||
|
|
||||
|
/// TWS查询设备当前固件配置内容
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: manager
|
||||
|
/// - result: 回调功能配置内容
|
||||
|
-(void)deviceTwsGetConfig:(JL_ManagerM *)manager result:(JLConfigTwsRsp)result; |
||||
|
|
||||
|
/// Dongle 查询设备当前固件配置内容
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: manager
|
||||
|
/// - result: 回调功能配置内容
|
||||
|
-(void)deviceDongleGetConfig:(JL_ManagerM *)manager result:(JLConfigAuracastRsp)result; |
||||
|
|
||||
|
/// SoundBox 查询设备当前固件配置内容
|
||||
|
/// - Parameters:
|
||||
|
/// - manager: manager
|
||||
|
/// - result: 回调功能配置内容
|
||||
|
-(void)deviceSoundBoxGetConfig:(JL_ManagerM *)manager result:(JLConfigSoundBoxRsp)result; |
||||
|
|
||||
|
|
||||
|
/// Tws多设备管理时,可通过对应的设备UUID 获取相关的设备配置
|
||||
|
/// - Parameter entity: 设备uuidStr
|
||||
|
-(JLDeviceConfigTws *)deviceGetTwsConfigWithUUID:(NSString *)uuidStr; |
||||
|
|
||||
|
/// Dongle 查询设备当前固件配置内容
|
||||
|
/// - Parameters:
|
||||
|
/// - uuidStr: 设备uuidStr
|
||||
|
-(JLDeviceConfigDongle *)deviceGetAuracastConfigWithUUID:(NSString *)uuidStr; |
||||
|
|
||||
|
|
||||
|
/// SoundBox 多设备管理时,可通过对应的设备 UUID 获取相关的设备配置信息
|
||||
|
/// - Parameter uuidStr: 设备 uuid
|
||||
|
-(JLDeviceConfigSoundBox *)deviceGetSoundBoxConfigWithUUID:(NSString *)uuidStr; |
||||
|
|
||||
|
|
||||
|
/// 私有测试接口请勿使用
|
||||
|
/// - Parameter data: 用于测试数据
|
||||
|
/// - Parameter st: 是否开启测试模式
|
||||
|
-(void)pDeviceTest:(NSData *)data Status:(BOOL)st; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,32 @@ |
|||||
|
//
|
||||
|
// JLDeviceConfigDongle.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/11/17.
|
||||
|
// Copyright © 2025 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <JL_BLEKit/JL_BLEKit.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
/// Auracast
|
||||
|
@interface JLDeviceConfigDongle : JLDeviceConfigBasic |
||||
|
/// 是否支持Auracast
|
||||
|
@property (nonatomic, assign, readonly) BOOL isSupportAuracast; |
||||
|
/// 是否支持接收Auracast
|
||||
|
@property (nonatomic, assign, readonly) BOOL isSupportReceiveAuracast; |
||||
|
/// 是否支持发射端 Auracast
|
||||
|
@property (nonatomic, assign, readonly) BOOL isSupportLancerAuracast; |
||||
|
|
||||
|
/// 是否支持TWS
|
||||
|
/// 说明设备支持TWS设备功能。
|
||||
|
/// 包含设备名称,弹窗快连,按键设置,灯效设置、工作模式等功能;
|
||||
|
@property (nonatomic, assign, readonly)BOOL isSupportTwsFunc; |
||||
|
|
||||
|
/// 是否支持重命名
|
||||
|
/// 设备是否支持修改设备名
|
||||
|
@property (nonatomic, assign, readonly)BOOL isSupportRename; |
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,242 @@ |
|||||
|
//
|
||||
|
// JLDeviceConfigFuncModel.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2022/10/31.
|
||||
|
// Copyright © 2022 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import "ECOneToMorePtl.h" |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
//MARK: - 必须功能
|
||||
|
|
||||
|
/// 必须功能
|
||||
|
@interface JLDeviceBasicFuncModel : NSObject |
||||
|
|
||||
|
/// 支持OTA
|
||||
|
@property(nonatomic,assign)BOOL spOTA; |
||||
|
|
||||
|
/// 支持资源更新
|
||||
|
@property(nonatomic,assign)BOOL spSourceUpdate; |
||||
|
|
||||
|
/// 支持表盘增加/删除/查询
|
||||
|
@property(nonatomic,assign)BOOL spDialOperation; |
||||
|
|
||||
|
/// 支持表盘切换
|
||||
|
@property(nonatomic,assign)BOOL spDialSwitch; |
||||
|
|
||||
|
/// 支持表盘预览
|
||||
|
@property(nonatomic,assign)BOOL spDialPreview; |
||||
|
|
||||
|
|
||||
|
-(instancetype)init:(NSData *)data; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
//MARK: - 系统功能
|
||||
|
/// 系统功能
|
||||
|
@interface JLDeviceSystemFuncModel : NSObject |
||||
|
|
||||
|
/// 支持屏幕设置
|
||||
|
@property(nonatomic,assign)BOOL spScreenSetting; |
||||
|
/// 支持震动强度
|
||||
|
@property(nonatomic,assign)BOOL spVibrationIntensity; |
||||
|
/// 支持勿扰模式
|
||||
|
@property(nonatomic,assign)BOOL spDoNotDisturb; |
||||
|
/// 支持锻炼设置
|
||||
|
@property(nonatomic,assign)BOOL spExerciseSettings; |
||||
|
/// 支持断开提醒
|
||||
|
@property(nonatomic,assign)BOOL spDisconnectReminder; |
||||
|
|
||||
|
-(instancetype)init:(NSData *)data; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
//MARK: - 功能选项
|
||||
|
/// 功能选项
|
||||
|
@interface JLDeviceExportFuncModel : NSObject |
||||
|
/// 支持常用联系人
|
||||
|
@property(nonatomic,assign)BOOL spTopContacts; |
||||
|
/// 支持音乐文件浏览
|
||||
|
@property(nonatomic,assign)BOOL spMusicFileBrows; |
||||
|
/// 音乐文件删除、传输
|
||||
|
@property(nonatomic,assign)BOOL spMusicFileOp; |
||||
|
/// 支持闹钟设置
|
||||
|
@property(nonatomic,assign)BOOL spAlarmSettings; |
||||
|
/// 支持信息同步
|
||||
|
@property(nonatomic,assign)BOOL spSyncInfo; |
||||
|
/// 支持天气同步
|
||||
|
@property(nonatomic,assign)BOOL spSyncWeather; |
||||
|
/// 支持找手机/设备
|
||||
|
@property(nonatomic,assign)BOOL spFindPhoneOrDevice; |
||||
|
/// Ai 云功能
|
||||
|
@property(nonatomic,assign)BOOL spAiCloud; |
||||
|
/// Ai 表盘
|
||||
|
@property(nonatomic,assign)BOOL spAiDial; |
||||
|
/// 平台接口信息获取
|
||||
|
@property(nonatomic,assign)BOOL spOpenInfo; |
||||
|
/// 支持4G模块
|
||||
|
@property(nonatomic,assign)BOOL sp4GModel; |
||||
|
|
||||
|
/// 支持表盘信息拓展
|
||||
|
@property(nonatomic,assign)BOOL spDialInfoExtend; |
||||
|
|
||||
|
-(instancetype)init:(NSData *)data; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
//MARK: - 运动健康
|
||||
|
|
||||
|
/// 手表综合功能支持
|
||||
|
@interface JLHealthFuncComprehensive : NSObject |
||||
|
|
||||
|
/// 支持健康监控
|
||||
|
@property(nonatomic,assign)BOOL spHealthMonitor; |
||||
|
/// 支持个人信息
|
||||
|
@property(nonatomic,assign)BOOL spPersonInfo; |
||||
|
/// 支持睡眠检测
|
||||
|
@property(nonatomic,assign)BOOL spSleepMonitor; |
||||
|
/// 支持运动心率提醒
|
||||
|
@property(nonatomic,assign)BOOL spSportHeartRateRemind; |
||||
|
/// 支持久坐提醒
|
||||
|
@property(nonatomic,assign)BOOL spSedentaryRemind; |
||||
|
/// 支持压力自动检测
|
||||
|
@property(nonatomic,assign)BOOL spStressDetection; |
||||
|
/// 支持跌倒检测
|
||||
|
@property(nonatomic,assign)BOOL spFallDetection; |
||||
|
/// 支持传感器设置
|
||||
|
@property(nonatomic,assign)BOOL spSensorSetup; |
||||
|
|
||||
|
-(instancetype)init:(NSData *)data; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
/// 手表运动模式支持功能
|
||||
|
@interface JLHealthFuncSportModel : NSObject |
||||
|
/// 支持运动记录
|
||||
|
@property(nonatomic,assign)BOOL spRecord; |
||||
|
/// 支持运动统计
|
||||
|
@property(nonatomic,assign)BOOL spStatistics; |
||||
|
/// 支持室外运动
|
||||
|
@property(nonatomic,assign)BOOL spOutdoor; |
||||
|
/// 支持室内运动
|
||||
|
@property(nonatomic,assign)BOOL spIndoor; |
||||
|
|
||||
|
-(instancetype)init:(NSData *)data; |
||||
|
@end |
||||
|
|
||||
|
/// 手表计步功能支持功能
|
||||
|
@interface JLHealthFuncGSensorModel : NSObject |
||||
|
/// 是否存在该传感器
|
||||
|
@property(nonatomic,assign)BOOL spExist; |
||||
|
/// 支持运动步数
|
||||
|
@property(nonatomic,assign)BOOL spStep; |
||||
|
|
||||
|
-(instancetype)init:(NSData *)data; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
|
||||
|
/// 手表心率功能支持功能
|
||||
|
@interface JLHealthFuncHeartRateModel : NSObject |
||||
|
/// 是否存在该传感器
|
||||
|
@property(nonatomic,assign)BOOL spExist; |
||||
|
/// 支持连续测试
|
||||
|
@property(nonatomic,assign)BOOL spSerialTest; |
||||
|
|
||||
|
-(instancetype)init:(NSData *)data; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
/// 手表血氧功能支持功能
|
||||
|
@interface JLHealthFuncBloodOxygenModel : NSObject |
||||
|
/// 是否存在该传感器
|
||||
|
@property(nonatomic,assign)BOOL spExist; |
||||
|
|
||||
|
-(instancetype)init:(NSData *)data; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
|
||||
|
/// 手表海拔功能支持功能
|
||||
|
@interface JLHealthFuncAltitudeModel : NSObject |
||||
|
/// 是否存在该传感器
|
||||
|
@property(nonatomic,assign)BOOL spExist; |
||||
|
|
||||
|
-(instancetype)init:(NSData *)data; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
/// 手表GPS功能支持功能
|
||||
|
@interface JLHealthFuncGPSModel : NSObject |
||||
|
/// 是否存在该传感器
|
||||
|
@property(nonatomic,assign)BOOL spExist; |
||||
|
|
||||
|
-(instancetype)init:(NSData *)data; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
|
||||
|
|
||||
|
@interface JLDeviceHealthFuncModel : NSObject |
||||
|
|
||||
|
/// 手表综合功能支持
|
||||
|
@property(nonatomic,strong)JLHealthFuncComprehensive *spComprehensive; |
||||
|
/// 手表运动模式支持功能
|
||||
|
@property(nonatomic,strong)JLHealthFuncSportModel *spSportModel; |
||||
|
/// 手表计步功能支持功能
|
||||
|
@property(nonatomic,strong)JLHealthFuncGSensorModel *spGSensor; |
||||
|
/// 手表心率功能支持功能
|
||||
|
@property(nonatomic,strong)JLHealthFuncHeartRateModel *spHeartRate; |
||||
|
/// 手表血氧功能支持功能
|
||||
|
@property(nonatomic,strong)JLHealthFuncBloodOxygenModel *spBloodOxygen; |
||||
|
/// 手表海拔功能支持功能
|
||||
|
@property(nonatomic,strong)JLHealthFuncAltitudeModel *spAltitude; |
||||
|
/// 手表GPS功能支持功能
|
||||
|
@property(nonatomic,strong)JLHealthFuncGPSModel *spGPS; |
||||
|
|
||||
|
-(instancetype)init:(NSData *)data; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
//MARK: - 设备配置信息
|
||||
|
|
||||
|
/// 设备配置信息
|
||||
|
@interface JLDeviceConfigBasic:NSObject |
||||
|
/// 产品标志类型
|
||||
|
/// 0 - 手表
|
||||
|
/// 1 - TWS耳机
|
||||
|
/// 2 - SoundBox
|
||||
|
/// 3 - Dongle 设备配置信息
|
||||
|
@property(nonatomic,assign)int deviceType; |
||||
|
/// 版本
|
||||
|
@property(nonatomic,assign)int version; |
||||
|
|
||||
|
/// 数据
|
||||
|
@property(nonatomic,copy)NSData *basicData; |
||||
|
|
||||
|
/// 功能配置所属设备的UUID
|
||||
|
@property(nonatomic,strong)NSString * _Nullable mbleIdentifyStr; |
||||
|
|
||||
|
-(instancetype)init:(NSData *)data; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
//MARK: - 手表配置信息数据结构解析
|
||||
|
|
||||
|
/// 手表配置信息数据结构
|
||||
|
@interface JLDeviceConfigModel:JLDeviceConfigBasic |
||||
|
/// - 必须功能
|
||||
|
@property(nonatomic,strong)JLDeviceBasicFuncModel *basicFunc; |
||||
|
/// - 系统功能
|
||||
|
@property(nonatomic,strong)JLDeviceSystemFuncModel *systemFunc; |
||||
|
/// - 功能选项
|
||||
|
@property(nonatomic,strong)JLDeviceExportFuncModel * exportFunc; |
||||
|
/// - 运动健康
|
||||
|
@property(nonatomic,strong)JLDeviceHealthFuncModel *healthFunc; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,31 @@ |
|||||
|
//
|
||||
|
// JLDeviceConfigSoundBox.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2025/11/21.
|
||||
|
// Copyright © 2025 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <JL_BLEKit/JL_BLEKit.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
@interface JLDeviceConfigSoundBox : JLDeviceConfigBasic |
||||
|
/// 是否支持Auracast
|
||||
|
@property (nonatomic, assign, readonly) BOOL isSupportAuracast; |
||||
|
/// 是否支持接收Auracast
|
||||
|
@property (nonatomic, assign, readonly) BOOL isSupportReceiveAuracast; |
||||
|
/// 是否支持发射端 Auracast
|
||||
|
@property (nonatomic, assign, readonly) BOOL isSupportLancerAuracast; |
||||
|
/// 是否支持TWS
|
||||
|
/// 说明设备支持TWS设备功能。
|
||||
|
/// 包含设备名称,弹窗快连,按键设置,灯效设置、工作模式等功能;
|
||||
|
@property (nonatomic, assign, readonly)BOOL isSupportTwsFunc; |
||||
|
|
||||
|
/// 是否支持重命名
|
||||
|
/// 设备是否支持修改设备名
|
||||
|
@property (nonatomic, assign, readonly)BOOL isSupportRename; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
@ -0,0 +1,59 @@ |
|||||
|
//
|
||||
|
// JLDeviceConfigTws.h
|
||||
|
// JL_BLEKit
|
||||
|
//
|
||||
|
// Created by EzioChan on 2024/1/23.
|
||||
|
// Copyright © 2024 www.zh-jieli.com. All rights reserved.
|
||||
|
//
|
||||
|
|
||||
|
#import <Foundation/Foundation.h> |
||||
|
#import <JL_BLEKit/JLDeviceConfigFuncModel.h> |
||||
|
|
||||
|
NS_ASSUME_NONNULL_BEGIN |
||||
|
|
||||
|
/// TWS设备配置
|
||||
|
@interface JLDeviceConfigTws : JLDeviceConfigBasic |
||||
|
|
||||
|
/// 是否支持替换提示音
|
||||
|
@property(nonatomic, assign)BOOL isSupportReplaceTipsVoice; |
||||
|
|
||||
|
/// 是否支持语音翻译
|
||||
|
/// Voice translation
|
||||
|
@property(nonatomic,assign,readonly)BOOL isSupportTranslate; |
||||
|
|
||||
|
/// 是否使用A2DP播放
|
||||
|
/// 翻译耳机功能扩展
|
||||
|
/// is use A2DP to play
|
||||
|
@property(nonatomic,assign,readonly)BOOL isUseA2DP; |
||||
|
|
||||
|
/// 是否支持Opus立体声
|
||||
|
@property(nonatomic,assign,readonly)BOOL isSupportOpusStereo; |
||||
|
|
||||
|
/// 是否支持耳机健康功能
|
||||
|
/// is support ear health
|
||||
|
@property(nonatomic,assign, readonly)BOOL isSupportHealthData; |
||||
|
|
||||
|
/// 是否支持Auracast
|
||||
|
@property (nonatomic, assign, readonly) BOOL isSupportAuracast; |
||||
|
|
||||
|
/// 是否支持接收Auracast
|
||||
|
@property (nonatomic, assign, readonly) BOOL isSupportReceiveAuracast; |
||||
|
|
||||
|
/// 是否支持发射端 Auracast
|
||||
|
@property (nonatomic, assign, readonly) BOOL isSupportLancerAuracast; |
||||
|
|
||||
|
/// 是否支持心跳机制
|
||||
|
@property (nonatomic, assign, readonly) BOOL isSupportHeartBeat; |
||||
|
|
||||
|
/// 是否支持TWS
|
||||
|
/// 说明设备支持TWS设备功能。
|
||||
|
/// 包含设备名称,弹窗快连,按键设置,灯效设置、工作模式等功能;
|
||||
|
@property (nonatomic, assign, readonly)BOOL isSupportTwsFunc; |
||||
|
|
||||
|
/// 是否支持重命名
|
||||
|
/// 设备是否支持修改设备名
|
||||
|
@property (nonatomic, assign, readonly)BOOL isSupportRename; |
||||
|
|
||||
|
@end |
||||
|
|
||||
|
NS_ASSUME_NONNULL_END |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue