IO_Bit 2.2.0 をリリースしました
(一瞬 2.1.3 をリリースしましたが無かったことにしました。openpear は一度作ったリリースは削除できないっぽいので、残ってますがスルーして下さい)
BCD 対応で getUIBCD8 と putUIBCD8 の関数を追加しました。
尚、しばらくは github と openpear と並行してリリースします。そのうち github だけ更新するかも。
追加イメージ
// Binary-coded decimal function getUIBCD8() { $this->byteAlign(); if (strlen($this->_data) < $this->_byte_offset + 1) { $data_len = strlen($this->_data); $offset = $this->_byte_offset; throw new IO_Bit_Exception("getBCD8: $data_len < $offset + 1"); } $value = ord($this->_data{$this->_byte_offset}); $value = ($value >> 4 )* 10 + ($value & 0x0f); $this->_byte_offset += 1; return $value; }
// Binary-coded decimal function putUIBCD8($value) { $this->byteAlign(); $value1 = $value % 10; $value2 = ($value - $value1)/10; $value = ($value2 << 4) + $value1; $this->_data .= chr($value); $this->_byte_offset += 1; return true; }