浏览代码

版本升级维护

yyqxiaoyin 5 年之前
父节点
当前提交
77ee39318b

+ 7 - 0
MKRRadioManager/Classes/MKRRadioManager/Headers/MKRPlayControlProtocol.h

@@ -99,6 +99,13 @@
 - (void)setPlayMode:(MKRRadioPlayMode)playMode channelNO:(NSInteger)channelNO;
 
 /**
+设置设备低电量提醒
+
+@param enable 是否允许低电量提醒
+*/
+- (void)setLowBatteryNoticeEnable:(BOOL)enable;
+
+/**
  播放某个频道某一首歌
 
  @param channelNO 频道号

+ 5 - 0
MKRRadioManager/Classes/MKRRadioManager/MKRWIFIDeviceManager/MKRWIFIDeviceManager.h

@@ -202,5 +202,10 @@
 /// @param channelNO 设置播放模式的频道
 - (void)setPlayMode:(MKRRadioPlayMode)playMode device:(id<MKRUPnPDevice>)device channelNO:(NSInteger)channelNO;
 
+/// 设置低电量提醒
+/// @param enable 是否开启低电量提醒
+/// @param device 控制的设备
+- (void)setLowPowerNoticeEnable:(BOOL)enable device:(id<MKRUPnPDevice>)device;
+
 @end
 

+ 6 - 0
MKRRadioManager/Classes/MKRRadioManager/MKRWIFIDeviceManager/MKRWIFIDeviceManager.m

@@ -579,6 +579,12 @@ static inline void wd_playControl_queue(void (^block)(void)){
     });
 }
 
+- (void)setLowPowerNoticeEnable:(BOOL)enable device:(id<MKRUPnPDevice>)device{
+    wd_playControl_queue(^{
+        libupnp_SetLowBatteryNotification(device.groupManagementUrl,enable);
+    });
+}
+
 - (id <MKRRadioResorce>)getPlayingStatusWithDevice:(id <MKRUPnPDevice>)device {
     wd_playControl_queue(^{
         NSDictionary *resultDic = [[ASControlTools sharedInstanceUPNP] libupnp_getPlayInfo:device.avTransportUrl];