forked from LexOptical/E-Mount
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMessage05.cpp
More file actions
24 lines (19 loc) · 715 Bytes
/
Copy pathMessage05.cpp
File metadata and controls
24 lines (19 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "Arduino.h"
#include "Message05.h"
Message05::Message05(byte messageClass, int sequenceNumber, byte messageType, const byte *body, int bodyLength): Message(messageClass, sequenceNumber, messageType, body, bodyLength) {
}
Message05::Message05(byte *bufferFromWire, int wireLength): Message(bufferFromWire, wireLength) {
}
void Message05::setAperture(int value) {
aperture = value;
aperture %= 0xAB; // Enforce an arbirary max value for testing
//Set the bytes in our buffer
body[30] = aperture & 0xFF;
body[31] = aperture >> 8;
}
void Message05::updateBasedOn03(Message *input) {
if (input->bodyLength > 22) {
body[77] = input->body[21];
body[78] = input->body[22];
}
}