当前位置: 首页>>代码示例>>PHP>>正文


PHP SetValueInteger函数代码示例

本文整理汇总了PHP中SetValueInteger函数的典型用法代码示例。如果您正苦于以下问题:PHP SetValueInteger函数的具体用法?PHP SetValueInteger怎么用?PHP SetValueInteger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SetValueInteger函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: RequestAction

 public function RequestAction($Ident, $Value)
 {
     switch ($Ident) {
         case "Dooya":
             switch ($Value) {
                 case 0:
                     //Down
                     $state = false;
                     SetValueInteger($this->GetIDForIdent('Dooya'), $Value);
                     $this->Down();
                     break;
                 case 1:
                     //Stop
                     $this->Stop();
                     SetValueInteger($this->GetIDForIdent('Dooya'), $Value);
                     break;
                 case 2:
                     //Up
                     $this->Up();
                     SetValueInteger($this->GetIDForIdent('Dooya'), $Value);
                     break;
             }
             break;
         default:
             throw new Exception("Invalid ident");
     }
 }
开发者ID:Wolbolar,项目名称:IPSymconAIOGateway,代码行数:27,代码来源:module.php

示例2: SetValueInteger

 protected function SetValueInteger($Ident, $Value)
 {
     $ID = $this->GetIDForIdent($Ident);
     if (GetValueInteger($ID) != $Value) {
         SetValueInteger($ID, intval($Value));
         return true;
     }
     return false;
 }
开发者ID:TierFreund,项目名称:Rpc2Symcon,代码行数:9,代码来源:uRpcBase.class.php

示例3: SetValueInteger

 private function SetValueInteger($Ident, $value)
 {
     $id = $this->GetIDForIdent($Ident);
     if (GetValueInteger($id) != $value) {
         SetValueInteger($id, $value);
         return true;
     }
     return false;
 }
开发者ID:hermanthegerman2,项目名称:IPSBananaPi,代码行数:9,代码来源:module.php

示例4: SetVariable

function SetVariable($VarID, $Type, $Value)
{
    switch ($Type) {
        case 0:
            // boolean
            SetValueBoolean($VarID, $Value);
            break;
        case 1:
            // integer
            SetValueInteger($VarID, $Value);
            break;
        case 2:
            // float
            SetValueFloat($VarID, $Value);
            break;
        case 3:
            // string
            SetValueString($VarID, $Value);
            break;
    }
}
开发者ID:Spoosie,项目名称:KH_UniFi,代码行数:21,代码来源:orga.php

示例5: UpdateVariable

 private function UpdateVariable(ISCP_API_Data $APIData)
 {
     if ($APIData->Data == "N/A") {
         return;
     }
     switch ($APIData->Mapping->VarType) {
         case IPSVarType::vtBoolean:
             $VarID = $this->GetVariable($APIData->APICommand, $APIData->Mapping->VarType, $APIData->Mapping->VarName, $APIData->Mapping->Profile, $APIData->Mapping->EnableAction);
             $Value = ISCP_API_Commands::$BoolValueMapping[$APIData->Data];
             SetValueBoolean($VarID, $Value);
             break;
         case IPSVarType::vtFloat:
             $VarID = $this->GetVariable($APIData->APICommand, $APIData->Mapping->VarType, $APIData->Mapping->VarName, $APIData->Mapping->Profile, $APIData->Mapping->EnableAction);
             $Value = $APIData / 100;
             SetValueFloat($VarID, $Value);
             //                throw new Exception("Float VarType not implemented.");
             break;
         case IPSVarType::vtInteger:
             $VarID = $this->GetVariable($APIData->APICommand, $APIData->Mapping->VarType, $APIData->Mapping->VarName, $APIData->Mapping->Profile, $APIData->Mapping->EnableAction);
             $Value = hexdec($APIData->Data);
             SetValueInteger($VarID, $Value);
             break;
         case IPSVarType::vtString:
             $VarID = $this->GetVariable($APIData->APICommand, $APIData->Mapping->VarType, $APIData->Mapping->VarName, $APIData->Mapping->Profile, $APIData->Mapping->EnableAction);
             $Value = $APIData->Data;
             SetValueString($VarID, $Value);
             break;
         case IPSVarType::vtDualInteger:
             $Prefix = substr($APIData->Data, 0, 1);
             $VarID = $this->GetVariable($APIData->APICommand . $APIData->Mapping->ValuePrefix[$Prefix], IPSVarType::vtInteger, $APIData->Mapping->VarName[$Prefix], $APIData->Mapping->Profile, $APIData->Mapping->EnableAction);
             $Value = $APIData->Mapping->ValueMapping[substr($APIData->Data, 1, 2)];
             SetValueInteger($VarID, $Value);
             if (strlen($APIData->Data) > 3) {
                 $Prefix = substr($APIData->Data, 3, 1);
                 $VarID = $this->GetVariable($APIData->APICommand . $APIData->Mapping->ValuePrefix[$Prefix], IPSVarType::vtInteger, $APIData->Mapping->VarName[$Prefix], $APIData->Mapping->Profile, $APIData->Mapping->EnableAction);
                 $Value = $APIData->Mapping->ValueMapping[substr($APIData->Data, 4, 2)];
                 SetValueInteger($VarID, $Value);
             }
     }
 }
