-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathEnums.cs
664 lines (626 loc) · 14.4 KB
/
Enums.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
//
// Enums.cs
//
// Author:
// Jae Stutzman <jaebird@gmail.com>
//
// Copyright (c) 2016 Jae Stutzman
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using System.Runtime.InteropServices;
using HamLibSharp.Utils;
namespace HamLibSharp
{
public enum RigDebugLevel
{
/// no bug reporting
None = 0,
/// serious bug
Debug,
/// error case (e.g. protocol, memory allocation)
Error,
/// warning
Warn,
/// verbose
Verbose,
/// tracing
Trace
}
public enum RigBackendStatus
{
/// Alpha quality, i.e. development
Alpha = 0,
/// Written from available specs, rig unavailable for test, feedback wanted!
Untested,
/// Beta quality
Beta,
/// Stable
Stable,
/// Was stable, but something broke it!
Buggy,
};
public enum PttType
{
/// No PTT available
None = 0,
/// Legacy PTT
Rig,
/// PTT control through serial DTR signal
SerialDtr,
/// PTT control through serial RTS signal
SerialRts,
/// PTT control through parallel port
Parallel,
/// Legacy PTT, supports RIG_PTT_ON_MIC/RIG_PTT_ON_DATA
RigMicData,
/// PTT control through CM108 GPIO pin
CM108
}
// Radio power state
[Flags]
public enum PowerState
{
/// Power off
Off = 0,
/// Power on
On = (1 << 0),
/// Standby
Standby = (1 << 1)
}
//Reset operation
[Flags]
public enum RigReset
{
/// No reset
None = 0,
/// Software reset
Soft = (1 << 0),
/// VFO reset
Vfo = (1 << 1),
/// Memory clear
MemoryClear = (1 << 2),
/// Master reset
Master = (1 << 3)
}
//DCD type
public enum RigDcd
{
/// No DCD available
None = 0,
/// Rig has DCD status support, i.e. rig has get_dcd cap
Rig,
/// DCD status from serial DSR signal
SerialDsr,
/// DCD status from serial CTS signal
SerialCts,
/// DCD status from serial CD signal
SerialCar,
/// DCD status from parallel port pin
Parallel,
/// DCD status from CM108 vol dn pin
CM108
}
public enum RigPort
{
/// No port
None = 0,
/// Serial
Serial,
/// Network socket type
Network,
/// Device driver, like the WiNRADiO
Device,
/// AX.25 network type, e.g. SV8CS protocol
Packet,
/// DTMF protocol bridge via another rig, eg. Kenwood Sky Cmd System
DTMF,
/// IrDA Ultra protocol!
IrdaUltra,
/// RPC wrapper
RPC,
/// Parallel port
Parallel,
/// USB port
USB,
/// UDP Network socket type
UdpNetwork,
/// CM108 GPIO
CM108,
/// GPIO
Gpio,
/// GPIO Inverted
GpioInverted,
}
//Serial parity
public enum RigSerialParity
{
/// No parity
None = 0,
/// Odd
Odd,
/// Even
Even,
/// Mark
Mark,
/// Space
Space
}
//Serial handshake
public enum RigSerialHandshake
{
/// No handshake
None = 0,
/// Software XON/XOFF
[TextName("XONXOFF")]
XonXoff,
/// Hardware CTS/RTS
Hardware
}
//Serial control state
public enum RigSerialControlState
{
/// Unset or tri-state
Unset = 0,
/// ON
On,
/// OFF
Off
}
public enum RigSerialBaudRate
{
BaudNone = 0,
Baud2400 = 2400,
Baud4800 = 4800,
Baud9600 = 9600,
Baud14400 = 14400,
Baud19200 = 19200,
Baud28800 = 28800,
Baud38400 = 38400,
Baud56000 = 56000,
Baud57600 = 57600,
Baud115200 = 115200,
Baud128000 = 128000,
Baud256000 = 256000,
}
//Announce
//Designate optional speech synthesizer.
[Flags]
public enum RigAnnounce
{
/// None
None = 0,
/// disable announces
Off = None,
/// Announce frequency
Frequency = (1 << 0),
/// Announce receive mode
RxMode = (1 << 1),
/// CW
CW = (1 << 2),
/// English
English = (1 << 3),
/// Japan
Japan = (1 << 4)
}
//VFO operation
//
// A VFO operation is an action on a VFO (or tunable memory).
// The difference with a function is that an action has no on/off
// status, it is performed at once.
//
// Note: the vfo argument for some vfo operation may be irrelevant,
// and thus will be ignored.
//
// The VFO/MEM "mode" is set by rig_set_vfo.
// STRING used in rigctl
[Flags]
public enum RigVfoOperation : uint
{
/// '' No VFO_OP
None = 0,
/// CPY -- VFO A = VFO B
Copy = (1 << 0),
/// XCHG -- Exchange VFO A/B
Exchange = (1 << 1),
/// FROM_VFO -- VFO->MEM
VfoToMem = (1 << 2),
/// TO_VFO -- MEM->VFO
MemToVfo = (1 << 3),
/// MCL -- Memory clear
MemoryClear = (1 << 4),
/// UP -- UP increment VFO freq by tuning step*/
StepUp = (1 << 5),
/// DOWN -- DOWN decrement VFO freq by tuning step*/
StepDown = (1 << 6),
/// BAND_UP -- Band UP
BandUp = (1 << 7),
/// BAND_DOWN -- Band DOWN
BandDown = (1 << 8),
/// LEFT -- LEFT
Left = (1 << 9),
/// RIGHT -- RIGHT
Right = (1 << 10),
/// TUNE -- Start tune
Tune = (1 << 11),
/// TOGGLE -- Toggle VFOA and VFOB
Toggle = (1 << 12)
}
//Rig Scan operation
//
// Various scan operations supported by a rig.
// STRING used in rigctl
//
[Flags]
public enum RigScanOperation
{
/// '' No Scan
None = 0,
//// MEM -- Scan all memory channels
Memory = (1 << 0),
/// SLCT -- Scan all selected memory channels
Selected = (1 << 1),
/// PRIO -- Priority watch (mem or call channel)
Priority = (1 << 2),
/// PROG -- Programmed(edge) scan
Programmed = (1 << 3),
/// DELTA -- delta-f scan
Delta = (1 << 4),
/// VFO -- most basic scan
Vfo = (1 << 5),
/// PLT -- Scan using pipelined tuning
PipelinedTuning = (1 << 6),
/// STOP -- Stop scanning
Stop = (1 << 7),
}
//Memory channel type definition
//
// Definition of memory types. Depending on the type, the content
// of the memory channel has to be interpreted accordingly.
// For instance, a RIG_MTYPE_EDGE channel_t will hold only a start
// or stop frequency.
//
public enum RigMemoryChannel
{
/// None
None = 0,
/// Regular
Memory,
/// Scan edge
Edge,
/// Call channel
Call,
/// Memory pad
MemoryPad,
/// Satellite
Satellite,
/// VFO/Band channel
VfoBand,
/// Priority channel
Priority
}
//Radio mode
//
// Various modes supported by a rig.
// STRING used in rigctl
[Flags]
public enum RigMode
{
/// '' -- None
None = 0,
/// AM -- Amplitude Modulation
AM = (1 << 0),
/// CW -- CW "normal" sideband
CW = (1 << 1),
/// USB -- Upper Side Band
USB = (1 << 2),
/// LSB -- Lower Side Band
LSB = (1 << 3),
/// RTTY -- Radio Teletype
RTTY = (1 << 4),
/// FM -- "narrow" band FM
FM = (1 << 5),
/// WFM -- broadcast wide FM
WFM = (1 << 6),
/// CWR -- CW "reverse" sideband
CWR = (1 << 7),
/// RTTYR -- RTTY "reverse" sideband
RTTYR = (1 << 8),
/// AMS -- Amplitude Modulation Synchronous
AMS = (1 << 9),
/// PKTLSB -- Packet/Digital LSB mode (dedicated port)
[TextName("Packet LSB")]
PacketLSB = (1 << 10),
/// PKTUSB -- Packet/Digital USB mode (dedicated port)
[TextName("Packet USB")]
PacketUSB = (1 << 11),
/// PKTFM -- Packet/Digital FM mode (dedicated port)
[TextName("Packet FM")]
PacketFM = (1 << 12),
/// ECSSUSB -- Exalted Carrier Single Sideband USB
EcssUSB = (1 << 13),
/// ECSSLSB -- Exalted Carrier Single Sideband LSB
EcssLSB = (1 << 14),
/// FAX -- Facsimile Mode
FAX = (1 << 15),
/// SAM -- Synchronous AM double sideband
SAM = (1 << 16),
/// SAL -- Synchronous AM lower sideband
SAL = (1 << 17),
/// SAH -- Synchronous AM upper (higher) sideband
SAH = (1 << 18),
/// DSB -- Double sideband suppressed carrier
DSB = (1 << 19),
/// MUST ALWAYS BE LAST, Max Count for dumpcaps.c
//TestMax
}
//rmode_t;
//Hamlib error codes
// Error code definition that can be returned by the Hamlib functions.
// Unless stated otherwise, Hamlib functions return the negative value
// of rig_errcode_e definitions in case of error, or 0 when successful.
public enum RigError
{
/// No error, operation completed successfully
OK = 0,
/// invalid parameter
InvalidParameter,
/// invalid configuration (serial,..)
InvalidConfiguration,
/// memory shortage
MemoryShortage,
/// function not implemented, but will be
NotImplemented,
/// communication timed out
Timeout,
/// IO error, including open failed
IO,
/// Internal Hamlib error, huh!
Internal,
/// Protocol error
Protocol,
/// Command rejected by the rig
CommandRejected,
/// Command performed, but arg truncated
ArgTruncated,
/// function not available
FunctionNotAvailable,
/// VFO not targetable
VFONotTargetable,
/// Error talking on the bus
BusError,
/// Collision on the bus
BusBusy,
/// NULL RIG handle or any invalid pointer parameter in get arg
InvalidRigHandle,
/// Invalid VFO
InvalidVFO,
/// Argument out of domain of func
ArgumentDomain
}
//PTT status
public enum PttMode
{
/// PTT desactivated
Off = 0,
/// PTT activated
On,
/// PTT Mic only, fallbacks on RIG_PTT_ON if unavailable
OnMic,
/// PTT Data (Mic-muted), fallbacks on RIG_PTT_ON if unavailable
OnData
}
//DCD status
public enum DcdState
{
/// Squelch closed
Off = 0,
/// Squelch open
On
}
//Repeater shift type
public enum RepeaterShift
{
/// No repeater shift
None = 0,
/// "-" shift
Minus,
/// "+" shift
Plus
}
//Split mode
public enum RigSplit
{
/// Split mode disabled
Off = 0,
/// Split mode enabled
On
}
[Flags]
public enum RigLevel
{
/// '' -- No Level
None = 0,
/// PREAMP -- Preamp, arg int (dB)
Preamp = (1 << 0),
/// ATT -- Attenuator, arg int (dB)
Attenuator = (1 << 1),
/// VOX -- VOX delay, arg int (tenth of seconds)
Vox = (1 << 2),
/// AF -- Volume, arg float [0.0 ... 1.0]
Volume = (1 << 3),
/// RF -- RF gain (not TX power), arg float [0.0 ... 1.0]
RF = (1 << 4),
/// SQL -- Squelch, arg float [0.0 ... 1.0]
Squelch = (1 << 5),
/// IF -- IF, arg int (Hz)
IF = (1 << 6),
/// APF -- Audio Peak Filter, arg float [0.0 ... 1.0]
AudioPeakFilter = (1 << 7),
/// NR -- Noise Reduction, arg float [0.0 ... 1.0]
NoiseReduction = (1 << 8),
/// PBT_IN -- Twin PBT (inside), arg float [0.0 ... 1.0]
TwinPbtIn = (1 << 9),
/// PBT_OUT -- Twin PBT (outside), arg float [0.0 ... 1.0]
TwinPbtOut = (1 << 10),
/// CWPITCH -- CW pitch, arg int (Hz)
CWPitch = (1 << 11),
/// RFPOWER -- RF Power, arg float [0.0 ... 1.0]
RFPower = (1 << 12),
/// MICGAIN -- MIC Gain, arg float [0.0 ... 1.0]
MicGain = (1 << 13),
/// KEYSPD -- Key Speed, arg int (WPM)
KeySpeed = (1 << 14),
/// NOTCHF -- Notch Freq., arg int (Hz)
NotchFrequency = (1 << 15),
/// COMP -- Compressor, arg float [0.0 ... 1.0]
Compressor = (1 << 16),
/// AGC -- AGC, arg int (see enum agc_level_e)
Agc = (1 << 17),
/// BKINDL -- BKin Delay, arg int (tenth of dots)
BKInDelay = (1 << 18),
/// BAL -- Balance (Dual Watch), arg float [0.0 ... 1.0]
Balance = (1 << 19),
/// METER -- Display meter, arg int (see enum meter_level_e)
DisplayMeter = (1 << 20),
/// VOXGAIN -- VOX gain level, arg float [0.0 ... 1.0]
VoxGain = (1 << 21),
/// Synonym of RIG_LEVEL_VOX
VoxDelay = Vox,
/// ANTIVOX -- anti-VOX level, arg float [0.0 ... 1.0]
AntiVox = (1 << 22),
/// SLOPE_LOW -- Slope tune, low frequency cut,
SlopeLow = (1 << 23),
/// SLOPE_HIGH -- Slope tune, high frequency cut,
SlopeHigh = (1 << 24),
/// BKIN_DLYMS -- BKin Delay, arg int Milliseconds
BKInDelayMS = (1 << 25),
//These are not settable
/// RAWSTR -- Raw (A/D) value for signal strength, specific to each rig, arg int
RIG_LEVEL_RAWSTR = (1 << 26),
/// SQLSTAT -- SQL status, arg int (open=1/closed=0). Deprecated, use get_dcd instead
RIG_LEVEL_SQLSTAT = (1 << 27),
/// SWR -- SWR, arg float [0.0 ... infinite]
Swr = (1 << 28),
/// ALC -- ALC, arg float
Alc = (1 << 29),
/// STRENGTH -- Effective (calibrated) signal strength relative to S9, arg int (dB)
RIG_LEVEL_STRENGTH = (1 << 30)
/// Bandwidth Control, arg int (Hz)
// RIG_LEVEL_BWC = (1<<31)
}
//Rig Parameters
//
// Parameters are settings that are not VFO specific.
// STRING used in rigctl
[Flags]
public enum RigParm
{
/// '' -- No Parm
None = 0,
/// ANN -- "Announce" level, see ann_t
Announce = (1 << 0),
/// APO -- Auto power off, int in minute
AutoPowerOff = (1 << 1),
/// BACKLIGHT -- LCD light, float [0.0 ... 1.0]
Backlight = (1 << 2),
/// BEEP -- Beep on keypressed, int (0,1)
Beep = (1 << 4),
/// TIME -- hh:mm:ss, int in seconds from 00:00:00
Time = (1 << 5),
/// BAT -- battery level, float [0.0 ... 1.0]
BatteryLevel = (1 << 6),
/// KEYLIGHT -- Button backlight, on/off
ButtonBacklight = (1 << 7)
}
// Rig type flags
[Flags]
public enum RigFlags
{
Other = 0,
/// Receiver
Receiver = (1 << 1),
/// Transmitter
Transmitter = (1 << 2),
Transceiver = (Receiver | Transmitter),
/// Scanner
Scanner = (1 << 3),
/// mobile sized
Mobile = (1 << 4),
/// handheld sized
Handheld = (1 << 5),
/// "Computer" rig
Computer = (1 << 6),
/// has trunking
Trunking = (1 << 7),
/// has APRS
Aprs = (1 << 8),
/// has TNC
Tnc = (1 << 9),
/// has DXCluster
DXCluster = (1 << 10),
/// dumb tuner
Tuner = (1 << 11),
Mask = (Transceiver | Scanner | Mobile | Handheld |
Computer | Trunking | Tuner),
}
[Flags]
public enum RigType
{
Other = 0,
Transceiver = RigFlags.Transceiver,
Handheld = (RigFlags.Transceiver | RigFlags.Handheld),
Mobile = (RigFlags.Transceiver | RigFlags.Mobile),
Receiver = RigFlags.Receiver,
PCReceiver = (RigFlags.Computer | RigFlags.Receiver),
Scanner = (RigFlags.Scanner | RigFlags.Receiver),
TrunkScanner = (RigFlags.Scanner | RigFlags.Trunking),
Computer = (RigFlags.Transceiver | RigFlags.Computer),
Tuner = RigFlags.Tuner,
}
public enum RigConf
{
/// String type
String,
/// Combo type
Combo,
/// Numeric type integer or real
Numeric,
/// on/off type
CheckButton,
/// Button type
Button
}
public enum RigTransceive
{
Off = 0,
Rig = 1,
Poll = 2,
}
public enum RigAgcLevel
{
Off = 0,
Superfast,
Fast,
Slow,
User,
Medium,
Auto
};
public static class ModeValue
{
public const int Any = 0;
}
}