LabJackTypeConverters.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_LABJACKTYPECONVERTERS_H
#define SURGSIM_DEVICES_LABJACK_LINUX_LABJACKTYPECONVERTERS_H
#include <array>
#include "SurgSim/Devices/LabJack/linux/LabJackConstants.h"
namespace SurgSim
{
namespace Devices
{
namespace LabJack
{
double doubleFromChars(const std::array<unsigned char, MAXIMUM_BUFFER>& bytes, int startIndex);
uint32_t uint32FromChars(const std::array<unsigned char, LabJack::MAXIMUM_BUFFER> &bytes, int startIndex, int count);
uint16_t uint16FromChars(const std::array<unsigned char, LabJack::MAXIMUM_BUFFER> &bytes, int startIndex, int count);
}; // namespace LabJack
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_LABJACK_LINUX_LABJACKTYPECONVERTERS_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::LabJack::doubleFromChars
double doubleFromChars(const std::array< unsigned char, MAXIMUM_BUFFER > &bytes, int startIndex)
Converts an eight byte array to a floating point double value.
Definition: LabJackTypeConverters.cpp:26
LabJackConstants.h
SurgSim::Devices::LabJack::uint32FromChars
uint32_t uint32FromChars(const std::array< unsigned char, LabJack::MAXIMUM_BUFFER > &bytes, int startIndex, int count)
Converts an array of bytes to a uint32_t, with the least significant byte at startIndex, and the most significant byte at startIndex + byteCount - 1.
Definition: LabJackTypeConverters.cpp:41
SurgSim::Devices::LabJack::uint16FromChars
uint16_t uint16FromChars(const std::array< unsigned char, LabJack::MAXIMUM_BUFFER > &bytes, int startIndex, int count)
Converts an array of bytes to a uint16_t, with the least significant byte at startIndex.
Definition: LabJackTypeConverters.cpp:55