File tree Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -84,4 +84,13 @@ struct FlagBits {
84
84
static const uint8_t Do512Beams = (0x01 ) << 6 ;
85
85
};
86
86
87
- } // namespace liboculus
87
+ // There doesn't appear to be an enum for the masterMode (like there is
88
+ // for pingRate and dataSize), so creating our own to match comments in
89
+ // liboculus/thirdparty/Oculus/Oculus.h.
90
+ typedef enum {
91
+ OCULUS_LOW_FREQ = 1 ,
92
+ OCULUS_HIGH_FREQ = 2
93
+ } OculusFreqMode;
94
+
95
+
96
+ } // namespace liboculus
Original file line number Diff line number Diff line change 34
34
#include < boost/asio.hpp>
35
35
36
36
#include " Oculus/Oculus.h"
37
+ #include " liboculus/Constants.h"
37
38
38
39
namespace liboculus {
39
40
@@ -57,11 +58,6 @@ class SonarConfiguration {
57
58
SonarConfiguration &setFlags (uint8_t flags);
58
59
SonarConfiguration &setWaterTemperature (double degC);
59
60
60
- typedef enum {
61
- OCULUS_LOW_FREQ = 1 ,
62
- OCULUS_HIGH_FREQ = 2
63
- } OculusFreqMode;
64
-
65
61
SonarConfiguration &setFreqMode (OculusFreqMode input);
66
62
OculusFreqMode getFreqMode () const {
67
63
if (_sfm.masterMode == 1 )
@@ -96,9 +92,7 @@ class SonarConfiguration {
96
92
SonarConfiguration &use512Beams () { return set512Beams (true ); }
97
93
bool get512Beams () const { return _512beams;}
98
94
99
-
100
95
bool getSendGain () const { return _sendGain; }
101
- // bool getData16Bit() const { return _16bitData; }
102
96
bool getSimpleReturn () const { return _simpleReturn; }
103
97
bool getGainAssistance () const { return _gainAssistance; }
104
98
Original file line number Diff line number Diff line change @@ -191,11 +191,13 @@ std::vector<uint8_t> SonarConfiguration::serialize<OculusSimpleFireMessage>() co
191
191
192
192
void SonarConfiguration::updateFlags () const {
193
193
_sfm.extFlags = 0 ;
194
- if (_dataSize == dataSize32Bit)
194
+ if (_dataSize == dataSize32Bit) {
195
195
_sfm.extFlags |= 0x00000200 ;
196
+ }
196
197
198
+ const bool more_than_8bit = (_dataSize == dataSize16Bit) || (_dataSize == dataSize32Bit);
197
199
_sfm.flags = (_rangeInMeters ? FlagBits::RangeAsMeters : 0 ) |
198
- (((_dataSize == dataSize16Bit) || (_dataSize == dataSize32Bit)) ? FlagBits::Data16Bits : 0 ) |
200
+ (more_than_8bit ? FlagBits::Data16Bits : 0 ) |
199
201
(_sendGain ? FlagBits::DoSendGain : 0 ) |
200
202
(_simpleReturn ? FlagBits::SimpleReturn : 0 ) |
201
203
(_gainAssistance ? FlagBits::GainAssistance : 0 ) |
@@ -221,7 +223,4 @@ void SonarConfiguration::dump() const {
221
223
<< " \n use 512 beams " << get512Beams ();
222
224
}
223
225
224
-
225
-
226
-
227
226
} // namespace liboculus
You can’t perform that action at this time.
0 commit comments