美文网首页
5-17-1 判断灯的状态

5-17-1 判断灯的状态

作者: RBNote | 来源:发表于2017-05-17 09:08 被阅读8次

self.currentDevice.EQUIPMENT_ONOFF 为 nsinteger 类型

if (self.currentDevice.place == Max) {
                self.currentDevice.EQUIPMENT_ONOFF = self.currentDevice.EQUIPMENT_ONOFF ^ (1 << (5-1));
                command = (command | (1 << 5)) ^ (1 << (5-1));
            }else if (self.currentDevice.place == Min){
                self.currentDevice.EQUIPMENT_ONOFF = self.currentDevice.EQUIPMENT_ONOFF ^ (1 << 0);
                command = (command | (1 << 1)) ^ (1 << 0);
            }else if (self.currentDevice.place == Middle){
                self.currentDevice.EQUIPMENT_ONOFF = self.currentDevice.EQUIPMENT_ONOFF ^ (1 << (3-1));
                command = (command | (1 << 3)) ^ (1 << (3-1));
            }

相关文章

网友评论

      本文标题:5-17-1 判断灯的状态

      本文链接:https://www.haomeiwen.com/subject/ogorxxtx.html