开发者ID:Nall-chan,项目名称:IPSOnkyoAVR,代码行数:40,代码来源:module.php

示例6: SetInput

 public function SetInput($input)
 {
     SetValueInteger($this->GetIDForIdent('INPUT'), $this->GetInputId($input));
     return $this->Request("<Input><Input_Sel>{$input}</Input_Sel></Input>", 'PUT');
 }
开发者ID:scheibuman,项目名称:SymconYAVR,代码行数:5,代码来源:module.php

示例7: SendRFCode

 public function SendRFCode(integer $Value)
 {
     //RF Code auslesen Value 0 entspricht RFCode 1
     $RFCode = "RFCode" . $Value;
     if ($Value <= 32 && !null == $this->GetIDForIdent('RFCODES1')) {
         $setvalue = $Value - 1;
         SetValueInteger($this->GetIDForIdent('RFCODES1'), $setvalue);
     } elseif ($Value <= 64 && $Value > 32 && !null == $this->GetIDForIdent('RFCODES2')) {
         $setvalue = $Value - 33;
         SetValueInteger($this->GetIDForIdent('RFCODES2'), $setvalue);
     } elseif ($Value <= 96 && $Value > 64 && !null == $this->GetIDForIdent('RFCODES3')) {
         $setvalue = $Value - 65;
         SetValueInteger($this->GetIDForIdent('RFCODES3'), $setvalue);
     } elseif ($Value <= 100 && $Value > 96 && !null == $this->GetIDForIdent('RFCODES4')) {
         $setvalue = $Value - 97;
         SetValueInteger($this->GetIDForIdent('RFCODES4'), $setvalue);
     }
     $RF_send = $this->ReadPropertyString($RFCode);
     return $this->Send_RF($RF_send);
 }
开发者ID:Wolbolar,项目名称:IPSymconAIOGateway,代码行数:20,代码来源:module.php

