|
@@ -107,9 +107,9 @@ $ws_worker->onWorkerStart = function($ws_worker)
|
|
|
while (strlen($file_path) < 200) {
|
|
|
$file_path .= '0';
|
|
|
}
|
|
|
- $cmd .= $file_path;
|
|
|
- $cmd = crc16(pack('H*', $cmd));
|
|
|
- $mqtt->publish($topick.$address, unpack('H*', $cmd));
|
|
|
+ // $cmd .= $file_path;
|
|
|
+ $crc = crc16(pack('H*', $cmd).$file_path);
|
|
|
+ $mqtt->publish($topick.$address, pack('H*', $cmd).$file_path.pack('H*',).$crc);
|
|
|
|
|
|
$index = strtolower($address);
|
|
|
$devUpdateList[$index] = array('client'=>$client,'lamp_id'=>$v['lamp_id'],'time'=>time(),'type'=>0,'step'=>0,'number'=>$number);
|