// 第一种
NSString *connID = ((Collector *)weakSelf.globalMutableArray[i]).orignalConnID;
const uint8_t a = [[connID substringToIndex:] intValue];
NSRange bRange = {, };
const uint8_t b = [[connID substringWithRange:bRange] intValue];
NSRange cRange = {, };
const uint8_t c = [[connID substringWithRange:cRange] intValue];
const uint8_t d = [[connID substringFromIndex:] intValue]; //第二种
NSString *str = @"AA21f0c1762a3abc299c013abe7dbcc50001DD";
NSData* bytes = [str dataUsingEncoding:NSUTF8StringEncoding];
Byte * myByte = (Byte *)[bytes bytes];
NSLog(@"myByte = %hhu",myByte[]);
NSMutableData* data = [NSMutableData data];
NSScanner* scanner = [NSScanner scannerWithString:@"AA"];
unsigned intValue;
[scanner scanHexInt:&intValue];
[data appendBytes:&intValue length:];
Byte * yte = (Byte *)[data bytes];
// 拿到的数据
const uint8_t senddata[] = {0xEB, 0x90, 0x00, 0x05, 0x06, a, b, c, d, 0x87};

觉得有用还是没用都评论哦! ^..^!!!

最新文章

  1. November 3rd Week 45th Thursday 2016
  2. 深入理解DOM事件类型系列第三篇——变动事件
  3. Find Minimum in Rotated Sorted Array leetcode java
  4. dom4j操作xml
  5. 题解西电OJ (Problem 1006 - 转盘游戏)--动态规划
  6. 浏览器检测(BrowserDetect.js)
  7. C++ STL (备忘)
  8. C#操作Office.word(一)
  9. BZOJ 1096
  10. TWinControl.DefaultHandler处理WM_CTLCOLORMSGBOX..WM_CTLCOLORSTATIC消息的两个参数很有意思,两个都是传递句柄
  11. Entity Framework Core 2.0 中使用LIKE 操作符
  12. python—文件处理
  13. [Swift]LeetCode295. 数据流的中位数 | Find Median from Data Stream
  14. vue-cli脚手架(框架)
  15. 数组练习题A财务管理
  16. Git远程仓库地址变更本地如何修改
  17. Unity应用架构设计(2)——使用中介者模式解耦ViewModel之间通信
  18. 使用policheck 检测
  19. React半科普文
  20. 基于jquery的ui选择之路

热门文章

  1. JVM执行子系统探究——类文件结构初窥
  2. 关于freetype在安装中的遇到的问题
  3. Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies
  4. python - 接口自动化测试 - contants - 常量封装
  5. python - 接口自动化测试实战 - case1 - 再次优化版
  6. python - 自动化测试框架 - logger
  7. ZOJ-3956 Course Selection System,01背包!
  8. PHPSTORM+Thinkphp3.2模板标签替换Thinkphp5.1公式
  9. 利用MVC模式简单设计jsp分页效果
  10. BZOJ 4584 [Apio2016]赛艇 ——动态规划