示例8: SendCommand

 protected function SendCommand($command)
 {
     $FS20 = $this->Calculate();
     $ip_aiogateway = $this->GetIPGateway();
     IPS_LogMessage("FS20 Adresse:", $FS20);
     IPS_LogMessage("FS20 Command:", $command);
     $GatewayPassword = $this->GetPassword();
     switch ($command) {
         case "1000":
             //An
             SetValueBoolean($this->GetIDForIdent('Status'), true);
             if (IPS_StatusVariableExists($this->InstanceID, "Dimmer")) {
                 SetValueInteger($this->GetIDForIdent('Dimmer'), 10);
             }
             break;
         case "0000":
             //Aus
             SetValueBoolean($this->GetIDForIdent('Status'), false);
             if (IPS_StatusVariableExists($this->InstanceID, "Dimmer")) {
                 SetValueInteger($this->GetIDForIdent('Dimmer'), 0);
             }
             break;
         case "DIM0":
             //0
             SetValueBoolean($this->GetIDForIdent('Status'), false);
             SetValueInteger($this->GetIDForIdent('Dimmer'), 0);
             $command = "0000";
             break;
         case "0200":
             //10
             SetValueInteger($this->GetIDForIdent('Dimmer'), 1);
             break;
         case "0300":
             //20
             SetValueInteger($this->GetIDForIdent('Dimmer'), 2);
             break;
         case "0500":
             //30
             SetValueInteger($this->GetIDForIdent('Dimmer'), 3);
             break;
         case "0600":
             //40
             SetValueInteger($this->GetIDForIdent('Dimmer'), 4);
             break;
         case "0800":
             //50
             SetValueInteger($this->GetIDForIdent('Dimmer'), 5);
             break;
         case "0900":
             //60
             SetValueInteger($this->GetIDForIdent('Dimmer'), 6);
             break;
         case "0B00":
             //70
             SetValueInteger($this->GetIDForIdent('Dimmer'), 7);
             break;
         case "0D00":
             //80
             SetValueInteger($this->GetIDForIdent('Dimmer'), 8);
             break;
         case "0E00":
             //90
             SetValueInteger($this->GetIDForIdent('Dimmer'), 9);
             break;
         case "DIM100":
             //100
             SetValueBoolean($this->GetIDForIdent('Status'), true);
             SetValueInteger($this->GetIDForIdent('Dimmer'), 10);
             $command = "1000";
             break;
     }
     if ($GatewayPassword !== "") {
         $gwcheck = file_get_contents("http://" . $this->GetIPGateway() . "/command?XC_USER=user&XC_PASS=" . $GatewayPassword . "&XC_FNC=SendSC&type=FS20&data=" . $FS20 . $command);
         IPS_LogMessage("AIOGateway:", "Senden an Gateway mit Passwort");
     } else {
         $gwcheck = file_get_contents("http://" . $this->GetIPGateway() . "/command?XC_FNC=SendSC&type=FS20&data=" . $FS20 . $command);
     }
     if ($gwcheck == "{XC_SUC}") {
         $this->response = true;
     } elseif ($gwcheck == "{XC_AUTH}") {
         $this->response = false;
         echo "Keine Authentifizierung möglich. Das Passwort für das Gateway ist falsch.";
     }
     return $this->response;
 }
开发者ID:Wolbolar,项目名称:IPSymconAIOGateway,代码行数:85,代码来源:module.php

示例9: SendIRCode

 public function SendIRCode(integer $Value)
 {
     //IR Code auslesen Value 0 entspricht IRCode 1
     $IRCode = "IRCode" . $Value;
     if ($Value <= 32 && !null == $this->GetIDForIdent('IRCODES1')) {
         $setvalue = $Value - 1;
         SetValueInteger($this->GetIDForIdent('IRCODES1'), $setvalue);
     } elseif ($Value <= 64 && $Value > 32 && !null == $this->GetIDForIdent('IRCODES2')) {
         $setvalue = $Value - 33;
         SetValueInteger($this->GetIDForIdent('IRCODES2'), $setvalue);
     } elseif ($Value <= 96 && $Value > 64 && !null == $this->GetIDForIdent('IRCODES3')) {
         $setvalue = $Value - 65;
         SetValueInteger($this->GetIDForIdent('IRCODES3'), $setvalue);
     } elseif ($Value <= 100 && $Value > 96 && !null == $this->GetIDForIdent('IRCODES4')) {
         $setvalue = $Value - 97;
         SetValueInteger($this->GetIDForIdent('IRCODES4'), $setvalue);
     }
     $IR_send = $this->ReadPropertyString($IRCode);
     $this->Send_IR($IR_send, $this->GetIRDiode(), $this->GetExtIRDiode());
     return true;
 }
开发者ID:Wolbolar,项目名称:IPSymconAIOGateway,代码行数:21,代码来源:module.php

