The icsneolegacy API finds devices correctly now

This commit is contained in:
Paul Hollinsky
2018-09-27 13:34:16 -04:00
parent 06b7181492
commit 2b443ad83d
3 changed files with 13 additions and 11 deletions
+5 -4
View File
@@ -1,18 +1,19 @@
#ifndef __DEVICETYPE_H_
#define __DEVICETYPE_H_
typedef uint32_t devicetype_t;
// Hold the length of the longest name, so that C applications can allocate memory accordingly
// Currently the longest is "Intrepid Ethernet Evaluation Board"
#define DEVICE_TYPE_LONGEST_NAME (35 + 1) // Add 1 so that if someone forgets, they still have space for null terminator
#ifndef __cplusplus
#include <stdint.h>
typedef uint32_t devicetype_t;
#else
#include <ostream>
#include <cstdint>
typedef uint32_t devicetype_t;
namespace icsneo {
class DeviceType {
@@ -147,8 +148,8 @@ public:
DeviceType(DeviceType::Enum netid) { value = netid; }
DeviceType::Enum getDeviceType() const { return value; }
std::string toString() const { return GetDeviceTypeString(getDeviceType()); }
friend std::ostream& operator<<(std::ostream& os, const DeviceType& DeviceType) {
os << DeviceType.toString();
friend std::ostream& operator<<(std::ostream& os, const DeviceType& type) {
os << type.toString().c_str();
return os;
}