iOS AILinkBleSDK - 蓝牙SDK
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

ELAILinkBleManager+MeatProbeBox.m 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // ELAILinkBleManager+MeatProbeBox.m
  3. // AILinkBleSDK
  4. //
  5. // Created by LarryZhang on 2023/2/16.
  6. //
  7. #import "ELAILinkBleManager+MeatProbeBox.h"
  8. #import "ELMeatProbeBoxBleHeader.h"
  9. @implementation ELAILinkBleManager (MeatProbeBox)
  10. //APP 获取设备状态数据(Type:01)
  11. - (NSData *)meatProbeBoxGetStatus {
  12. Byte bytes[] = { ELMeatProbeBoxCMDAppGetStatus_Type01, 0x01 };
  13. NSData *payload = [[NSData alloc] initWithBytes:bytes length:sizeof(bytes)];
  14. [self sendA7PayloadNoEncryption:payload];
  15. return payload;
  16. }
  17. //设置、获取设备参数数据(Type:03)
  18. - (NSData *)meatProbeBoxSendCustomData:(NSData *)customData withMac:(NSData *)macData {
  19. Byte bytes[] = { ELMeatProbeBoxCMDCustomData_Type03, 0x01 };
  20. NSMutableData *payload = [[NSMutableData alloc] initWithBytes:bytes length:sizeof(bytes)];
  21. [payload appendData:macData];
  22. [payload appendData:customData];
  23. [self sendA7PayloadNoEncryption:payload.copy];
  24. return payload.copy;
  25. }
  26. - (NSData *)meatProbeBoxRequestCustomDataWithMac:(NSData *)macData {
  27. Byte bytes[] = { ELMeatProbeBoxCMDCustomData_Type03, 0x02 };
  28. NSMutableData *payload = [[NSMutableData alloc] initWithBytes:bytes length:sizeof(bytes)];
  29. [payload appendData:macData];
  30. [self sendA7PayloadNoEncryption:payload.copy];
  31. return payload.copy;
  32. }
  33. - (NSData *)meatProbeBoxClearCustomDataWithMac:(NSData *)macData {
  34. Byte bytes[] = { ELMeatProbeBoxCMDCustomData_Type03, 0x00 };
  35. NSMutableData *payload = [[NSMutableData alloc] initWithBytes:bytes length:sizeof(bytes)];
  36. [payload appendData:macData];
  37. [self sendA7PayloadNoEncryption:payload.copy];
  38. return payload.copy;
  39. }
  40. //切换单位(Type:04)
  41. - (NSData *)meatProbeBoxSwitchUint:(ELDeviceTemperatureUnit)unit {
  42. Byte bytes[] = { ELMeatProbeBoxCMDAppSwitchUnit_Type04, unit };
  43. NSData *payload = [[NSData alloc] initWithBytes:bytes length:sizeof(bytes)];
  44. [self sendA7PayloadNoEncryption:payload];
  45. return payload;
  46. }
  47. @end