示例10: ParseData

 /**
  * handle incoming data along capabilities
  * @param array $data
  */
 private function ParseData($data)
 {
     //
     $caps = $this->GetCaps();
     //$this->debug(__FUNCTION__,print_r($this->all_caps,true));
     foreach (array_keys($caps) as $cap) {
         $ident = $caps[$cap];
         $vid = @$this->GetIDForIdent($ident);
         if ($vid == 0) {
             $this->debug(__FUNCTION__, "Cap {$cap} Ident {$ident}: Variable missed");
             continue;
         }
         if (!isset($data[$cap])) {
             continue;
         }
         $s = $data[$cap];
         switch ($cap) {
             //integer
             case 'TS':
                 //Timestamp
             //Timestamp
             case 'Signal':
                 //RSSI
             //RSSI
             case 'Timer':
                 //Duration code
             //Duration code
             case 'Dimmer':
                 //intensity 100%
             //intensity 100%
             case 'Shutter':
                 //intensity 100%
                 $iv = (int) $s;
                 SetValueInteger($vid, $iv);
                 break;
                 //String
             //String
             case 'Name':
                 //Duration code
                 $st = utf8_decode($s);
                 SetValueString($vid, $st);
                 break;
                 //special
             //special
             case 'Switch':
                 //Status
                 $state = $this->SwitchStatus($s);
                 SetValueBoolean($vid, $state);
                 break;
             case 'Lock':
                 //Status
                 $state = preg_match("/YES|CLOSE|OK/i", $s);
                 //reversed
                 SetValueBoolean($vid, $state);
                 break;
             case 'Alert':
                 //Status
                 $state = !preg_match("/YES|ALERT/i", $s);
                 //reversed
                 SetValueBoolean($vid, $state);
                 break;
             case 'Battery':
                 //battery
                 $state = !preg_match("/LOW|WARN/i", $s);
                 //reversed
                 SetValueBoolean($vid, $state);
                 break;
             case 'FS20':
                 //fs20 mode decoding
                 $state = false;
                 $intensity = 0;
                 $timer = 0;
                 $acode = '';
                 $actioncode = '';
                 $code = utf8_decode($s);
                 $this->debug(__FUNCTION__, "FS20 Code " . strToHex($code));
                 $action = $code[0];
                 $ext = ord($code[1]);
                 $tvid = @$this->GetIDForIdent($caps['Timer']);
                 $dvid = @$this->GetIDForIdent($caps['Dimmer']);
                 $swid = @$this->GetIDForIdent($caps['Switch']);
                 $avid = @$this->GetIDForIdent($caps['TimerActionCode']);
                 $this->debug(__FUNCTION__, "FS20 Vars S:{$swid},D:{$dvid},T:{$tvid},A:{$avid}");
                 if ($dvid) {
                     $intensity = GetValueInteger($dvid);
                 }
                 if ($swid) {
                     $state = GetValueBoolean($swid);
                 }
                 if ($tvid) {
                     $timer = GetValueInteger($tvid);
                 }
                 if ($avid) {
                     $acode = GetValueString($avid);
                 }
                 $ac = ord($action) & 0x1f;
//.........这里部分代码省略.........
开发者ID:Tommi2Day,项目名称:ipsymcon-phpmodule-by-Tommi,代码行数:101,代码来源:module.php

示例11: Colorselect

 public function Colorselect(integer $Value)
 {
     SetValueInteger($this->GetIDForIdent('Farbauswahl'), $Value);
     // HEX-Wert in einzelne Werte für Rot / Grün / Blau zerlegen
     $r = $Value >> 16 & 0xff;
     $g = $Value >> 8 & 0xff;
     $b = $Value >> 0 & 0xff;
     // Farbsättigung
     /**
     Berechnung der Helligkeit aus den RGB-Werten mit fs = 255
     http://www.w3.org/TR/2006/WD-WCAG20-20060427/appendixA.html#luminosity-contrastdef
     
      Der Controller hat insgesamt 9 Helligkeitsstufen.
     */
     $fs = 255;
     $Helligkeit = 0.2126 * pow($r / $fs, 2.2) + 0.7151999999999999 * pow($g / $fs, 2.2) + 0.0722 * pow($b / $fs, 2.2);
     $Helligkeitsstufe = intval($Helligkeit * 9 + 1);
     $Helligkeitsstufe_alt = $this->ReadPropertyInteger("Helligkeit");
     $Anzahl = $Helligkeitsstufe - $Helligkeitsstufe_alt;
     SetValue($this->GetIDForIdent("Helligkeit"), $Helligkeitsstufe);
     // Umwandeln der RGB Werte
     $hsv = $this->RGBtoHSV($r, $g, $b);
     $address = $this->ReadPropertyString("LEDAdresse");
     /**
     Holen der 6-stelligen Hex Stringadresse des LM II Controllers
      Diese muss um 0X ergänzt und mit 00 verlängert werden ---> 0xAdresse00.
     
      Ferner werden für die Helligkeitsregelung die Hex Adressen für Up (+3) und
     Down (+) benötigt.
     
     Buchstaben der Hex Werte müssen in Grossbuchstaben umgewandelt werden.
     */
     $Adresse_Hex = "0x" . $address . "00";
     $Adresse_Int = hexdec($Adresse_Hex);
     $Adresse_Up_Hex = strtoupper(dechex($Adresse_Int + 3));
     $Adresse_Down_Hex = strtoupper(dechex($Adresse_Int + 4));
     /**
     			 Der Controller hat insgesamt 128 Farbcodes ---> es gibt 128 Raster mit je 2.8125°. Aufgrund des
     			 hsv Wertes wird das Raster bestimmt.
     
     			Der Farbkreis beginnt mit Rot bei 0°. Innerhalb der Codesequenz des Controllers befindet sich Rot
     			 auf Index = 103. Deshalb müssen die Werte bis zum Index 103 jeweils verringert werden, um den Übergang
     			 zu Gelb, Orange ... zu erhalten. Ab Index 104 muss mit dem letzten Index 128 angefangen werden (lila)
     			und dann immer verringert werden bis rot erreicht ist.
     			
     			Dabei ist zu beachten, dass die gültigen Codes nur die Endstellen 0, 7, 8 und F haben und somit entweder
     			7 oder 1 zu addieren ist.
     */
     $hsv = intval($hsv / 2.8125) + 1;
     if ($hsv > 103) {
         $hsv = 232 - $hsv;
     } else {
         $hsv = 104 - $hsv;
     }
     $Int1 = intval(($hsv - 1) / 4) * 16;
     $Rest = ($hsv - 1) % 4;
     switch ($Rest) {
         case 0:
             $Int2 = 0;
             break;
         case 1:
             $Int2 = 7;
             break;
         case 2:
             $Int2 = 8;
             break;
         case 3:
             $Int2 = 15;
             break;
     }
     // Adresse zum Senden des Farbcodes bilden
     $Adresse_Int = $Adresse_Int + $Int1 + $Int2;
     $address = strtoupper(dechex($Adresse_Int));
     $command = "";
     // command ist schon in address enthalten
     return $this->Send_LED($address, $command, $this->GetIPGateway());
     // Setzen der Helligkeit nachdem die Farbe eingestellt worden ist
     if ($Anzahl > 0) {
         for ($i = 1; $i <= $Anzahl; $i++) {
             $this->Up();
         }
     }
     if ($Anzahl < 0) {
         for ($i = -1; $i >= $Anzahl; $i--) {
             $this->Down();
         }
     }
 }
开发者ID:Wolbolar,项目名称:IPSymconAIOGateway,代码行数:88,代码来源:module.php

示例12: Parse

 /**
  * parses an record string
  * 
  * @param $data string
  * @param $status string
  * @return array
  */
 private function Parse($data, $status)
 {
     /**
      * @par Status
      * @code
      * #----Status (te923con -s -i '')
      * 0x29 :0x17 :0x14 :0x10 :0x26 :1   :1   :1   :1   :1   :1   :1   :1
      * SYSSW:BARSW:EXTSW:RCCSW:WINSW:BATR:BATU:BATW:BAT5:BAT4:BAT5:BAT2:BAT1
      * @endcode
      * - SYSSW  - software version of system controller
      * - BARSW  - software version of barometer
      * - EXTSW  - software version of UV and channel controller
      * - RCCSW  - software version of rain controller
      * - WINSW  - software version of wind controller
      * - BATR   - battery of rain sensor (1-good (not present), 0-low)
      * - BATU   - battery of UV sensor (1-good (not present), 0-low)
      * - BATW   - battery of wind sensor (1-good (not present), 0-low)
      * - BAT5   - battery of sensor 5 (1-good (not present), 0-low)
      * - BAT4   - battery of sensor 4 (1-good (not present), 0-low)
      * - BAT3   - battery of sensor 3 (1-good (not present), 0-low)
      * - BAT2   - battery of sensor 2 (1-good (not present), 0-low)
      * - BAT1   - battery of sensor 1 (1-good (not present), 0-low)
      *
      * @par Data
      * @code
      * #------Data (te923con -i 'i')
      *
      * 1356207784:22.95:41:7.70:91:8.00:83:i :i :i :i :i :i :1001.9:i :3 :0    :9 :0.1:0.0:7.2:356
      * T0   :H0:T1  :H1:T2  :H2:T3:H3:T4:H4:T5:H5:PRESS :UV:FC:STORM:WD:WS :WG :WC :RC
      * @endcode
      * -  T0    - temperature from internal sensor in °C
      * -  H0    - humidity from internal sensor in % rel
      * -  T1..5 - temperature from external sensor 1..4 in °C
      * -  H1..5 - humidity from external sensor 1...4 in % rel
      * -  PRESS - air pressure in mBar
      * -  UV    - UV index from UV sensor
      * -  FC    - station forecast, see below for more details
      * -  STORM - stormwarning; 0 - no warning, 1 - fix your dog
      * -  WD    - wind direction in n x 22.5°; 0 -> north
      * -  WS    - wind speed in m/s
      * -  WG    - wind gust speed in m/s
      * -  WC    - windchill temperature in °C
      * -  RC    - rain counter (maybe since station starts measurement) as value
      *
      *
      * weather forecast means (as precisely as possible)
      * - 0 - heavy snow
      * - 1 - little snow
      * - 2 - heavy rain
      * - 3 - little rain
      * - 4 - cloudy
      * - 5 - some clouds
      * - 6 - sunny
      */
     $te_data = array();
     $status = explode(":", $status);
     $data = explode(":", $data);
     $cdata = count($data);
     $cstatus = count($status);
     $this->debug(__FUNCTION__, "Entered: Data:{$cdata},Status: {$cstatus}");
     //if (($cdata == 22) && ($cstatus == 13)) {
     $date = $data[0];
     $tsid = @$this->GetIDForIdent('TimeStamp');
     if ($tsid > 0) {
         SetValueInteger($tsid, $date);
     }
     $te_data['date'] = $date;
     //Indoor and Sensor1-5 T/H
     for ($s = 0; $s < self::MAXSENSORS; $s++) {
         $f = $s * 2 + 1;
         if (trim($data[$f]) == 'i') {
             continue;
         }
         $te_data[$s]['Id'] = "{$s}";
         $te_data[$s]['Temp'] = (double) $data[$f];
         if ($s > 0) {
             $batf = 13 - $s;
             if (isset($status[$batf])) {
                 $stat = $status[$batf] == '0' ? 'LOW' : 'OK';
                 $te_data[$s]['Battery'] = $stat;
             }
         }
         if (trim($data[$f + 1]) != 'i') {
             $te_data[$s]['Hum'] = (int) $data[$f + 1];
         }
         //todo
         $te_data[$s]['Typ'] = 'T/F';
         if ($s == 0) {
             $te_data[$s]['Typ'] = 'Indoor';
         } else {
             if (!isset($te_data[$s]['Hum'])) {
                 $te_data[$s]['Typ'] = 'T';
             }
//.........这里部分代码省略.........
开发者ID:Tommi2Day,项目名称:ipsymcon-phpmodule-by-Tommi,代码行数:101,代码来源:module.php

示例13: incError

 /**
  * inc Error counter
  */
 private function incError()
 {
     $vid = $this->GetIDForIdent('Errors');
     if ($vid) {
         $val = GetValueInteger($vid);
         SetValueInteger($vid, $val + 1);
     }
 }
开发者ID:Tommi2Day,项目名称:ipsymcon-phpmodule-by-Tommi,代码行数:11,代码来源:module.php

示例14: ReceiveData

 public function ReceiveData($JSONString)
 {
     $Data = json_decode($JSONString);
     // Nur API Daten annehmen.
     //        IPS_LogMessage('ReceiveDataFromGateway:'.$this->InstanceID,  print_r($Data,1));
     if ($Data->DataID != '{0C541DDF-CE0F-4113-A76F-B4836015212B}') {
         return false;
     }
     $APIData = new TXB_API_Data();
     $APIData->GetDataFromJSONObject($Data);
     // Auf NodeNamen prüfen
     if ($APIData->NodeName != $this->ReadPropertyString('NodeName')) {
         return false;
     }
     switch ($APIData->APICommand) {
         case TXB_API_Command::XB_API_Transmit_Status:
             $TransmitStatusID = $this->GetIDForIdent("TransmitStatus");
             if (!$this->lock('Transmit_Status')) {
                 throw new Exception('Receive Transmit Status is locked');
             }
             $this->SendDebug('TX_Status_Received(8B)', $APIData->Data, 1);
             SetValueInteger($TransmitStatusID, ord($APIData->Data[1]));
             $this->unlock('Transmit_Status');
             break;
         case TXB_API_Command::XB_API_Receive_Paket:
             $Receive_Status = $APIData->Data[0];
             if ((ord($Receive_Status) & TXB_Receive_Status::XB_Receive_Packet_Acknowledged) == TXB_Receive_Status::XB_Receive_Packet_Acknowledged) {
                 $this->SendDebug('Receive_Paket(OK)', substr($APIData->Data, 1), 1);
                 $this->SendDataToChild(substr($APIData->Data, 1));
             } else {
                 $this->SendDebug('ReceivePaket(Error:' . bin2hex($Receive_Status) . ')', substr($APIData->Data, 1), 1);
             }
             break;
         case TXB_API_Command::XB_API_Remote_AT_Command_Responde:
             $ATData = new TXB_Command_Data();
             $ATData->ATCommand = substr($APIData->Data, 0, 2);
             $ATData->Status = $APIData->Data[2];
             $ATData->Data = substr($APIData->Data, 3);
             $this->SendDebug('Remote_AT_Command_Responde(' . $ATData->ATCommand . ')', $ATData->Data, 1);
             $this->SendDataToDevice($ATData);
             break;
         case TXB_API_Command::XB_API_IO_Data_Sample_Rx:
             $IOSample = new TXB_API_IO_Sample();
             $IOSample->Status = $APIData->Data[0];
             $IOSample->Sample = substr($APIData->Data, 1);
             $this->SendDebug('IO_Data_Sample_Rx(' . $APIData->APICommand . ')', $APIData->Data, 1);
             $this->SendDataToDevice($IOSample);
             break;
         default:
             /*
                               SendData('unhandle('+inttohex(ord(APIData.APICommand),2)+')',APIdata.Data);
             */
             break;
     }
     return true;
 }
开发者ID:Nall-chan,项目名称:IPSXBeeZigBee,代码行数:56,代码来源:module.php

示例15: DoBlutdruck

 protected function DoBlutdruck($ModulID, $data)
 {
     $diastolic = 0;
     $systolic = 0;
     $pulse = 0;
     $CatID = @IPS_GetCategoryIDByName("Blutdruck", $ModulID);
     if ($CatID === false) {
         return;
     }
     $time = @$data['measuregrps'][0]['date'];
     $data = @$data['measuregrps'][0]['measures'];
     if (count($data) != 3) {
         $this->Logging("Fehler bei DoBlutdruck " . count($data));
         //return;
     }
     $id = @IPS_GetVariableIDByName("DatumUhrzeit", $CatID);
     if ($id > 0) {
         $old = GetValueInteger($id);
         if ($old == $time) {
             // keine neue Daten
             return false;
         }
         SetValueInteger($id, $time);
     }
     foreach ($data as $messung) {
         $val = $messung['value'];
         if ($messung['type'] == 9) {
             $diastolic = $val;
         }
         if ($messung['type'] == 10) {
             $systolic = $val;
         }
         if ($messung['type'] == 11) {
             $pulse = $val;
         }
     }
     $id = IPS_GetVariableIDByName("Diastolic", $CatID);
     if ($id > 0) {
         SetValueInteger($id, $diastolic);
     }
     $id = IPS_GetVariableIDByName("Systolic", $CatID);
     if ($id > 0) {
         SetValueInteger($id, $systolic);
     }
     $id = IPS_GetVariableIDByName("Puls", $CatID);
     if ($id > 0) {
         SetValueInteger($id, $pulse);
     }
 }
开发者ID:1007,项目名称:Symcon1007_Withings,代码行数:49,代码来源:module.php


注:本文中的SetValueInteger函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。