decode($body); self::log($data, 'BoxPlayVoiceServer', self::$LOG_MAJOR); return false; } /** * 解析装载的数据 * @param $body * @return array * User: Mead */ private function decode($body) { $i = 0; // 时间 $time = self::stitching($body, $i, 4); $i += 4; // 执行结果 $result = self::stitching($body, $i, 1); $i += 1; // 提示音指令 $voice_cmd = self::stitching($body, $i, 2); $i += 2; //MsgId $msg_id = self::stitching($body, $i); $time = $this->decodeTime($time); return [ 'time' => $time, 'result' => $result, 'voice_cmd' => $voice_cmd, 'msg_id' => $msg_id, ]; } }