1
+ // Copyright 2025 Guillaume Giraudon - Colquhoun Audio Laboratories
2
+
3
+
1
4
// / @file
2
- // / @brief Bryston
5
+ // / @brief Support for Bryston Protocols.
6
+ // / @note Currently only tested BP19/BR20 but should work for all Bryston Products.
3
7
4
8
5
9
// Supports:
12
16
13
17
14
18
// Constants
15
- const uint16_t kBrystonTick = 315 ;
16
- const uint16_t kBrystonHdrMarkTicks = 1 ;
17
- const uint16_t kBrystonHdrMark = kBrystonHdrMarkTicks * kBrystonTick ;
18
- const uint16_t kBrystonHdrSpaceTicks = 3 ;
19
- const uint16_t kBrystonHdrSpace = kBrystonHdrSpaceTicks * kBrystonTick ;
20
- const uint16_t kBrystonBitMarkTicks = 6 ;
21
- const uint16_t kBrystonBitMark = kBrystonBitMarkTicks * kBrystonTick ;
22
- const uint16_t kBrystonOneSpaceTicks = 1 ;
23
- const uint16_t kBrystonOneSpace = kBrystonOneSpaceTicks * kBrystonTick ;
24
- const uint16_t kBrystonZeroSpaceTicks = 6 ;
25
- const uint16_t kBrystonZeroSpace = kBrystonZeroSpaceTicks * kBrystonTick ;
26
- const uint16_t kBrystonMinGapTicks = 18 ;
27
- const uint16_t kBrystonMinGap = kBrystonMinGapTicks * kBrystonTick ;
19
+ const uint16_t kBrystonTicks = 315 ; // Number of bits in a Bryston message.
20
+ const uint16_t kBrystonHdrMark = 0 ;
21
+ const uint16_t kBrystonHdrSpace = 0 ;
22
+ const uint16_t kBrystonOneMark = 6 * kBrystonTicks ;
23
+ const uint16_t kBrystonOneSpace = 1 * kBrystonTicks ;
24
+ const uint16_t kBrystonZeroMark = 1 * kBrystonTicks ;
25
+ const uint16_t kBrystonZeroSpace = 6 * kBrystonTicks ;
26
+ const uint16_t kBrystonMinGap = 0 ;
27
+ const uint16_t kBrystonFooterMark = 0 ;
28
28
29
29
#if SEND_BRYSTON
30
30
// / Send a Bryston formatted message.
31
- // / Status: STABLE / Working.
32
31
// / @param[in] data The message to be sent.
33
32
// / @param[in] nbits The number of bits of message to be sent.
34
33
// / @param[in] repeat The number of times the command is to be repeated.
35
34
void IRsend::sendBryston (uint64_t data, uint16_t nbits, uint16_t repeat) {
36
- sendGeneric (kBrystonHdrMark , kBrystonHdrSpace , kBrystonBitMark , kBrystonOneSpace ,
37
- kBrystonBitMark , kBrystonZeroSpace , kBrystonBitMark , kBrystonMinGap , data,
35
+ Serial.printf (" Sending Bryston: %016llX\n " , data);
36
+
37
+ sendGeneric (kBrystonHdrMark , kBrystonHdrSpace , kBrystonOneMark , kBrystonOneSpace ,
38
+ kBrystonZeroMark , kBrystonZeroSpace , kBrystonFooterMark , kBrystonMinGap , data,
38
39
nbits, 38 , true , repeat, 33 );
39
40
}
40
41
#endif // SEND_Bryston
41
42
42
43
#if DECODE_BRYSTON
43
44
// / Decode the supplied Bryston message.
44
- // / Status: STABLE / Working.
45
45
// / @param[in,out] results Ptr to the data to decode & where to store the result
46
46
// / @param[in] offset The starting index to use when attempting to decode the
47
47
// / raw data. Typically/Defaults to kStartOffset.
@@ -58,9 +58,9 @@ bool IRrecv::decodeBryston(decode_results *results, uint16_t offset,
58
58
if (!matchGeneric (results->rawbuf + offset, &data,
59
59
results->rawlen - offset, nbits,
60
60
kBrystonHdrMark , kBrystonHdrSpace ,
61
- kBrystonBitMark , kBrystonOneSpace ,
62
- kBrystonBitMark , kBrystonZeroSpace ,
63
- kBrystonBitMark , kBrystonMinGap , true )) return false ;
61
+ kBrystonOneMark , kBrystonOneSpace ,
62
+ kBrystonZeroMark , kBrystonZeroSpace ,
63
+ kBrystonFooterMark , kBrystonMinGap , true )) return false ;
64
64
// Success
65
65
results->bits = nbits;
66
66
results->value = data;
0 commit comments