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.
80 lines
2.4 KiB
80 lines
2.4 KiB
1 year ago
|
//
|
||
|
// BLEModel.m
|
||
|
// BluetoothDemo
|
||
|
//
|
||
|
// Created by mac on 17/3/9.
|
||
|
// Copyright © 2017年 . All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import "BLEModel.h"
|
||
|
|
||
|
@implementation BLEModel
|
||
|
|
||
|
//- (nonnull id)copyWithZone:(nullable NSZone *)zone
|
||
|
//{
|
||
|
// BLEModel *entity = [super copyWithZone:zone];
|
||
|
// entity.central = self.central;
|
||
|
// entity.peripheral = self.peripheral;
|
||
|
// entity.advertisementData = self.advertisementData;
|
||
|
// entity.RSSI = self.RSSI;
|
||
|
// entity.UUIDString = self.UUIDString;
|
||
|
// entity.MACString = self.MACString;
|
||
|
// return entity;
|
||
|
//}
|
||
|
|
||
|
//- (void)encodeWithCoder:(NSCoder *)aCoder
|
||
|
//{
|
||
|
// [aCoder encodeObject:self.central forKey:@"central"];
|
||
|
// [aCoder encodeObject:self.peripheral forKey:@"peripheral"];
|
||
|
// [aCoder encodeObject:self.advertisementData forKey:@"advertisementData"];
|
||
|
// [aCoder encodeObject:self.RSSI forKey:@"RSSI"];
|
||
|
// [aCoder encodeObject:self.UUIDString forKey:@"UUIDString"];
|
||
|
// [aCoder encodeObject:self.MACString forKey:@"MACString"];
|
||
|
//}
|
||
|
//
|
||
|
//- (id)initWithCoder:(NSCoder *)aDecoder
|
||
|
//{
|
||
|
// if((self= [super init]))
|
||
|
// {
|
||
|
// self.central = [aDecoder decodeObjectForKey:@"central"];
|
||
|
// self.peripheral = [aDecoder decodeObjectForKey:@"peripheral"];
|
||
|
// self.advertisementData = [aDecoder decodeObjectForKey:@"advertisementData"];
|
||
|
// self.RSSI = [aDecoder decodeObjectForKey:@"RSSI"];
|
||
|
// self.UUIDString = [aDecoder decodeObjectForKey:@"UUIDString"];
|
||
|
// self.MACString = [aDecoder decodeObjectForKey:@"MACString"];
|
||
|
// }
|
||
|
// return self;
|
||
|
//}
|
||
|
|
||
|
///**
|
||
|
// 构造一个BLE模型
|
||
|
//
|
||
|
// @param central 中心管理
|
||
|
// @param peripheral 外设
|
||
|
// @param advertisementData 外设携带数据
|
||
|
// @param RSSI 信号强度
|
||
|
// @param UUIDString uuid
|
||
|
// */
|
||
|
//- (instancetype)initWithCentral:(CBCentralManager *)central
|
||
|
// Peripheral:(CBPeripheral *)peripheral
|
||
|
// AdvertisementData:(NSDictionary *)advertisementData
|
||
|
// RSSI:(NSNumber *)RSSI
|
||
|
// UUIDString:(NSString *)UUIDString
|
||
|
// MACString:(NSString *)MACString {
|
||
|
// self = [super init];
|
||
|
//
|
||
|
// if (self) {
|
||
|
//
|
||
|
// self.central = central;
|
||
|
// self.peripheral = peripheral;
|
||
|
// self.advertisementData = advertisementData;
|
||
|
// self.RSSI = RSSI;
|
||
|
// self.UUIDString = UUIDString;
|
||
|
// self.MACString = MACString;
|
||
|
//
|
||
|
// }
|
||
|
// return self;
|
||
|
//}
|
||
|
|
||
|
@end
|