public void PushFrame(EtaConnectionFrames.CFrame frame) { EtaConnectionFrames _connection_frames_temp = _connection_frames; if (_connection_frames_temp != null) { _connection_frames_temp.PushFrame(frame); } }
public void PushSingleton(EtaConnectionFrames.CFrame frame_singleton, EFrameSignletonPriority priority) { EtaConnectionFrames _connection_frames_temp = _connection_frames; if (_connection_frames_temp != null) { _connection_frames_temp.PushSingleton(frame_singleton, (uint)priority); } }
private void _FrameProcessor(EtaConnectionFrames.CFrame frame) { EFrameCommand _command = (EFrameCommand)frame.Command; byte[] _bytes_buffer = frame.BytesFrame; int _buffer_length = _bytes_buffer.Length; //Console.WriteLine(BitConverter.ToString(_bytes_buffer)); if (_command == EFrameCommand.DEBUG_STRING) { Console.Write(Encoding.GetEncoding(1251).GetString(_bytes_buffer)); } else if (_command == EFrameCommand.STATUS) { int _offset = 0; bool _is_new_hall = false, _is_new_pwm = false; HallPosition = _bytes_buffer[_offset++]; byte _new_hall_prescaler = _bytes_buffer[_offset++]; ushort _new_hall_period = BitConverter.ToUInt16(_bytes_buffer, _offset); _offset += 2; ushort _new_pwm_power = BitConverter.ToUInt16(_bytes_buffer, _offset); _offset += 2; _is_new_hall = _new_hall_prescaler != _hall_prescaler || _new_hall_period != _hall_period; _is_new_pwm = _new_pwm_power != _pwm_power; HallPrescaler = _new_hall_prescaler; HallPeriod = _new_hall_period; PWMPower = _new_pwm_power; if (_is_new_hall) { OnPropertyChanged(nameof(NewParamHall)); } if (_is_new_pwm) { OnPropertyChanged(nameof(NewParamPWM)); } } }