添加重启、恢复出厂的udp指令实现
This commit is contained in:
@@ -13,12 +13,34 @@
|
||||
- (NSString *)description{
|
||||
|
||||
self.messagetype=@"00";
|
||||
self.massagelegth=@"48";
|
||||
self.massagelegth=@"39";
|
||||
self.functionCode=@"12";
|
||||
self.sendmacId = @"000000000000";
|
||||
self.resavemacId = @"000000000000";
|
||||
|
||||
return [NSString stringWithFormat:@"%@%@%@%@%@%@%@%@", self.messagetype,self.functionCode,self.sendmacId,self.resavemacId,self.massagelegth,[dataContorl hexStringFromString:self.ssidName], [dataContorl hexStringFromString:self.pwd],[self crcCode]];
|
||||
return [NSString stringWithFormat:@"%@%@%@%@%@%@%@%@", self.messagetype,self.functionCode,self.sendmacId,self.resavemacId,self.massagelegth,[self zeroLeftPadding:[dataContorl hexStringFromString:self.ssidName]], [self zeroLeftPadding:[dataContorl hexStringFromString:self.pwd]],[self crcCode]];
|
||||
}
|
||||
|
||||
- (NSString *)ssidName {
|
||||
return [NSString stringWithFormat:@"%@\0", _ssidName];
|
||||
}
|
||||
|
||||
- (NSString *)pwd {
|
||||
return [NSString stringWithFormat:@"%@\0", _pwd];
|
||||
}
|
||||
|
||||
- (NSString *)zeroLeftPadding:(NSString *)origin {
|
||||
if (origin.length >= 40) {
|
||||
return [origin substringToIndex:40];
|
||||
} else {
|
||||
NSInteger left = 40 - origin.length;
|
||||
NSMutableString *str = [NSMutableString string];
|
||||
for (NSInteger index = 0; index < left; index++) {
|
||||
[str appendString:@"0"];
|
||||
}
|
||||
[str appendString:origin];
|
||||
return [str copy];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)crcCode {
|
||||
|
||||
Reference in New Issue
Block a user