You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.0 KiB
67 lines
1.0 KiB
![]()
2 years ago
|
//
|
||
|
// BluetoothTool.h
|
||
|
// BluetoothDemo
|
||
|
//
|
||
|
// Created by mac on 17/3/16.
|
||
|
// Copyright © 2017年 . All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import <Foundation/Foundation.h>
|
||
|
#import <AddressBook/AddressBook.h> //通讯录库
|
||
|
|
||
|
@interface BluetoothTool : NSObject
|
||
|
|
||
|
/**
|
||
|
CRC校验数据是否正确
|
||
|
*/
|
||
|
+ (BOOL)checkCRCWithData:(NSMutableData *)data;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* 16进制字符串转10进制数字
|
||
|
*
|
||
|
* @param hexString 16进制字符串
|
||
|
*
|
||
|
* @return 十进制数据
|
||
|
*/
|
||
|
+ (int)intFromHexSrting:(NSString *)hexString;
|
||
|
|
||
|
|
||
|
/**
|
||
|
10进制转16进制字符串
|
||
|
|
||
|
@param hexNumber 10进制
|
||
|
|
||
|
@return 十六进制字符串
|
||
|
*/
|
||
|
+ (NSString *)stringWithHexNumber:(int)hexNumber;
|
||
|
|
||
|
|
||
|
|
||
|
/**
|
||
|
构造L1层第二个字节
|
||
|
|
||
|
@param err 1:对的 0:错的
|
||
|
@param ack 1:回复 0:命令
|
||
|
@param vision 版本
|
||
|
*/
|
||
|
+ (Byte)stitchWithErr:(int)err
|
||
|
Ack:(int)ack
|
||
|
Vision:(int)vision;
|
||
|
|
||
|
|
||
|
/**
|
||
|
倒序mac地址
|
||
|
*/
|
||
|
+ (NSString *)getInvertedOrderMacWithData:(NSData *)data;
|
||
|
|
||
|
|
||
|
/**
|
||
|
正序mac地址
|
||
|
*/
|
||
|
+ (NSString *)getPositiveSequenceMacWithData:(NSData *)data;
|
||
|
|
||
|
|
||
|
|
||
|
@end
|