LabJackChecksums.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_DEVICES_LABJACK_LINUX_LABJACKCHECKSUMS_H
#define SURGSIM_DEVICES_LABJACK_LINUX_LABJACKCHECKSUMS_H
#include <array>
#include "SurgSim/Devices/LabJack/linux/LabJackConstants.h"
namespace SurgSim
{
namespace Devices
{
namespace LabJack
{
unsigned char normalChecksum8(const std::array<unsigned char, MAXIMUM_BUFFER>& bytes, int count);
uint16_t extendedChecksum16(const std::array<unsigned char, MAXIMUM_BUFFER>& bytes, int count);
unsigned char extendedChecksum8(const std::array<unsigned char, MAXIMUM_BUFFER>& bytes);
void normalChecksum(std::array<unsigned char, MAXIMUM_BUFFER>* bytes, int count);
void extendedChecksum(std::array<unsigned char, MAXIMUM_BUFFER>* bytes, int count);
}; // namespace LabJack
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_LABJACK_LINUX_LABJACKCHECKSUMS_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
LabJackConstants.h
SurgSim::Devices::LabJack::normalChecksum8
unsigned char normalChecksum8(const std::array< unsigned char, MAXIMUM_BUFFER > &bytes, int count)
Calculates an 8-bit 1&#39;s complement unsigned checksum specifically for normal command communication wi...
Definition: LabJackChecksums.cpp:25
SurgSim::Devices::LabJack::extendedChecksum8
unsigned char extendedChecksum8(const std::array< unsigned char, MAXIMUM_BUFFER > &bytes)
Calculates an 8-bit 1&#39;s complement unsigned checksum specifically for extended command communication ...
Definition: LabJackChecksums.cpp:57
SurgSim::Devices::LabJack::normalChecksum
void normalChecksum(std::array< unsigned char, MAXIMUM_BUFFER > *bytes, int count)
Performs the 8-bit 1&#39;s complement unsigned checksum required for normal command communication with th...
Definition: LabJackChecksums.cpp:62
SurgSim::Devices::LabJack::extendedChecksum16
uint16_t extendedChecksum16(const std::array< unsigned char, MAXIMUM_BUFFER > &bytes, int count)
Calculates a 16-bit 1&#39;s complement unsigned checksum specifically for extended command communication ...
Definition: LabJackChecksums.cpp:44
SurgSim::Devices::LabJack::extendedChecksum
void extendedChecksum(std::array< unsigned char, MAXIMUM_BUFFER > *bytes, int count)
Performs the 1&#39;s complement unsigned checksums required for extended command communication with the l...
Definition: LabJackChecksums.cpp:67